feat(policy): rollback migration strategy for namespaced actions#3235
feat(policy): rollback migration strategy for namespaced actions#3235elizabethhealy wants to merge 5 commits intomainfrom
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: ASSERTIVE Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request enhances the database migration rollback process for namespaced actions. It introduces a robust mechanism to handle the transition from namespace-scoped actions back to global-only action semantics, ensuring that references are correctly remapped and duplicate rows are merged without manual intervention. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. The namespaces grow and expand, / But rollback was not quite as planned. / With logic now tight, / We merge them to right, / And leave the database safely spanned. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request implements a data-aware rollback strategy for the add_namespace_to_actions migration, ensuring that namespace-scoped actions are safely merged back into global actions by canonicalizing IDs and remapping references. The feedback focuses on performance optimizations for the migration script, including indexing the temporary remap table and utilizing TRUNCATE instead of DELETE for more efficient table repopulation.
service/policy/db/migrations/20260312000000_add_namespace_to_actions.sql
Show resolved
Hide resolved
service/policy/db/migrations/20260312000000_add_namespace_to_actions.sql
Show resolved
Hide resolved
service/policy/db/migrations/20260312000000_add_namespace_to_actions.sql
Show resolved
Hide resolved
service/policy/db/migrations/20260312000000_add_namespace_to_actions.sql
Show resolved
Hide resolved
Benchmark results, click to expandBenchmark authorization.GetDecisions Results:
Benchmark authorization.v2.GetMultiResourceDecision Results:
Benchmark Statistics
Bulk Benchmark Results
TDF3 Benchmark Results:
|
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
|
after seeding with namespaced policy and running migration down a few times to get to this migration: |
Benchmark results, click to expandBenchmark authorization.GetDecisions Results:
Benchmark authorization.v2.GetMultiResourceDecision Results:
Benchmark Statistics
Bulk Benchmark Results
TDF3 Benchmark Results:
|
|
This looks good to me. Do you have any ideas for how we can test the down migration path better in CI? This seems like a particularly risky migration. |
|
@jakedoublev i think its definitely possible but it will probably be a larger effort since we dont have any migration test infra atm |
Proposed Changes
Highlights
Checklist
Testing Instructions
Summary by CodeRabbit
Release Notes
New Features
Chores