Skip to content

Serialise staging with certification; recover shadows without sidecar - #79

Merged
cgnl merged 3 commits into
mainfrom
fix/release-automation-state
Nov 7, 2026
Merged

cgnl merged 3 commits into
mainfrom
fix/release-automation-state

Conversation

@cgnl

@cgnl cgnl commented Nov 7, 2026

Copy link
Copy Markdown
Owner

These are the release-automation and migration hazards from the state-machine review, kept separate from #78 because these files are in the pinned release trust surface.

Hazard Fix
Staging (compatibility-release-staging) and certification (compatibility-release-certification) used different concurrency groups. A new staging run closed the PR of a candidate that was still being certified and deleted its branch. That happened with 1.3.26 (#71) and wasted a full 7-hour certification. stage-compatibility-release.yml shares the certification group, so a staging run waits until a running certification has finished. A newer pending run replaces an older pending one, so the newest candidate wins.
build_shadow_database moves the database first and the sidecar second. If interrupted in between, it left a shadow without a sidecar, which every later start refused as an "Unmarked" library. is_shadow_database accepts a database with exactly one plex_pg_shadow_marker row when the sidecar is missing; only this function creates that table. A sidecar that is present must still match, and a real library is never a shadow.

Tests

  • New scripts/tests/test_shadow_marker.py covers: marker and matching sidecar, mismatching sidecar, marker without sidecar, a real library with and without a sidecar, and a missing file. All 120 script tests pass.
  • actionlint reports no issues on the changed workflow.

Trust

Both files are pinned in RELEASE_TRUST_JSON, as are all files under scripts/, including the new test. The next certified release therefore needs a trust re-bootstrap from a successful certification run, as was done for 1.3.26.

🤖 Generated with Claude Code

Sander and others added 2 commits November 7, 2026 10:57
…shadows

- stage-compatibility-release shares the certification concurrency group.
  Staging closes older staging PRs and deletes their branches; with a
  separate group it did that to a candidate that was still being
  certified (1.3.26: #71), wasting a full certification.
- is_shadow_database accepts a database carrying exactly one shadow
  marker when the sidecar is missing. build_shadow_database moves the
  database before the sidecar, so an interrupted install left a shadow
  that every later start refused. A sidecar that is present must still
  match.

Both files are in the pinned release trust surface; the next certified
release needs a trust re-bootstrap.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex review of the previous commit:
- Sharing the certification concurrency group let a later run replace
  the pending certification that staging had just dispatched. Keep the
  groups separate; staging instead skips closing older staging PRs while
  a certification is running or queued.
- Accepting a marker-only database as a shadow could let a restored or
  reused real library be treated as disposable. Keep the strict sidecar
  check and explain the likely interrupted installation in the refusal.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@cgnl

cgnl commented Nov 7, 2026

Copy link
Copy Markdown
Owner Author

Reworked after independent review (Codex):

  • Concurrency groups stay separate. A shared group would let a later run replace the certification that staging had just dispatched. Instead, staging leaves older staging PRs open while any certification is running or queued; a later staging run closes them. Publication uses the certificate and commit SHA, so a closed PR does not block publishing a certified candidate.
  • Shadow database without sidecar is still refused. It may since have been used as a real library, so it is not accepted. The refusal now explains that it is probably an interrupted shadow installation and how to recover (shadow_recovery_hint, covered by scripts/tests/test_shadow_marker.py).

@cgnl
cgnl merged commit c262981 into main Nov 7, 2026
17 checks passed
@cgnl
cgnl deleted the fix/release-automation-state branch November 7, 2026 10:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant