Repository navigation
fix: check GCP registry consumers without decoding whole deployment records - #937
Merged
Merged
Conversation
…ecords A GCP revoke removes the project's shared Cloud Run grant only when no other deployment runs in that project. It answered that by listing every GCP deployment as a full record. One record with stack or runtime state the current types reject failed the list, so every GCP revoke failed and deleted deployments kept read access to the registry. Add DeploymentStore::has_other_gcp_project_deployment. The default reads list_deployments, so the standalone store keeps its behavior; a store that can read a deployment's id, status and environment without the rest of the record overrides it. The revoke uses it and still fails closed when the check cannot be answered. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Member
Author
|
@greptileai review |
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Member
Author
|
@greptileai review |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Member
Author
|
@greptileai review |
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.
Summary
When a GCP deployment is deleted, the manager removes the project's shared Cloud Run grant on the artifact registry only if no other deployment runs in that project. It checked this by listing every GCP deployment as a full
DeploymentRecord. That decode includes stack and runtime state. If one record carries a resource config that the current types reject (for example, a prepared Worker from an older release that still hasingress), the whole list fails. Then every GCP revoke on that manager fails, and deleted deployments keep read access to the registry. The failure happens after the deletion is committed, so nothing retries it.DeploymentStore::has_other_gcp_project_deployment(caller, project_number, excluding_deployment_id)answers that one question. The default implementation readslist_deployments, so the SQLite store behaves the same as before. A store that can read a deployment's id, status and environment without decoding the rest of the record should override it.revoke_registry_accessuses it. If the check cannot be answered, it still fails closed: the grant stays and the revoke returnsREGISTRY_ACCESS_CLEANUP_FAILED.Testing
the_last_deployment_in_a_gcp_project_revokes_its_shared_grant,a_shared_grant_stays_while_another_deployment_uses_the_project,an_unanswered_consumer_check_keeps_the_grant_and_fails_the_revoke: these runrevoke_registry_accessagainst a recording registry and a mock store. The mock store fails the test if the revoke callslist_deployments.only_another_deployment_in_the_same_project_keeps_the_shared_grant: tests the default implementation against a real SQLite store (self, another project, a sibling, then the sibling removed).cargo test -p alien-manager --lib: 316 passed (Linux sandbox,CARGO_INCREMENTAL=0, debuginfo off).🤖 Generated with Claude Code