Repository navigation
Detect remote permission changes on undeployed permissions blocks in config-remote-sync #7716
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
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
e33189b
WIP: implement
ilyakuz-db e4d04e9
Inline current user lookup
ilyakuz-db b85e40a
Merge main into config-remote-sync-undeployed-permissions
ilyakuz-db f02bc8f
Skip the creator's CAN_USE when diffing undeployed permissions
ilyakuz-db b9f03a2
Merge main into config-remote-sync-undeployed-permissions
ilyakuz-db 19299a5
Reuse the ACLs readRemotePermissions read when finding job owners
ilyakuz-db File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
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 correct from a bundle perspective that they are merged?
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.
[AI] Yes, I think merging is right here. A resource's
permissionsblock is the whole ACL the bundle manages: deploy sends it withPermissions.Set(a PUT;DoCreategoes throughDoUpdate) plus the deploying user's entry, so any grant missing from the block is removed. Without thelate@example.comentry, the "Deploy keeps the remote owner and grant" step would drop the grant made in the UI, which is what sync is there to prevent.It is also the same merge sync already does for a deployed block: per principal, keyed by
user_name/group_name/service_principal_name, so a remote grant becomes an add, a changed level a replace and a principal removed remotely a remove (the job step further down in this test). The deploying user's own entry is skipped.The trade-off: with nothing deployed yet there is no state to compare against, so sync cannot tell a hand-written entry from a remote change, and a hand-written block that was never deployed is reverted to the remote ACL. That is the same remote-wins sync applies to other local edits that are not deployed yet (the plan marks them
Updateand sync writes the remote value; that is whatLocalEditcounts). If you would rather keep hand-written entries, the undeployed path can be limited to adds, so remote grants are picked up and nothing declared is replaced or removed; that is a small change.🤖 Factory-generated comment. I still review the code and double-check every claim myself.