Skip to content

ci: preserve hand-maintained CLI command-reference index pages on regen#4836

Open
chaptersix wants to merge 3 commits into
mainfrom
ci/cli-docs-build-validation
Open

ci: preserve hand-maintained CLI command-reference index pages on regen#4836
chaptersix wants to merge 3 commits into
mainfrom
ci/cli-docs-build-validation

Conversation

@chaptersix

@chaptersix chaptersix commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Summary

The gen-docs change in temporalio/cli#1112 stops emitting the CLI command-reference index landing pages (command-reference/index.mdx and cloud/index.mdx), because those are hand-maintained on the docs site (custom ordering, the ReleaseNoteHeader component). This workflow does rm -rf docs/cli/command-reference before regenerating, so without a change here those curated pages would be deleted — breaking the sidebars.js references (and the build).

This restores those two files from HEAD after regeneration. (The cp -r that preserves the cloud/ subdirectory is already in place.)

What changed since first review

This PR originally also added a yarn build validation step here plus a standalone validate-cli-docs-build.yml workflow. Per review (thanks @lennessyy) those were dropped:

  • The Vercel preview build is the required check on every PR and already compiles the generated MDX (failing on broken links/anchors), so a second build was redundant.
  • Worse, the build ran before the PR was opened — on failure, no PR would be created and the error would only surface in Actions run history that nobody watches.

So the PR is now just the index-preservation fix.

Companion PR

temporalio/cli#1112 — the gen-docs change this pairs with. They should land together (this workflow relies on that PR's -subdir flag, and the index restore pairs with it no longer emitting those pages).

The CLI command reference is auto-generated MDX. MDX is stricter than
plain Markdown: bare angle-bracket placeholders, JSON-in-braces, and
broken anchors can compile locally yet fail the site build. Nothing
verified the generated output before it landed, so breakage only surfaced
downstream.

Add a real Docusaurus build as the ground-truth check:

- The "CLI Docs Update" workflow now builds the site after regenerating
  the command reference and before opening its PR, so broken generated
  docs never become a PR. Because the site sets onBrokenLinks and
  onBrokenAnchors to 'throw', this also catches broken anchors and links.
- A new "Validate CLI Docs Build" workflow runs the same build on any PR
  that touches docs/cli/**, gating hand edits and the auto-generated PR.

Also preserve the hand-maintained command-reference index.mdx landing
pages (custom ordering, ReleaseNoteHeader component) across regeneration:
gen-docs no longer emits them, so restore them after the rm -rf that
refreshes the generated command pages.
@chaptersix chaptersix requested a review from a team as a code owner July 7, 2026 15:42
@vercel

vercel Bot commented Jul 7, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
temporal-documentation Ready Ready Preview, Comment Jul 7, 2026 5:27pm

Request Review

@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

📖 Docs PR preview links

This PR does not change any pages in /docs. If you make updates, links to the modified pages will appear here.

@chaptersix chaptersix marked this pull request as draft July 7, 2026 15:43
Comment thread .github/workflows/update-cli-docs.yml Outdated
@chaptersix chaptersix marked this pull request as ready for review July 7, 2026 17:12
The Vercel preview build is the required check on every PR, so it already
compiles the generated CLI MDX (and fails on broken links/anchors) once a
PR is opened. The extra `yarn build` step in this workflow was therefore
redundant, and worse, it ran before the PR was created: if it failed, no
PR would open and the failure would only surface in Actions run history
that nobody watches.

Remove that pre-PR build (and its Node setup / install steps) and the
standalone validate-cli-docs-build.yml workflow. Keep the copy + index
restore, which is the part that's actually needed alongside the gen-docs
change that stops emitting the hand-maintained index pages.
@chaptersix chaptersix changed the title ci: validate generated CLI docs with a Docusaurus build ci: preserve hand-maintained CLI command-reference index pages on regen Jul 7, 2026
# subdirectory produced by -subdir.
rm -rf docs/cli/command-reference
mkdir -p docs/cli/command-reference
cp -r ../cli/dist/docs/* docs/cli/command-reference/

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggestion: consider using -R instead of -r

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.

3 participants