Skip to content

feat(migrations): add new field to maintenancephase#508

Open
cesar-richard wants to merge 4 commits intodevelopfrom
3205-add-maintenance-boolean-flag
Open

feat(migrations): add new field to maintenancephase#508
cesar-richard wants to merge 4 commits intodevelopfrom
3205-add-maintenance-boolean-flag

Conversation

@cesar-richard
Copy link
Copy Markdown
Contributor

@cesar-richard cesar-richard commented Apr 15, 2026

  • Adds a boolean field to hide an info banner on maintainance page
  • Also add a missing fhirfilter managers change migration

Blocks aphp/Cohort360-FrontEnd#1210
Blocks aphp/Cohort360-AdministrationPortal#22

Summary by CodeRabbit

  • New Features

    • Added configuration option to control visibility of data saved notification messages during maintenance operations.
  • Improvements

    • Enhanced underlying data management system with improved query handling capabilities and greater flexibility in model operations.

- Also add missing fhirfilter managers change migration
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 15, 2026

Warning

Rate limit exceeded

@cesar-richard has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 28 minutes and 3 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 28 minutes and 3 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 425a7172-aa85-4753-a070-3f3afd7591e0

📥 Commits

Reviewing files that changed from the base of the PR and between 645953f and bb948ab.

📒 Files selected for processing (3)
  • .github/workflows/main.yml
  • admin_cohort/services/maintenance.py
  • admin_cohort/tests/test_maintenance.py
📝 Walkthrough

Walkthrough

Two Django apps receive schema updates: MaintenancePhase model gains a new is_data_saved_message_hidden boolean field (via migration and model definition), and the fhirfilter model's managers are altered to explicitly set all_objects to a default Manager instance.

Changes

Cohort / File(s) Summary
MaintenancePhase Model Field
admin_cohort/migrations/0008_maintenancephase_is_data_saved_message_hidden.py, admin_cohort/models/maintenance.py
Added new boolean field is_data_saved_message_hidden with default value False to MaintenancePhase model via migration and model definition.
FHIRFilter Manager Alteration
cohort/migrations/0025_alter_fhirfilter_managers.py
Updated fhirfilter model managers by explicitly setting all_objects to a default django.db.models.manager.Manager() instance.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 A field is born, so boolean and bright,
With is_data_saved_message_hidden set just right!
And managers dance in migrations' embrace,
Schema updates hop into their place! 🌟

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding a new boolean field to the MaintenancePhase model via migration. It is concise, specific, and clearly communicates the primary modification.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 3205-add-maintenance-boolean-flag

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@admin_cohort/models/maintenance.py`:
- Line 27: The new model BooleanField is_data_saved_message_hidden must be
included in the WebSocket DTO: add a boolean field named
is_data_saved_message_hidden to the WSMaintenanceInfo schema (so it serializes
the model property) and update the maintenance_phase_to_info() function to
populate that field from the model (ensure you use the same key name and Boolean
value as in the model so WebSocket payloads include the flag).

In `@cohort/migrations/0025_alter_fhirfilter_managers.py`:
- Around line 13-20: The migration alters FhirFilter managers but only registers
('all_objects', ...), which replaces the model's managers and removes the
default objects manager used across the codebase; update the
migrations.AlterModelManagers operation for name='fhirfilter' to include both
managers (i.e., add an ('objects', django.db.models.manager.Manager()) entry
alongside ('all_objects', ...)) so the default FhirFilter.objects manager
remains available.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 785de6b1-2f51-43c7-9c19-679f536a55e0

📥 Commits

Reviewing files that changed from the base of the PR and between 419c714 and 645953f.

📒 Files selected for processing (3)
  • admin_cohort/migrations/0008_maintenancephase_is_data_saved_message_hidden.py
  • admin_cohort/models/maintenance.py
  • cohort/migrations/0025_alter_fhirfilter_managers.py

Comment thread admin_cohort/models/maintenance.py
Comment thread cohort/migrations/0025_alter_fhirfilter_managers.py Outdated
@cesar-richard cesar-richard marked this pull request as draft April 15, 2026 20:10
@cesar-richard cesar-richard force-pushed the 3205-add-maintenance-boolean-flag branch from c51f5e1 to f46d5cd Compare April 16, 2026 09:10
@cesar-richard cesar-richard marked this pull request as ready for review April 16, 2026 09:41
@cesar-richard cesar-richard requested a review from tfi90 April 16, 2026 09:45
@cesar-richard cesar-richard changed the base branch from main to develop May 4, 2026 07:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants