Repository navigation
Quick Deploy clone: a root admin may smoke-clone an unpromoted bake - #314
Merged
Merged
Conversation
`channel: "unstable"` was allowed only for role `group_admin`. `root` inherits `group_admin` in Casbin, so the same admin who can POST /api/admin/bake got 403 on the smoke clone of that bake (seen on production), and the bake could never be promoted. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Problem (seen on production after #310).
POST /api/v1/deploy/clonewithchannel: "unstable"checkeduser.role == "group_admin"literally. In Casbin,rootinheritsgroup_admin, so arootadmin passes/api/admin/bakeand/promote. The smoke clone of that admin's own bake was refused:As a result
bake_pipeline.pycan never promote a bake that arootadmin started.Change. The check accepts
group_admin | root, the same asroutes/agent/audit.rs. Buyers (group_user) still get 403.Test.
a_root_admin_may_smoke_clone_an_unpromoted_bakeintests/bake_channels.rs. It failed against the old code with 403, the same as production, and now returns 404 (past the admin check, no unstable bake). All 8 tests in the file pass against real Postgres.clippyandrustfmtreport nothing new in the changed lines.🤖 Generated with Claude Code