RHINENG-21627: vmaas_sync need to read size of repack tables - #1941
Merged
Merged
Conversation
Reviewer's guide (collapsed on small PRs)Reviewer's GuideUpdates database schema migration version and grants the vmaas_sync role USAGE on the repack schema, with corresponding up/down migration scripts to manage the new privilege. Flow diagram for migration 139 granting vmaas_sync repack schema usageflowchart TD
A["Start migration process"] --> B{"Migration direction?"}
B -->|"Up (apply)"| C["Run 139_grant_vmaas_sync_repack_schema.up.sql"]
C --> D["GRANT USAGE ON SCHEMA repack TO vmaas_sync"]
D --> E["Update schema_migrations version to 139"]
E --> F["End (vmaas_sync can use repack schema)"]
B -->|"Down (rollback)"| G["Run 139_grant_vmaas_sync_repack_schema.down.sql"]
G --> H["REVOKE USAGE ON SCHEMA repack FROM vmaas_sync"]
H --> I["Update schema_migrations version back from 139"]
I --> J["End (vmaas_sync cannot use repack schema)"]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey there - I've reviewed your changes - here's some feedback:
- Given the principle of least privilege, consider whether vmaas_sync truly needs USAGE on the entire repack schema or if access can be restricted to only the specific objects it must query for size information.
- If vmaas_sync needs to actually read from tables in the repack schema and not just reference them, you may also need explicit SELECT grants on those tables/views, since USAGE on the schema alone will not allow data access.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Given the principle of least privilege, consider whether vmaas_sync truly needs USAGE on the entire repack schema or if access can be restricted to only the specific objects it must query for size information.
- If vmaas_sync needs to actually read from tables in the repack schema and not just reference them, you may also need explicit SELECT grants on those tables/views, since USAGE on the schema alone will not allow data access.
## Individual Comments
### Comment 1
<location> `database_admin/schema/create_schema.sql:1045` </location>
<code_context>
+GRANT USAGE ON SCHEMA repack TO vmaas_sync;
</code_context>
<issue_to_address>
**issue:** Consider how this behaves when the `repack` schema is not present in a fresh or minimal environment.
If `repack` is created by an extension or optional component, this GRANT will fail in environments where that schema doesn’t exist yet (e.g., local dev or CI). Please either guard this with a conditional check (e.g., DO block checking `pg_namespace`) or ensure deployment ordering guarantees `repack` is created before this script runs.
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1941 +/- ##
=======================================
Coverage 58.84% 58.84%
=======================================
Files 131 131
Lines 8436 8436
=======================================
Hits 4964 4964
Misses 2937 2937
Partials 535 535
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Collaborator
Author
|
/retest |
|
Referenced Jiras: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Secure Coding Practices Checklist GitHub Link
Secure Coding Checklist
Summary by Sourcery
Enhancements: