-
Notifications
You must be signed in to change notification settings - Fork 33
IFC-1637 Add permission to review proposed changes #6868
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
CodSpeed Performance ReportMerging #6868 will not alter performanceComparing Summary
|
749101a
to
18f1a97
Compare
@@ -0,0 +1 @@ | |||
Add a permission to allow users to review proposed changes (identifier `global:review_proposed_change:allow_all`). Users with existing Infrahub instances may need to create this permission to use it. No newline at end of file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it possible to add a migration to add this permission?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm unsure if this is the job of a migration or the one of the upgrade
command (which setup the permissions if none of them exist).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The function upgrade_permissions
should take care of it automatically when executing the command infrahub upgrade
, would be good to validate that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does setup the permissions and roles but only if none of them exist.
c935336
to
561df5a
Compare
WalkthroughThe changes introduce a new global permission ( Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant GraphQL API
participant Permissions
participant Database
User->>GraphQL API: Submit reviewProposedChange mutation
GraphQL API->>Permissions: Check REVIEW_PROPOSED_CHANGE permission
alt Permission granted
Permissions-->>GraphQL API: Allow
GraphQL API->>Database: Process review (approve/reject)
Database-->>GraphQL API: Update proposed change
GraphQL API-->>User: Return result
else Permission denied
Permissions-->>GraphQL API: Deny
GraphQL API-->>User: Raise permission error
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~15–20 minutes Note ⚡️ Unit Test Generation is now available in beta!Learn more here, or try it out under "Finishing Touches" below. 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (8)
🧰 Additional context used📓 Path-based instructions (2)backend/**/*📄 CodeRabbit Inference Engine (.github/copilot-instructions.md)
Files:
backend/tests/**/*📄 CodeRabbit Inference Engine (.github/copilot-instructions.md)
Files:
🧬 Code Graph Analysis (1)backend/infrahub/core/initialization.py (3)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
🔇 Additional comments (24)
✨ Finishing Touches
🧪 Generate unit tests
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
f82bdf4
to
9d085b9
Compare
return role | ||
|
||
|
||
async def create_proposed_change_reviewer_role(db: InfrahubDatabase) -> CoreAccountRole: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need a followup issue to make sure that this is executed on an existing system b/c first_time_initialization
won't run?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have an internal issue about this, attached to the permission system in general.
8d05c5f
to
0016278
Compare
This change also reworks how default roles, groups and permissions are populated when initializing infrahub or running the upgrade command.
0016278
to
309b024
Compare
Summary by CodeRabbit
New Features
Improvements
Bug Fixes