Repository navigation
fix(ci): Lint docs and developer docs in separate jobs - #19830
sentry-junior[bot] wants to merge 3 commits into
Conversation
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>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
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 PlanWhat changedThe 404 lint job now builds, serves, and lints each site in turn. It no longer lets the second build overwrite the first RiskIf 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 effectThe 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 watchThis 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 observableGitHub 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. |
|
@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? |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ 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.
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
left a comment
There was a problem hiding this comment.
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>
|
@vgrozdanic - I asked for it to be updated. Here's how it works now changes job: works out which sites the PR touched. 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. |

DESCRIBE YOUR PR
pnpm buildandpnpm build:developer-docsboth write to.next. When a PR touches bothdocs/**anddevelop-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:
changesjob decides which sites changed.Lint <site> for 404sjob 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.lint-404job 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?
PRE-MERGE CHECKLIST
via shannon.anahata.
--
View Junior Session [Sentry]