Repository navigation
fix(server): delete secret versions once no deployment can mount them - #417
Open
PiquelChips wants to merge 3 commits into
Open
PiquelChips wants to merge 3 commits into
PiquelChips wants to merge 3 commits into
Conversation
Contributor
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 53 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
PiquelChips
marked this pull request as ready for review
November 10, 2026 15:56
PiquelChips
force-pushed
the
g13/secret-gc
branch
4 times, most recently
from
November 12, 2026 21:44
cc1f833 to
80e2aee
Compare
STORE-05: rotating a secret kept every earlier version and its Docker secret forever, so an environment that rotated about 1,000 times hit the secret quota. The history pass now removes the Docker secrets of versions and stored-secret copies that aren't current, that no deployment pins and that no prepared or running target names, then their records, and stored versions no environment has a copy of.
PiquelChips
force-pushed
the
g13/secret-gc
branch
from
November 13, 2026 12:47
80e2aee to
c683f28
Compare
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.
Secret versions were never deleted (STORE-05). Each rotation or regeneration kept the old version's row and its Docker secret for good, so an environment that rotated a secret about 1,000 times hit
SecretQuotaand could only recover by deleting the secret. Old versions only need to live while something can still mount them.The coordinator's history pass now collects them, right after the rest of history pruning:
Store::unused_secret_versionsselects generated versions and stored-secret copies that aren't their secret's current generation, that no deployment pins, and whose Docker secret no environment's running target names (prepared targets name only pinned versions). Secrets mid-deletion are left to their deletion.remove_secretsaction attributed to the daemon. Only once Docker confirms does it delete their records. A failure keeps them for the next pass.A version that is unused stays unused: a new deployment pins only current generations, and a restore only versions its retained deployment already pins. So restore and rollback keep working for every retained deployment.
This only has an effect once deployments are pruned, which #414 (STORE-04) adds. Until then, every version stays pinned by its deployment. The two PRs are independent and can merge in either order.
Proof: a new store test rotates a stored and a generated secret, and leaves a never-deployed stored version behind. While the first deployment exists, nothing is collected. Once it's gone, exactly its two pinned versions are reported, and after collection only the pinned and current versions remain. The secret, prune and scan tests pass (59), as does
just docs. A fake-Docker test runs a full controller pass after the pinning deployment's operation is deleted. With secret removal failing, the old copy's record stays. Once removal works, the old Docker secret and its record are gone, and the new one remains.Note
Written by Claude Opus 5.5 in Claude Code and reviewed by Claude Opus 5.5 (via T3 Code)
🤖 Generated with Claude Code