Repository navigation
fix(showcase): allow promote to hold named services and scope digest to the requested service - #7955
Conversation
…d service promote-fleet.sh forwarded --digest to every service in the closure plan. For a single-service promote the closure also contains aimock, pocketbase, dashboard, harness and harness-workers, so a digest override pinned all of them to the requested service's image. resolve-promote-targets.sh now emits digest_service (the requested SSOT name) and promote-fleet.sh forwards --digest only to that service. Every other closure member promotes from its own staging running digest. A digest that cannot be scoped to one service in the plan is refused before any promote runs.
…uched on promote A single-service promote always adds dashboard, harness and harness-workers to its closure, so there was no way to promote a demo service without also promoting staging's harness and workers to prod. The new optional `hold` input takes comma-separated SSOT keys or dispatch_names. resolve-promote-targets.sh removes each held service from services_csv, closure_csv and closure_plan after the dependency walk, emits held_csv, and lists the held services in the step summary as held, unchanged. An unknown name, holding the requested service itself, or a hold that empties `all` is rejected. promote-fleet.sh reports the held set and, as a second check, refuses to promote anything if a held service is still in the plan. No gate is skipped. verify-prod, the compatibility refresh, the prod equivalence re-sweep and lint-prod still run; the ones that touch a held service see its current prod image.
|
Important Review skippedIgnore keyword(s) in the title. ⛔ Ignored keywords: 4
Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
Production Digest-Pinning AuditAll 43 services digest-pinned. Run 2026-10-23 13:22:59 PDT — 0 finding(s). |
|
Size Change: 0 B Total Size: 1.88 MB ℹ️ View Unchanged
|
`IFS=, read` stops at the first newline, so a pasted multi-line hold list such as "harness,\nharness-workers" held only harness and still promoted harness-workers, with exit 0. resolve-promote-targets.sh now rejects any hold value with a character outside lowercase letters, digits, comma, space and hyphen (CR, LF and tab included). It also rejects a held service that is not in this promote's closure, because holding it would change nothing. All validation now runs before any output is written, so a rejected hold emits nothing.
contextablemark
left a comment
There was a problem hiding this comment.
Review in progress; two reproduced correctness findings need correction before merge. The new hold set must remain in production verification even though it is excluded from mutation, and the documented fleet HELD_CSV entrypoint must reject multiline values before parsing. No production dispatch is authorized by this review.
| closure_csv: ${{ steps.resolve.outputs.closure_csv }} | ||
| # Machine-readable `tier:name` form of the closure for U4 to consume. | ||
| closure_plan: ${{ steps.resolve.outputs.closure_plan }} | ||
| # Services removed from the closure by the `hold` input (prod unchanged). |
There was a problem hiding this comment.
Held members are excluded from the mutation plan, but held_csv is sent only to fleet. Prod verification/compatibility/resweep still receive only succeeded_csv. For service=all, hold=showcase-langgraph-python, shared aimock can change while the existing held integration is omitted from both direct health and equivalence checks. Keep mutation filtered, and use a separate production verification set containing successful promotions plus held members, excluding failed promotion targets.
| # Held services (HELD_CSV), trimmed, empty tokens dropped. Used by | ||
| # preflight_scope and the summary. | ||
| held=() | ||
| IFS=',' read -ra HELD_TOKENS <<< "${HELD_CSV:-}" |
There was a problem hiding this comment.
This single read stops at LF. A direct documented invocation with CLOSURE_PLAN='0:svc-a,1:svc-h' and HELD_CSV=$'svc-outside,\nsvc-h' invokes both services and exits0 through a successful local CLI stub; svc-h is silently lost from the hold set. The resolver rejects malformed raw HOLD, but this fleet entrypoint also needs whole-value validation before parsing, with a regression asserting zero promote invocations.
…med HELD_CSV Held services were left out of every prod check. verify-prod, the compatibility refresh and the equivalence re-sweep all read succeeded_csv, so service=all with hold=showcase-langgraph-python could update aimock and never verify the held integration against it. promote-fleet.sh now emits verify_csv: the succeeded set plus the held set, with failed and not-attempted services excluded. The workflow's three verification consumers read verify_csv. succeeded_csv stays the mutation set. promote-fleet.sh also parsed HELD_CSV with a single `read`, which stops at the first LF. HELD_CSV=$'svc-outside,\nsvc-h' held only svc-outside and promoted svc-h with exit 0. The whole value is now validated before parsing with the same rule as the resolver: only lowercase letters, digits, comma, space and hyphen (no CR, LF or tab), and each token must be a plain service name. Anything else stops the run before any promote.
contextablemark
left a comment
There was a problem hiding this comment.
Additional reproduced held-service safety issue from executing the real sibling CLI with intercepted transports. No live infrastructure was contacted.
| local svc h n=0 only="" found=0 | ||
| for svc in "$@"; do | ||
| [ -n "$svc" ] || continue | ||
| n=$(( n + 1 )) |
There was a problem hiding this comment.
Reject option-like service tokens here before passing them to the Ruby CLI. With SERVICES_CSV=--yes HELD_CSV=shell (also CLOSURE_PLAN=0:--yes), this guard sees no literal shell overlap and permits promote --yes --yes --non-interactive. The real Ruby OptionParser consumes the purported service as an option, defaults to fleet promotion, and our offline transport recorded 50 image-update requests including held shell while the wrapper claimed shell was held. Current resolver names prevent this in the workflow path, but it violates this new direct-entrypoint hold guarantee. Add preflight refusal and a regression asserting zero consumer mutations.
…he service after -- SERVICES_CSV=--yes (or CLOSURE_PLAN=2:--yes) with HELD_CSV=shell made promote-fleet call `promote --yes --yes --non-interactive`. The CLI's OptionParser read the service as a flag, the positional disappeared, and bin/railway promoted the whole fleet, including the held shell, while the wrapper exited 0 and reported shell as HELD. promote-input-guard.sh is now the one input guard, sourced by both resolve-promote-targets.sh and promote-fleet.sh. It validates each value whole, before parsing, and stops the run before any CLI call. A service list must be [a-z0-9-] names joined by commas. It rejects CR, LF, tab, space, empty entries, a leading '-', and any name not in the SSOT. A digest may contain only image-ref characters and must not start with '-'. The guard covers the resolver's service, hold and digest inputs and the fleet's SERVICES_CSV, CLOSURE_PLAN (the name after the tier prefix), HELD_CSV, DIGEST_SERVICE and DIGEST. promote-fleet now passes each service after `--`, so the CLI always reads it as the positional argument. The guard also tightens old behavior: stray commas and whitespace in SERVICES_CSV or CLOSURE_PLAN used to be skipped or trimmed. They now fail closed. The resolver never emits them.
…oting CLOSURE_PLAN='0:,2:showcase-ag2' passed the tier-prefix check. The empty name then vanished when the names were joined, and showcase-ag2 promoted with exit 0. promote-fleet.sh now runs the input guard on each tier:name entry's name on its own, before joining, so an empty name (leading, repeated or trailing) stops the run before any CLI call.
…ion plan The promote step summary said the leaf set was "what actually promotes now" and described the tiered closure as surfaced only for the equivalence gate. The promote job runs promote-fleet.sh from closure_plan, so for service=agno with hold=harness,harness-workers it actually promotes aimock, pocketbase, dashboard and showcase-agno. The summary now lists the requested service(s) separately, labels the filtered tiered closure as the mutation plan this run actually promotes in prod, and keeps listing the held services as held, unchanged.
contextablemark
left a comment
There was a problem hiding this comment.
Review complete at 10d384d. The reproduced hold-verification, multiline input, option-token, empty-tier-name and mutation-summary findings are corrected; no mandatory findings remain. Exact-head CI is green, including the 212/212 shell suite. This supersedes my earlier changes request. Mark has explicitly authorized merging for the normal staging deployment and soak. Production promotion remains on hold pending hold-list reconciliation and separate authorization; this approval does not establish production functional recovery or clear the retained follow-ups.
Decision owner: Mark (CPK-8652 / Showcase prod recovery). Do not merge without his review.
This is a proposal. Nothing was dispatched or deployed.
Problem
CPK-8652 says that staging's harness and harness-workers must not be promoted to prod. But
showcase_promote.ymlcannot promote a demo service without them:resolve-promote-targets.shalways adds every Tier-1 service (dashboard, harness, harness-workers) to the closure. This happens even forservice=showcase-aimock. The workflow has no input to leave a service out.promote-fleet.shsent--digest <ref>to every service in the closure.bin/railwayaccepts a digest for its positional service, and promote-fleet calls it once per service. So a digest override for one service pinned aimock, pocketbase, dashboard, harness and harness-workers to that service's image too.Because of this, prod demos cannot be restored through the promote workflow without breaking CPK-8652.
Change
The first two commits make the change. The review-fix commits after them harden input validation and widen prod verification to the held services; each is described under Review fix below.
fix(showcase): the digest override applies only to the requested service.resolve-promote-targets.shemitsdigest_service(the requested SSOT name).promote-fleet.shsends--digestonly to that service. All other closure members promote from their own staging running digest, as they do without a digest. If a digest cannot be tied to exactly one service in the plan, promote-fleet stops before it promotes anything. That covers two cases: a multi-service plan withoutDIGEST_SERVICE, and aDIGEST_SERVICEthat is not in the plan. The old single-service call shape (DIGESTwith a one-service plan) still works. (Later review fixes put every input through one guard and pass the service after--; see below.)feat(showcase): new optionalholdinput. It takes a comma-separated list of SSOT keys or dispatch_names, for examplehold=harness,harness-workers.services_csv,closure_csvandclosure_plan, so prod keeps that service's current image.held_csvand lists the held services in the step summary under Held, unchanged.all.promote-fleet.shlists the held set in its summary (HELD (n): ...). As a second check, it promotes nothing if a held service is still in the plan.Gates are kept, and now cover the held services
No gate is skipped or weakened.
verify-staging-precondition, the per-servicebin/railwayP1–P6 checks,verify-prod,compatibility-refresh, the prod equivalence re-sweep and the lint-prod pinned-ness gate all still run.What changed in how they are fed and how inputs are checked (details in the Review fix sections):
verify_csv). promote-fleet emitsverify_csv= the succeeded set plus the held set (failed and not-attempted services excluded).verify-prod,compatibility-refreshand the equivalence re-sweep now readverify_csvinstead ofsucceeded_csv, so the held services are checked in prod on their current image next to the promoted ones.succeeded_csvstays the mutation set. With nothing held,verify_csvequalssucceeded_csv, so a run withoutholdverifies the same set as before.HELD_CSVvalidation. promote-fleet validates the wholeHELD_CSVvalue before parsing and refuses the run if a held service is still in the plan.preflight_scopeand the CLI (fromSERVICES_CSV,CLOSURE_PLAN,HELD_CSV,DIGEST_SERVICE) must be a known SSOT name of[a-z0-9-]that does not start with-, checked by the shared input guard beforepreflight_scoperuns.preflight_scopethen refuses a held service in the plan, or a digest that cannot be scoped to exactly one planned service.CLOSURE_PLANtier:nameentry must have a non-empty name, checked per entry before the names are joined.lint-prod still checks every prod service, including the held ones, for an immutable
@sha256:pin. Withhold=harness,harness-workers, the prod control plane used by the re-sweep and the compatibility refresh is the current prod harness and workers.Red / green (real scripts, committed SSOT
railway-envs.generated.json, fake Railway CLI shim; no Railway calls)RED,
origin/main3f73c87The resolver has no hold, so harness and harness-workers are always in the closure:
promote-fleet sends the digest to all six services:
bats before the fix: 50 ok, 14 not ok. The 14 failures are all new tests: 9 in
resolve-promote-targets.bats(#18–26) and 5 inpromote-fleet.bats(#60–64).GREEN, this branch, same invocations
Step summary:
End to end: the resolver output (with
DIGESTset) goes into promote-fleet, which runs against the fake railway. Exit 0:Same plan without
DIGEST_SERVICE: refused, 0 railway calls. Plan with a held service added back in: refused, 0 railway calls.Review fix (aab5124):
holdfails closedMark found that a multi-line
holdvalue ("harness, harness-workers") held onlyharnessand still promotedharness-workers, with exit 0. The resolver now rejects any character outside[a-z0-9, -], including CR, LF and tab. It also rejects a held service that is not in the closure (no silent no-op). All validation runs before any output is written. 5 bats regressions were added; 4 of them fail on d572327 and all pass now.Review fix (c2fa495): held services are verified; HELD_CSV fails closed
verify_csv: the succeeded set plus the held set, with failed and not-attempted services excluded.verify-prod,compatibility-refreshand the equivalence re-sweep now readverify_csv, so prod is checked for the held services on their current image.succeeded_csvstays the mutation set. Before: withservice=allandhold=showcase-langgraph-python,succeeded_csvhad 41 services and no langgraph-python. After:verify_csvhas 42 and includes it.HELD_CSVfails closed in promote-fleet. The whole value is validated with the same rule as the resolver: no CR, LF, tab or other character, and each token must be a plain name. Before:HELD_CSV=$'svc-outside,\nsvc-h'promotedsvc-hwith exit 0. After: refused, with 0 railway calls.Review fix (3d88a9a): one input guard, and the service is passed after
--Mark's repro:
SERVICES_CSV=--yes HELD_CSV=shell(andCLOSURE_PLAN=2:--yes) made the fleet callpromote --yes --yes --non-interactive. The real CLI's OptionParser read the service as a flag, sooptions[:service]was nil. It promoted the whole fleet, including the heldshell, and the wrapper exited 0 and reported shell as HELD.showcase/scripts/promote-input-guard.sh, sourced by both the resolver and promote-fleet, is the one input guard. Every value is validated whole, before parsing, and the run stops before any CLI call. A service list must be[a-z0-9-]SSOT names joined by commas: no CR/LF/tab/space, no empty entry, no leading-. A digest may contain only image-ref characters and must not start with-. The guard covers resolverservice/hold/digestand fleetSERVICES_CSV,CLOSURE_PLAN(the name afterN:),HELD_CSV,DIGEST_SERVICEandDIGEST.promote --yes --non-interactive [--digest D] -- <svc>. I checked offline against the real CLI that--keeps the service positional;-- --yesis rejected as an unknown service.SERVICES_CSV/CLOSURE_PLAN(previously skipped or trimmed) and spaces inholdnow fail closed. The four old tolerance tests were rewritten to assert that.Before/after on the real
bin/railwayPromoteCommand with an intercepted transport (fake GQL/GHCR, no network):CLOSURE_PLAN=2:--yes,--fooand-xbehave the same way: refused, 0 CLI calls, exit 1. A normal plan,CLOSURE_PLAN=0:aimock,2:shellwithDIGEST_SERVICE=shellandHELD_CSV=harness, pins exactlyprod-aimockandprod-shell. The digest goes only to shell.Review fix (a12ca33): empty names in closure plan entries
Before this fix,
CLOSURE_PLAN='0:,2:showcase-ag2'passed the tier check. The empty name vanished when the names were joined, and the leaf promoted with exit 0. Eachtier:nameentry's name is now checked by the guard on its own, before joining. Leading (0:,2:x), repeated (0:x,1:,2:y) and trailing (...,2:) empty names are refused with 0 CLI calls. Before this fix,0:,2:svc-areached the CLI in bats, and0:,2:showcase-ag2did the same against the real CLI.Review fix (10d384d): step summary names the actual mutation plan
The resolver step summary used to say the leaf was "what actually promotes now" and called the tiered closure equivalence-only. In fact the promote job runs promote-fleet from
closure_plan. Forservice=agnowithhold=harness,harness-workersit promotesaimock,pocketbase,dashboardandshowcase-agno. The summary now lists Requested service(s) separately and labels the filtered closure as the Mutation plan (what this run actually promotes in prod). Held services are still listed as Held, unchanged. A bats assertion covers this.Tests and lint
bats resolve-promote-targets.bats promote-fleet.bats: 88/88 ok. The fullshowcase/scripts/__tests__/directory: 212/212 ok. Run locally on macOS bash 3.2. CI runs the same suite on ubuntu bash 5 (showcase_validate.yml).shellcheck0.11.0: clean on both scripts.oxfmt --checkon the workflow: clean.vitest registry-validation-workflows.test.ts sync-promote-service-options.test.ts: 29/29.sync-promote-service-options.tsregenerates with no diff.actionlint: one finding, the self-repositoryuses: $/...call. This is already onmainand documented in the workflow (Support "$/" inuses:(reusable workflow and action at the running workflow's own repository and commit) rhysd/actionlint#760). Nothing new.Risks
hold=aimockwhile promoting an integration that uses aimock. That is the operator's decision, and the step summary shows it.promote-fleet.shcallers. A caller that setsDIGESTon a multi-service plan withoutDIGEST_SERVICEis now refused instead of pinning every service to one image. The workflow always setsDIGEST_SERVICE.workflow_dispatchwithhold=harness,harness-workers.