Repository navigation
feat: implement issue #1103 — cmd_rollback moves the bare <agent>/<ring> tag, not <agent>/v<M>-<ring> — the emergency lever is a silent no-op for every v-scoped agent #1117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
1d3987d
ecd3875
a547522
de3b3f2
dbac61d
088231d
359abbb
e2850dd
15e9fc3
723aefd
2c96cd1
c61fea4
22b0e96
4045089
2e303ce
1b18267
39559d9
c05d547
8c2afff
b9cc376
afbd68c
44323d9
ae7b4c5
7d05098
7fe7de8
77671cb
2a47934
2b40efa
358af14
dc16e07
4019de9
c32dba2
d4b6eb6
4455b08
1e4a3a6
b931e21
c2e68ef
f52ba49
9d3decb
8ee5e4a
7f399ce
483a8cf
5eed5f0
fb8828a
03f546d
3cfffa6
e7fce0c
812fa9a
d5a8ee5
196e17f
9c9d84e
d86a772
8ec1ee2
c07f182
2e48467
3fec3e8
09af8c1
c51cb12
2fa53bd
1151c62
c3a8de0
54e8f53
e45fcc6
23bd68b
8abde5f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2513,14 +2513,46 @@ cmd_rollback() { | |
| local target | ||
| target="$(_gh_tag_commit "$host" "$agent/$to")" | ||
| [ -z "$target" ] && { echo "::error::release tag $agent/$to not found on $host" >&2; return 1; } | ||
| echo "rolling back $agent/$ring -> $to (${target:0:12}) on $host" | ||
| # Resolve the RING tag with fallback (major-scoped-channels epic #657 F4): PREFER the | ||
| # v-scoped `<agent>/v<M>-<ring>` within the agent's current major line when it exists, | ||
| # else the legacy bare `<agent>/<ring>`. Moving the bare tag on a v-scoped fleet relocated | ||
| # a tag no caller pins and still exited 0 — a silent no-op on the emergency lever (#1103). | ||
| # First check if the v-scoped tier exists; if not, fall back to bare. | ||
| # (The `--to` release tag above is always the bare immutable `<agent>/vX.Y.Z`, so it is | ||
| # correctly resolved without a major.) | ||
| local ring_tag ring_commit | ||
| IFS=$'\t' read -r ring_tag ring_commit < <(_resolved_channel "$agent" "$ring") | ||
| # If the resolved tag (v-scoped or bare from _resolved_channel's logic) doesn't exist, | ||
| # and we got v-scoped, try the bare tag as a fallback. The agent may have released v<M>.*.* | ||
| # but not yet seeded channel tier tags, so bare still matters as an intermediate step. | ||
| if [ -z "$ring_commit" ] && [[ "$ring_tag" == *"/v"[0-9]* ]]; then | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win 🔎 Supported by static analysis🏁 Script executed: #!/usr/bin/env bash
set -euo pipefail
# Inspect the remote tag lookup contract and shell error handling.
rg -n -C 12 '(^set -|^_gh_tag_commit\(|^_channel_tag_commit\(|^cmd_rollback\()' \
scripts/canary-rollout.sh
# Inspect existing failure stubs for tag reads.
rg -n -C 8 'git/ref/tags|_gh_tag_commit|rollback' tests/canary_rollout.batsRepository: petry-projects/.github Length of output: 46800 🏁 Script executed: #!/usr/bin/env bash
set -euo pipefail
printf '%s\n' '--- channel lookup ---'
sed -n '281,320p' scripts/canary-rollout.sh
printf '%s\n' '--- rollback resolution ---'
sed -n '1383,1465p' scripts/canary-rollout.sh
printf '%s\n' '--- related resolver ---'
rg -n -C 18 '^_resolved_channel\(|_channel_tag_commit' scripts/canary-rollout.shRepository: petry-projects/.github Length of output: 17293 Abort on non-not-found tag lookup failures.
🤖 Prompt for AI AgentsSource: Learnings |
||
| # Constructed ring_tag was v-scoped and doesn't exist; try bare. | ||
| local bare_commit bare_tag | ||
| bare_tag="$agent/$ring" | ||
| bare_commit="$(_channel_tag_commit "$agent" "$ring")" | ||
| if [ -n "$bare_commit" ]; then | ||
| ring_tag="$bare_tag" | ||
| ring_commit="$bare_commit" | ||
| else | ||
| # Both v-scoped and bare are absent; report the bare tag in the error message. | ||
| ring_tag="$bare_tag" | ||
| fi | ||
| fi | ||
| # Fail loudly rather than no-op (#1103): if BOTH v-scoped and bare (if tried) don't exist, | ||
| # refuse to create-and-move a channel tag nobody pins. The worst failure mode for rollback | ||
| # is a silent no-op that exits 0, so make it loud. | ||
| if [ -z "$ring_commit" ]; then | ||
| echo "::error::rollback target ring tag $ring_tag does not exist on $host — refusing to create-and-move a channel tag nobody pins (that would be a silent no-op). Check the ring name and the agent's major line." >&2 | ||
| return 1 | ||
| fi | ||
|
Comment on lines
+2544
to
+2547
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Suggestion: Assessment: 🟠 Prompt for AI Agent 🤖This is a comment left during a code review.
**Path:** scripts/canary-rollout.sh
**Line:** 1375:1378
**Comment:**
*Possible Bug: `_channel_tag_commit` hides GitHub read failures as empty output, so a transient outage is reported as a missing tag and blocks an otherwise valid emergency rollback.
Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix |
||
| echo "rolling back $ring_tag -> $to (${target:0:12}) on $host" | ||
| if [ "$dry" = true ]; then | ||
| echo "[DRY-RUN] would: gh api PATCH repos/$host/git/refs/tags/$agent/$ring sha=$target (force)" | ||
| echo "[DRY-RUN] would: gh api PATCH repos/$host/git/refs/tags/$ring_tag sha=$target (force)" | ||
| return 0 | ||
| fi | ||
| _gh_move_tag "$host" "$agent/$ring" "$target" \ | ||
| || { echo "::error::failed to move $agent/$ring -> $to on $host" >&2; return 1; } | ||
| echo "rolled back $agent/$ring -> $to" | ||
| _gh_move_tag "$host" "$ring_tag" "$target" \ | ||
| || { echo "::error::failed to move $ring_tag -> $to on $host" >&2; return 1; } | ||
| echo "rolled back $ring_tag -> $to" | ||
| } | ||
|
|
||
| # ── blocker-issue + fleet-status automation (auto-triage of held promotions) ──── | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion:
_resolved_channelderives the tag from the highest release major, not the caller’s channel major, so valid pins likev1-stableare skipped or rollback targets an unused tag. [api mismatch]Assessment: 🟠
Major· 🔁Occurrence: SometimesPrompt for AI Agent 🤖