AAP-65260: feature flag restore#942
Conversation
📝 WalkthroughWalkthroughIntroduces a guard that skips feature flag initialization when database migrations are incomplete. Adds early return logic with debug logging to prevent purge_feature_flags and load_feature_flags execution until migrations are complete. Adds test coverage for this behavior. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 2 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
No actionable comments were generated in the recent review. 🎉 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. Comment |
|
DVCS PR Check Results: PR appears valid (JIRA key(s) found) |
|
## Description Alternativate fix to - ansible#918, with more concise check and corrected log message - What is being changed? Adds logic to block feature flags loading code from running during partial migrations - Why is this change needed? This change is needed to ensure restore flow works reliably - How does this change address the issue? This change addresses the issue by adding a guard to ensure that the feature flags load logic does not run when migrations are incomplete ## Type of Change <!-- Mandatory: Check one or more boxes that apply --> - [x] Bug fix (non-breaking change which fixes an issue) ## Self-Review Checklist <!-- These items help ensure quality - they complement our automated CI checks --> - [ ] I have performed a self-review of my code - [ ] I have added relevant comments to complex code sections - [ ] I have updated documentation where needed - [ ] I have considered the security impact of these changes - [ ] I have considered performance implications - [ ] I have thought about error handling and edge cases - [ ] I have tested the changes in my local environment ## Testing Instructions <!-- Optional for test-only changes. Mandatory for all other changes --> <!-- Must be detailed enough for reviewers to reproduce --> ### Prerequisites <!-- List any specific setup required --> ### Steps to Test 1. 2. 3. ### Expected Results <!-- Describe what should happen after following the steps --> ## Additional Context <!-- Optional but helpful information --> ### Required Actions <!-- Check if changes require work in other areas --> <!-- Remove section if no external actions needed --> - [ ] Requires documentation updates <!-- API docs, feature docs, deployment guides --> - [ ] Requires downstream repository changes <!-- Specify repos: django-ansible-base, eda-server, etc. --> - [ ] Requires infrastructure/deployment changes <!-- CI/CD, installer updates, new services --> - [ ] Requires coordination with other teams <!-- UI team, platform services, infrastructure --> - [ ] Blocked by PR/MR: #XXX <!-- Reference blocking PRs/MRs with brief context --> ### Screenshots/Logs <!-- Add if relevant to demonstrate the changes --> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Improved database migration reliability by adding a safety check that defers feature flag initialization until all pending migrations are complete, reducing potential errors during migration processes. <!-- end of auto-generated comment: release notes by coderabbit.ai -->



Description
Alternativate fix to - #918, with more concise check and corrected log message
Adds logic to block feature flags loading code from running during partial migrations
This change is needed to ensure restore flow works reliably
This change addresses the issue by adding a guard to ensure that the feature flags load logic does not run when migrations are incomplete
Type of Change
Self-Review Checklist
Testing Instructions
Prerequisites
Steps to Test
Expected Results
Additional Context
Required Actions
Screenshots/Logs
Summary by CodeRabbit