Repository navigation
Detect remote permission changes on unmanaged resources in config-remote-sync - #7536
Open
ilyakuz-db wants to merge 1 commit into
Open
ilyakuz-db wants to merge 1 commit into
ilyakuz-db wants to merge 1 commit into
Conversation
Contributor
|
Commit: Regression test reportSelected 3 changed tests (limit=20, 0 not selected) 6 tests: regression=2 unreleased=0 coverage=4 failing=0
TestAccept/bundle/config-remote-sync/unmanaged_permissions/DMS=: branch ✅ | main (28bbf47) ❌ | latest (v1.26.0) ❌main (28bbf47): latest (v1.26.0): same output as main (28bbf47) TestAccept/bundle/config-remote-sync/unmanaged_permissions/DMS=true: branch ✅ | main (28bbf47) ❌ | latest (v1.26.0) ❌main (28bbf47): latest (v1.26.0): same output as main (28bbf47) |
Collaborator
✅ Integration test reportCommit: 0725cb9
Top 11 slowest tests (at least 2 minutes):
|
This branch has not been deployed
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.
Changes
bundle config-remote-syncnow picks up permissions added remotely to a deployed resource whose config declares none, and writes them back as apermissions:block.CalculatePlangets an opt-inreadUnmanagedPermissionsargument. Only config-remote-sync passestrue. With it, every deployed resource that supports the permissions API and has no permissions in config or state gets a Skip.permissionsentry, and the planner reads its remote ACL intoRemoteState.ExtractChangesturns that ACL into a singlepermissionsadd on the resource. It leaves outIS_OWNERand the current user'sCAN_MANAGE, because deploy adds those itself (FixPermissions).Declared permissions, bundle-level permissions and grants are still skipped, as in #5979.
Why
Permissions changed in the UI on a job or pipeline that the bundle never managed were silently ignored, so the synced config drifted from what is deployed. In the direct engine the permissions node only exists when the config or state already has it, so config-remote-sync never read those ACLs.
Deploy, destroy, bind and migrate pass
false, so their plans are unchanged. A failed ACL read (e.g. the user can't read the resource's permissions) only logs a warning instead of failing the sync. Resource keys that can't be referenced (spaces, quotes) are skipped, because the permissions node'sobject_idis a reference to the parent's ID.Tests
New acceptance test
config-remote-sync/unmanaged_permissions(job with two added users, pipeline with a group; the owner entry is dropped, and a second sync reports no changes). It replaces the commented-out permission stubs injob_fields/pipeline_fields, which also run on cloud where those example users don't exist. Added unit tests for the ACL filter and node selection. Ranconfig-remote-sync,resources/permissions,deployment/bind,migrateandplanacceptance tests locally;lint-qclean.