Repository navigation
feat(deploy-approvals): a new request supersedes the branch's older pending ones - #237
Open
ndbroadbent wants to merge 1 commit into
Open
ndbroadbent wants to merge 1 commit into
ndbroadbent wants to merge 1 commit into
Conversation
…ending ones CI raises a deploy approval request for every passing build, so a busy branch left a pending request behind for each push, each open for a week, and an approver couldn't tell which one mattered. - A new request expires the older pending requests for the same app, branch and target API token, in one transaction with an audit event for each (deploy_approval_request.expire, reason superseded, superseded_by the new request). Approved requests are left alone. A failure doesn't fail the new request: the older ones expire by age. - DEPLOY_APPROVAL_PENDING_MAX_AGE defaults to 24 hours instead of 7 days. - ExpireDeployApprovalRequests and the new SupersedeDeployApprovalRequests share the transaction, lock and audit append.
|
|
Overall Grade |
Security Reliability Complexity Hygiene |
Code Review Summary
| Analyzer | Status | Updated (UTC) | Details |
|---|---|---|---|
| JavaScript | Dec 3, 2026 2:57a.m. | Review ↗ | |
| Go | Dec 3, 2026 2:57a.m. | Review ↗ |
Important
AI Review is run only on demand for your team. We're only showing results of static analysis review right now. To trigger AI Review, comment @deepsourcebot review on this thread.
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.
Problem
A CI pipeline that raises a deploy approval request for every passing build leaves a pending request behind for each push to a branch. Each stays open for
DEPLOY_APPROVAL_PENDING_MAX_AGE(7 days), so the open list fills with stale requests and an approver (on the web UI, the CLI or a phone) can't tell which one matters.Change
SupersedeDeployApprovalRequests). It runs in one transaction under the audit chain lock, with an audit event per request:deploy_approval_request.expirebysystem, withreason: supersededandsuperseded_by(the new request's ID). Approved requests are never touched, since one may be deploying. A request with no branch supersedes nothing. If superseding fails, the new request still succeeds and the error goes to the log and Sentry; the older requests then expire by age.DEPLOY_APPROVAL_PENDING_MAX_AGEdefaults to24hinstead of168h.ExpireDeployApprovalRequestsand the new query share one helper for the transaction, lock and audit appends, and one row scanner.Testing
supersededaudit details, and a request on another branch stays pending.Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.