Skip to content

ci: deploy docs site on release publish instead of every unstable push - #1210

Merged
mergify[bot] merged 2 commits into
sigp:unstablefrom
shane-moore:docs-deploy-on-release-publish
Aug 5, 2026
Merged

ci: deploy docs site on release publish instead of every unstable push#1210
mergify[bot] merged 2 commits into
sigp:unstablefrom
shane-moore:docs-deploy-on-release-publish

Conversation

@shane-moore

Copy link
Copy Markdown
Member

Problem, Evidence, and Context (Required)

  • The docs workflow deploys anchor.sigmaprime.io on every push to unstable, so docs for unreleased CLI flags go live weeks before a binary exists, and during each release window the site advertises versioned download URLs that 404 (the version bump merges to unstable before the release is published).
  • Operators are currently seeing docs for flags their binary rejects.
  • Separately, the Linux install example uses an arch-less tarball name that no release asset matches, and the version-sync regex mangles arch-qualified names at build time.
  • Closes ci(docs): deploy docs site on release publish instead of every unstable push #1209 (alternatives considered and rollout details are recorded there).

Change Overview (Required)

  • docs.yml now triggers on release: published (prerelease-guarded) plus a bare workflow_dispatch for manual redeploys; deploys serialize under a constant concurrency group with cancel-in-progress: false so an in-flight s3 sync --delete is never killed halfway.
  • sync-version.js filename regexes drop the greedy optional suffix group that swallowed the architecture component; the installation example is now arch-qualified; the docs README documents the new publication timing.
  • Reading order: docs.yml (the behavior change), then sync-version.js + installation.mdx (content fix), then README.md.
  • Intentionally unchanged: the build itself, linkcheck and CLI-reference checks on PRs/unstable, and the S3 sync mechanics.

Risks, Trade-offs, and Mitigations (Required)

  • The new trigger and the manual-dispatch button only take effect once this file reaches stable (default branch) at the next release; until then the live site freezes at its current content (status quo, self-corrects at next release publish).
  • Merging this stops unstable-push deploys immediately (push events read the workflow file at the pushed commit; no final unstable deploy fires).
  • Docs-only fixes between releases no longer publish automatically; path is cherry-pick to stable and gh workflow run docs.yml --ref stable.
  • Publishing a stale draft release would redeploy that tag's docs; accepted as low-likelihood and recoverable via a manual redeploy from stable.

Validation (Required)

  • actionlint clean on the modified workflow; node --check clean on sync-version.js.
  • Regex fix verified with a standalone node repro: arch-qualified names now survive version rewriting (previously anchor-v1.1.0-x86_64-... became anchor-vX.Y.Z-...).
  • End-to-end trigger behavior is only observable at the next release publish; first post-release deploy should be checked against the live site.

Rollback (Required for behavior or runtime changes; optional otherwise)

  • Revert the commit; the previous push-to-unstable deploy behavior returns on the next unstable push. No data or config impact; the S3 bucket is fully rewritten by any subsequent deploy.

Docs merged to unstable went live at anchor.sigmaprime.io before any
released binary had the documented flags, and each release window
advertised download URLs that 404 until the release was published.
Deploy on release publish instead, serialize deploys under a constant
concurrency group, and fix the arch-less Linux download example that the
version-sync regex was mangling.

Closes sigp#1209
@shane-moore

Copy link
Copy Markdown
Member Author

@claude, please take a look

@claude-code-actions-sigp

claude-code-actions-sigp Bot commented Aug 4, 2026

Copy link
Copy Markdown

Claude finished @shane-moore's task in 1m 28s —— View job


PR Review: Deploy docs on release publish

  • Read changed files (docs.yml, sync-version.js, installation.mdx, README.md)
  • Analyze workflow trigger + concurrency changes
  • Analyze regex fix in sync-version.js
  • Verify installation example correctness
  • Post review

Reviewed against origin/unstable. This is a tidy, well-motivated change and the PR description does an excellent job laying out the reasoning and rollout caveats. No blocking issues found.

Workflow (docs.yml) — correct

  • Trigger swap (push: unstablerelease: published + workflow_dispatch) directly addresses the "docs live before the binary exists / 404 download URLs" problem. Good.
  • Concurrency — constant group docs-deploy + cancel-in-progress: false is the right call given s3-sync-action runs with --delete. Serializing and never cancelling mid-sync prevents a half-deleted bucket. 👍
  • Prerelease guard!github.event.release.prerelease is correct for both event types:
    • On a prerelease publish, release.prerelease is true → job skipped.
    • On workflow_dispatch, github.event.release is null; dereferencing a property of null yields null and !nulltrue, so manual redeploys still run. Verified against GHA expression semantics — no accidental skip of the dispatch path.

sync-version.js regex fix — correct

The root cause is accurate: the old (?:-[\w.]+)? group was greedy and [\w.] matches the 86_64 in x86_64, so anchor-v1.1.0-x86_64- collapsed to anchor-vX.Y.Z-, stripping the arch. Dropping the optional group from the filename patterns fixes it while correctly keeping it on the tag/path portion (/download/v[\d.]+(?:-[\w.]+)?/), which legitimately needs to match prerelease tags like v1.1.0-rc.1.

I also confirmed the general-format lines (anchor-<version>-<platform>) are untouched by both regexes, since the literal <version> doesn't match v[\d.]+. Only the concrete example line is rewritten. Good.

installation.mdx / README.md — correct

  • Arch-qualified filename (anchor-v1.1.0-x86_64-unknown-linux-gnu.tar.gz) now matches an actual release asset.
  • The new "Deployment" section documenting release-triggered publishing and the gh workflow run docs.yml --ref stable escape hatch is a nice touch for future maintainers.

Minor, non-blocking observations

  • Regex + prerelease version interaction (FYI only, not actionable): the new filename patterns assume the example version has no prerelease suffix (e.g. they'd leave a stale suffix if the example were ever anchor-v1.1.0-rc.1-x86_64-...). Since the deploy now only fires on non-prerelease publishes (!prerelease) and the docs example is always a stable release, this is consistent and fine in practice — noting it only so the coupling is on record.
  • workflow_dispatch has no branch restriction: as the PR body notes, a manual dispatch from unstable would publish unstable docs. The README correctly directs operators to use --ref stable; the repository_owner == 'sigp' guard covers forks. Acceptable as documented.

Nothing to change from my side — LGTM.
docs-deploy-on-release-publish

@codecov-commenter

codecov-commenter commented Aug 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 62.98%. Comparing base (1322601) to head (b2e6b9b).

Additional details and impacted files
@@            Coverage Diff            @@
##           unstable    #1210   +/-   ##
=========================================
  Coverage     62.98%   62.98%           
=========================================
  Files           162      162           
  Lines         27235    27235           
=========================================
  Hits          17154    17154           
  Misses        10081    10081           
Flag Coverage Δ
rust 62.98% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

cache: 'npm'
cache-dependency-path: docs/package-lock.json

- name: Install dependencies

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

low priority but I noticed no timeout on this job. Timeout is dangerous potentially with aws s3 sync --delete as we'd rather not corrupt the bucket in the case where the job gets axed as that is running. we could though add timeout-minutes: 10 or similar to steps that have external fetches like Install dependencies and Install Playwright browsers independently to stop hangs blocking our other deploys.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call. Added timeout-minutes: 10 to the three network-bound steps (npm ci, Playwright install, and the GitHub stats fetch in sync-version) in b2e6b9b. Left the job-level timeout off for the reason you gave: it could cancel the S3 sync mid-run. A hang now fails before the sync starts instead of holding the concurrency group for the 6h default.

jnhsigmap
jnhsigmap previously approved these changes Aug 5, 2026

@jnhsigmap jnhsigmap left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all good otherwise

@mergify

mergify Bot commented Aug 5, 2026

Copy link
Copy Markdown

Queued — the merge queue status continues in this comment ↓.

Cap npm ci, Playwright install, and the GitHub stats fetch at 10 minutes
so a hang fails the job before the S3 sync instead of holding the
docs-deploy concurrency group for the 6h default. No job-level timeout
on purpose: it could cancel the sync mid-run.
@mergify

mergify Bot commented Aug 5, 2026

Copy link
Copy Markdown

Merge Queue Status

This pull request spent 48 minutes 25 seconds in the queue, including 28 minutes 2 seconds running CI.

Required conditions to merge

@mergify
mergify Bot merged commit fd3c7f9 into sigp:unstable Aug 5, 2026
25 checks passed
@mergify mergify Bot removed the queued label Aug 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants