Skip to content

ci(docs): check production and preview builds on pull requests - #777

Open
myasnikovdaniil wants to merge 1 commit into
fix/docs-entry-linksfrom
ci/docs-build-checks
Open

myasnikovdaniil wants to merge 1 commit into
fix/docs-entry-linksfrom
ci/docs-build-checks

Conversation

@myasnikovdaniil

Copy link
Copy Markdown
Contributor

PRs currently never run the Pages build, and production skips docs/next/. I added production and preview checks to the existing workflow, including legacy URLs and version rollover.

PR jobs use read-only permissions, publication stays on main after both builds pass.

Verified locally with Hugo extended 0.164.0, 26 fixtures, five output checks per environment, 129 translator tests and actionlint. Broken references in next/ fail preview, and failed npm installs now stop the build.

Stacked on #776, addresses #496 and #653 as part of #773.

@coderabbitai

coderabbitai Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 31acff8f-27b5-4a97-a402-10a9b7ca06a5

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

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.

myasnikovdaniil The workflow looks right to me, one commit needs squashing before merge.

I ran the production and preview steps from this PR on a trial merge with main, with Hugo 0.164.0. Both builds and all five output checks pass. The fixture suite passes in about 7 seconds, so the extra CI cost is small. A broken ref added under next/ fails the preview build with REF_NOT_FOUND. PR runs get a read-only token and no secrets, and the deploy job runs only from main after both matrix jobs pass.

The blocking part is 1306bf8. It fixes a bug that f990c4f introduced in this same PR. The repo merges with merge commits, so main would keep a fix for a problem it never had. Please squash it into f990c4f.

I also broke the real production output in a few ways to see what the checker catches. It fails on a deleted unversioned legacy copy, a wrong canonical on one, a meta refresh in a copy, and next/ in production. It still passes when I delete /docs/v1/install/talos/kexec/index.html, when I point the canonical of /docs/v1/reference/applications/mysql/ somewhere else, and when I delete the whole docs/v1.6/ archive. test_legacy_urls reads only the registry keys, and nothing checks that numbered versions are still published. The fixtures from #775 cover the /docs/v1/ forms in code, so I'm not blocking on this. Checking the /docs/<major>/ forms in test_legacy_urls plus a per-version presence check would close the gap.

JFYI: .docs-mirror.json is served on cozystack.io today, because the upload step includes hidden files. Deleting it from public/ before the upload would cover A18 from the epic, if you want it in this PR.

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.

Thanks, the fix is squashed and the tree is identical to what I tested before. One thing for after #776 lands: against current main this conflicts in hugo.yaml and the fixtures file, and main has dropped the Dart Sass step, so it should go in the rebase too.

Build the preview tree on pull requests so broken refs under next/ are
caught before merge, and check the production output that Pages publishes.

Keep build jobs read-only and gate the Pages artifact and deployment to
main. Fail dependency installation instead of continuing after npm errors.

Assisted-By: LLM
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
@myasnikovdaniil

Copy link
Copy Markdown
Contributor Author

Aleksei Sviridkin (@lexfrei) rebased on updated #776 and current main. Only conflict was Hugo install step in hugo.yaml, I kept quoted $RUNNER_TEMP from this PR and dropped Dart Sass install like main did in #798, fixtures merged without conflict. Production and preview builds with five output checks each and 26 fixtures pass locally with hugo 0.164.0. Push dismissed your approval, please take a look again.

This branch has not been deployed

No deployments
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.

2 participants