Skip to content

ci: build, mirror and snippet checks on every PR; docs-impact checklist - #40

Open
filipagr wants to merge 6 commits into
mainfrom
filipa/docs-sync-design
Open

filipagr wants to merge 6 commits into
mainfrom
filipa/docs-sync-design

Conversation

@filipagr

@filipagr filipagr commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Adds CI to this repo, and a docs-impact checklist, with no secrets and no model calls. It now replaces the docs-sync bot section, because that bot (fil-one/fil-one#881) is deferred (see FIL-1579).

Checks (.github/workflows/build.yaml)

Every PR and every push to main runs:

  • npm run build: MDX errors and broken internal links (onBrokenLinks: "throw").
  • node scripts/check-mirrors.mjs: every docs page has a link in static/llms.txt and a Source: section in static/llms-full.txt, and neither mirror links to a page that no longer exists.
  • node scripts/check-snippets.mjs: Python, JS, Go, Bash and JSON snippets parse (py_compile, node --check, gofmt, bash -n), every code block has a language tag, and nothing looks like a real access key. A deliberate fragment can opt out with nocheck in its fence.
  • mirror-impact job: a PR that changes docs/** but neither mirror fails, unless its description ticks No mirror change needed and gives a reason. It reads only the PR body.

The workflow keeps its read-only token, its actions pinned by SHA, and npm ci --ignore-scripts.

Process

  • .github/pull_request_template.md: a verified-facts, restated-facts and warnings checklist, plus the mirror choice.
  • CONTRIBUTING.md: when a product change needs docs, a map from product paths to docs pages, how to test snippets (a local emulator first, then a throwaway scoped key), and what CI can and can't catch.
  • AGENTS.md: the bot section is replaced with "Checks that run on every PR".
  • .github/dependabot.yml: monthly, grouped, with a 7-day cooldown (as bajtos suggested).

Fixes found by the new checks

  • The Introduction page had no entry in either mirror.
  • reference/overview.mdx had one code block with no language tag.

Testing

  • Both scripts pass on this branch. They also fail correctly on planted problems: a snippet that doesn't parse, an AKIA… key, and a page missing from the mirrors.
  • npm run build passes.
  • The mirror-impact logic was checked locally against five cases: no docs change, mirrors changed, a ticked reason, an unticked box, and a ticked box with no reason.
  • The workflow YAML parses. It hasn't run on GitHub yet: this PR is its first run.

Follow-ups

  • Make the build and mirror-impact checks required in the main ruleset.
  • The product-repo half is still to come: a docs section in its PR template and AGENTS.md, plus a secret-free docs-impact check. It's a separate PR in fil-one/fil-one.

🤖 Generated with Claude Code

Adds a no-secrets build check for PRs, which the drafts opened by the
fil-one docs sync workflow rely on, and tells reviewers and agents how
those drafts are handled.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
filone-docs Ready Ready Preview Nov 13, 2026 3:48pm UTC

Request Review

@bajtos bajtos 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.

It's a great idea to add a CI!

A few more suggestions to consider as follow-ups:

  1. Configure Dependabot to automatically update the pinned actions and also npm dependencies. See https://github.com/fil-one/fil-one/blob/main/.github/dependabot.yml for inspiration.
  2. Change the branch protection ruleset to require passing CI checks before a PR can be merged.

filipagr and others added 3 commits November 11, 2026 14:10
Replaces the docs-sync bot section with checks that need no secrets:
- scripts/check-mirrors.mjs: every docs page has an llms.txt link and an
  llms-full.txt section, and the mirrors link no dead pages
- scripts/check-snippets.mjs: Python/JS/Go/Bash/JSON snippets parse, code
  blocks have a language tag, and nothing looks like a real access key
- mirror-impact job: a PR that changes docs/** but neither mirror must
  tick "No mirror change needed" with a reason
- PR template, CONTRIBUTING.md (when docs are required, a product-to-docs
  map, how to test snippets), Dependabot with a 7-day cooldown

Fixes what the new checks found: the Introduction had no entry in either
mirror, and one code block had no language tag.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@filipagr filipagr changed the title ci: build every PR; document docs-sync draft PRs in AGENTS.md ci: build, mirror and snippet checks on every PR; docs-impact checklist Nov 11, 2026
A ticked 'No mirror change needed:' followed only by the template's
<!-- why --> comment passed. Strip HTML comments before matching.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Both mirror conflicts take main's text: main already has the
Introduction entries this branch added, plus newer wording.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@filipagr
filipagr requested a review from bajtos November 13, 2026 15:47
@filipagr

Copy link
Copy Markdown
Contributor Author

@bajtos could you take another look? I merged main into this, and it now has no conflicts.

On your two suggestions:

  1. Dependabot is in the PR. It updates the pinned GitHub Actions and the npm packages monthly, grouped, with a 7-day cooldown, like fil-one's setup.
  2. Requiring CI in the branch rules is a repo setting, so it isn't in this PR. I'll turn it on once this merges and Build and mirror-impact have passed on main.

The Build, mirror and snippet checks pass locally on the merged branch, and this PR is the first time they run on GitHub.

@filipagr
filipagr requested a review from pyropy November 13, 2026 15:47
@filipagr
filipagr marked this pull request as ready for review November 13, 2026 15:48

This branch was successfully deployed

1 active deployment
Preview — 5825be12 Deployed Nov 13, 2026 by vercel[bot]
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