Skip to content

fix(ci): Lint docs and developer docs in separate jobs - #19830

Open
sentry-junior[bot] wants to merge 3 commits into
masterfrom
fix/lint-404s-build-sites-separately
Open

sentry-junior[bot] wants to merge 3 commits into
masterfrom
fix/lint-404s-build-sites-separately

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

DESCRIBE YOUR PR

pnpm build and pnpm build:developer-docs both write to .next. When a PR touches both docs/** and develop-docs/**, the 404 workflow runs both builds in one job and then starts one server. By then the developer docs build has overwritten the docs build, so only developer docs get checked for broken links.

This change gives each changed site its own job and runner:

  • A changes job decides which sites changed.
  • One Lint <site> for 404s job runs per changed site, in parallel. Each job builds, starts the server, and runs the linter. The runner is thrown away when the job ends, so the server doesn't need to be stopped and nothing else shares port 3000.
  • A small lint-404 job keeps the required check name. It passes when every changed site passes its lint, or when no site changed.

Changes to this workflow or scripts/lint-404s/** now lint both sites, so edits to the workflow check themselves.

An earlier version of this PR handled the shared build with a bash script that started and stopped the server between sites. Separate jobs remove the need for it. PRs that touch both sites also run the two builds in parallel instead of one after the other.

Replaces #19465. That PR's other changes already landed in #19509 (AI Agents doc) and #19526 (cross-site link handling).

IS YOUR CHANGE URGENT?

  • Urgent deadline (GA date, etc.): YYYY-MM-DD
  • Other deadline: YYYY-MM-DD
  • No deadline: Not urgent, can wait up to 1 week+

PRE-MERGE CHECKLIST

  • Checked Vercel preview for correctness, including links
  • PR was reviewed and approved by any necessary SMEs (subject matter experts)
  • PR was reviewed and approved by a member of the Sentry docs team

via shannon.anahata.

--

View Junior Session [Sentry]

Both builds write to .next, so when a PR touched docs and develop-docs the developer docs build overwrote the docs build and only developer docs were checked for 404s. Build, serve, and lint each site in turn, and stop the server between runs.

Co-Authored-By: Shannon Anahata <shannon.anahata@sentry.io>
@vercel

vercel Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
develop-docs Ready Ready Preview Oct 7, 2026 7:43pm UTC
sentry-docs Ready Ready Preview Oct 7, 2026 7:43pm UTC

Request Review

@github-actions github-actions Bot added the Priority: Normal Docs review has no urgent deadline label Oct 6, 2026
@sfanahata sfanahata self-assigned this Oct 6, 2026
@sfanahata
sfanahata marked this pull request as ready for review October 6, 2026 22:21
@cursor

cursor Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

This change only alters a 404 lint job. It does not change live pages. The plan has no production signal. An issue escalates if the 404 lint job fails or skips one site.

Not monitored: no services

Mention @change-monitor in a comment to update the plan.

Plan

What changed

The 404 lint job now builds, serves, and lints each site in turn. It no longer lets the second build overwrite the first .next output. No production service must deploy for this change to go live. The new steps run when GitHub runs the 404 lint job.

Risk

If the new script fails, pull requests that touch either site can fail CI. A leftover process can occupy port 3000 and block the second lint. A wait loop can hide a crash until the sitemap probe fails. Wrong process-group cleanup can fail a job that already passed the lint.

Intended effect

The intended effect is a 404 lint of each site after its own build. Production telemetry cannot show that CI behavior. Absent looks like the job still linting only one site. There is no connected GitHub Actions signal.

Regression watch

This diff can break the 404 lint job. It cannot break live pages. A regression is a failed job, a timeout, or a port-in-use error. This session cannot measure those GitHub Actions symptoms. Production error rate and live 404s are not on this path.

Not observable

GitHub Actions results for the 404 lint job, including pass, fail, skip, and duration. This session has no GitHub Actions connector. Production page errors and web vitals are not effects of this diff.

@sfanahata
sfanahata requested a review from vgrozdanic October 6, 2026 22:23
@sfanahata

Copy link
Copy Markdown
Contributor

@vgrozdanic - I closed the last PR about this as it was really dated and tried again. Can you take another look and let me know if this seems like the right solution now?

@cursor cursor Bot 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.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit a804c06. Configure here.

Comment thread scripts/lint-404s/serve-and-lint.sh Outdated
next start can outlive the pnpm wrapper while it closes its socket, so a passing scan could still fail cleanup. Poll for the process group to exit and the port to free, then force-kill if it hasn't after 10 seconds.

@vgrozdanic vgrozdanic left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I tried something similar because the lint took super long, but i am not the biggest fan of scripts/lint-404s/serve-and-lint.sh, it feel really hacky 😅

But worth a try if it speeds up the lints

Replace the serve-and-lint script with one job per changed site, so each build gets its own runner, .next directory, and port. A lint-404 summary job keeps the required check name. Changes to this workflow now lint both sites.

Co-Authored-By: Shannon Anahata <shannon.anahata@sentry.io>
@sentry-junior sentry-junior Bot changed the title fix(ci): Lint docs and developer docs builds separately fix(ci): Lint docs and developer docs in separate jobs Oct 7, 2026
@sfanahata

Copy link
Copy Markdown
Contributor

@vgrozdanic - I asked for it to be updated. Here's how it works now

changes job: works out which sites the PR touched.
One lint job per changed site: "Lint docs for 404s" and "Lint developer-docs for 404s". Each runs on its own machine: build, start the server, check links. There's no shared .next folder or port 3000, and no shutdown code, because GitHub throws the machine away when the job ends. When both sites change, the two jobs run at the same time.
lint-404 summary job: keeps the name of the required check on master. It passes only if every site that changed passed, or if nothing changed. It fails if any site's job fails or gets cancelled.

Each site keeps its own Next.js build cache.

This version saves about 4 minutes on build time, however, when running through the check, it was discovered that only 12 pages are currently reviewed on develop-docs because the logic says to follow the sitemap, which explicitly narrows down the pages for indexing/SEO purposes. I'll open a separate PR to change that, and hope that it doesn't blow the build time again.

This branch was successfully deployed

2 active deployments
Preview – sentry-docs — 3adc447f Deployed Oct 7, 2026 by vercel[bot]
Preview – develop-docs — 3adc447f Deployed Oct 7, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Priority: Normal Docs review has no urgent deadline

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants