Skip to content

feat(.github/workflows/deploy-docs.yaml): trigger reindex on release.published (DOCS-327)#26070

Open
nickvigilante wants to merge 1 commit into
mainfrom
vigilante/docs-327-trigger-docs-reindex-on-codercoder-releasepublished
Open

feat(.github/workflows/deploy-docs.yaml): trigger reindex on release.published (DOCS-327)#26070
nickvigilante wants to merge 1 commit into
mainfrom
vigilante/docs-327-trigger-docs-reindex-on-codercoder-releasepublished

Conversation

@nickvigilante
Copy link
Copy Markdown
Contributor

Closes DOCS-327.

What

Add release: { types: [published] } to .github/workflows/deploy-docs.yaml so that publishing a stable vX.Y.Z GitHub Release on this repo auto-dispatches the docs-sync handler against the corresponding release/X.Y branch. The existing push and workflow_dispatch triggers are unchanged.

The Compute action and ref step gains a release-event branch that:

  • Skips prereleases (github.event.release.prerelease == true) with a workflow notice.
  • Matches the tag against ^v([0-9]+)\.([0-9]+)\.[0-9]+$ and translates v2.35.0 to release/2.35.
  • Falls through with a notice and exit 0 for any tag that doesn't match the plain semver shape (v2.35, v2.35.0-rc.1, etc.).

Downstream validation, HMAC body construction, and the POST step are unchanged.

Why

Today, every mainline rollover requires a human to dispatch this workflow manually with action=index, ref=release/X.Y. We just hit this rotation friction on DOCS-324 (v2.34 launch) and the resulting empty-search-results incident on /docs/@v2.34.x/.... release.published is the right cue: it fires exactly when a version becomes user-visible, not when its release branch is cut weeks earlier with possibly-incomplete docs.

Coupling (important)

This change is intentionally inert until coder.com's INDEXED_REFS_BY_CORPUS allowlist becomes self-rotating (filed under DOCS-210). Until that lands, the handler still rejects new minors with {action: "skipped", reason: "...not in INDEXED_REFS_BY_CORPUS"} and this workflow logs the skip. Pre-wiring lets both halves land roughly in parallel so the next release cut after both ship is automatic.

Reviewers: feel free to merge this independently. There is no downside to the wiring being live before the allowlist half ships; worst case, every release-publish event creates a no-op workflow run.

Behavior trace (the cases the bash handles)

11 event scenarios I walked through by hand
Event Tag prerelease Result
push to main n/a n/a index, ref=main (existing)
push to release/2.34 n/a n/a index, ref=release/2.34 (existing)
workflow_dispatch index release/2.34 n/a n/a index, ref=release/2.34 (existing)
workflow_dispatch delete release/2.31 n/a n/a delete, ref=release/2.31 (existing)
release.published v2.35.0 false index, ref=release/2.35 (new)
release.published v2.35.0-rc.1 true notice + exit 0 (new)
release.published v2.35.0-rc.1 false notice + exit 0, regex miss (new)
release.published v2.35 false notice + exit 0, regex miss (new)
release.published release-2.35 false notice + exit 0, regex miss (new)
release.published v0.0.0 false index, ref=release/0.0 then handler rejects via allowlist (defense in depth)
release.published `` (empty) unset notice with <unknown> + exit 0

Safety

  • The handler's allowlist gate still applies; this PR can only cause {action: "skipped"} responses until DOCS-210's allowlist-derivation lands. No risk of indexing an unintended ref.
  • The workflow's existing input validation (case "$REF" in main|release/*)) rejects any translation output that isn't release/<int>.<int>. Defense in depth in case the regex ever loosens by accident.
  • DOCS-121 self-trigger risk is not present here: the new trigger is release.published, not push-on-paths. Workflow file edits cannot induce a release event.
  • concurrency: { group: deploy-docs-${{ github.ref }} } already exists. Release events have github.ref=refs/tags/vX.Y.Z, distinct from push events on the same release branch. A theoretical race resolves through the handler's atomic deleteBy+saveObjects.

Verification

  • actionlint .github/workflows/deploy-docs.yaml clean.
  • make pre-commit-light clean: fmt/shfmt, fmt/markdown, lint/actions/actionlint, lint/shellcheck, lint/markdown, lint/emdash, lint/typos, etc.
  • Bash logic hand-traced through 11 event scenarios (table above).

Out of scope

  • Build-time allowlist derivation in coder.com (DOCS-210a, will be filed/PR'd as a sibling change).
  • Webhook-driven cleanup of aged-out refs (DOCS-210 parent).
  • code-server release lifecycle (different repo, code-server's docs corpus stays at main).

Coder Agents on behalf of @nickvigilante.

…published (DOCS-327)

When a stable vX.Y.Z release is published on coder/coder, the docs
reindex workflow now fires automatically against the corresponding
release/X.Y branch. Eliminates the manual workflow_dispatch step from
the mainline rotation runbook.

Behavior:

* release.types: [published] is added alongside the existing push and
  workflow_dispatch triggers.
* The 'Compute action and ref' step gains a release-event branch that:
  - Skips prereleases (github.event.release.prerelease == true) with a
    workflow notice and a clean exit 0, so backport release candidates
    do not trigger an index.
  - Matches the tag against ^v([0-9]+)\\.([0-9]+)\\.[0-9]+$ and
    translates v2.35.0 to release/2.35 (etc).
  - Falls through with a notice and exit 0 for any tag that does not
    match the plain semver shape (e.g. v2.35, v2.35.0-rc.1).
* The downstream validation, HMAC body construction, and POST step are
  unchanged.

This change is intentionally inert until coder.com's INDEXED_REFS_BY_CORPUS
allowlist becomes self-rotating (filed under DOCS-210). Until then, the
handler still rejects new minors with {action: "skipped", reason:
"...not in INDEXED_REFS_BY_CORPUS"}, and this workflow logs the skip.
Pre-wiring lets both halves land roughly in parallel so the next
release cut after both ship is automatic.
@linear-code
Copy link
Copy Markdown

linear-code Bot commented Jun 4, 2026

DOCS-327

Copy link
Copy Markdown
Contributor Author

/coder-agents-review

@coder-agents-review
Copy link
Copy Markdown
Contributor

coder-agents-review Bot commented Jun 4, 2026

Chat: Review in progress | View chat
Requested: 2026-06-04 17:58 UTC by @nickvigilante

deep-review v0.7.1 | Round 1 | 6bd4131..8b7eac7

Last posted: Round 1, 1 findings (1 P2), COMMENT. Review

Finding inventory

Findings

# Sev Status Location Summary Round Reviewer Posted
CRF-1 P2 Open deploy-docs.yaml:286 Early exit 0 in release path does not prevent POST step from running with empty action/ref R1 Netero Yes

Round log

Round 1

Netero-only. 1 P2. Reviewed against 6bd4131..8b7eac7.

About deep-review

CRF = Coder Review Finding (P0-P4, Nit, Note)

Reviewer Focus
Bisky tests
Chopper ops/errors
Churn-guard change verification
Ging language modernization
Gon naming
Hisoka edge cases
Killua perf
Kite change integrity
Knov contracts
Knuckle SQL
Kurapika security
Law decomposition
Leorio docs
Luffy product
Mafu-san process
Mafuuu contracts
Melody dispatch/pairing
Meruem structural
Nami frontend
Netero mechanical checks
Pariston premise testing
Pen-botter product gaps
Razor verification
Robin duplication
Ryosuke Go arch
Takumi concurrency
Zoro shape

🤖 Managed by Coder Agents.

Copy link
Copy Markdown
Contributor

@coder-agents-review coder-agents-review Bot left a comment

Choose a reason for hiding this comment

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

First-pass review (Netero). This is a mechanical scan only; the full review panel has not yet reviewed this PR. The panel will review after this finding is addressed.

The wiring for the new release.published trigger is well-structured: the tag-to-branch translation is clear, the prerelease and non-semver gates are defensive, and the comment updates accurately describe the new three-source trigger model. The 11-scenario hand-trace in the description is thorough.

One P2 found.

"Base code had no early-exit paths; ACTION and REF were always populated before reaching $GITHUB_OUTPUT. The two exit 0 calls are new in this PR." -- Netero

🤖 This review was automatically generated with Coder Agents.

if [ "${EVENT_NAME:-}" = "release" ]; then
if [ "${RELEASE_PRERELEASE:-false}" = "true" ]; then
echo "::notice::Skipping prerelease ${RELEASE_TAG:-<unknown>}; no docs reindex."
exit 0
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.

P2 [CRF-1] Early exit 0 on prerelease skip (line 286) and regex miss (line 294) succeed the "Compute action and ref" step without writing action or ref to $GITHUB_OUTPUT. The downstream "POST to coder.com docs indexer" step (line 350) has no if: guard on steps.input.outputs.action, so it runs unconditionally with empty ACTION and REF env vars, sending {"action":"","corpus":"v2","ref":"","paths":[]} to the production handler.

The handler's allowlist likely rejects the empty ref, so this is not data-corrupting. But every prerelease publish and every non-semver tag release would send unintended traffic to production and produce a confusing error in the step summary.

Before this PR, no early-exit paths existed; ACTION and REF were always populated before reaching $GITHUB_OUTPUT.

Fix: add if: steps.input.outputs.action != '' to the POST step (line 350). This is a clean sentinel because the step only writes action on the success path. (Netero)

🤖

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