Repository navigation
Migration/step 08 - #13
Merged
Merged
Conversation
Merge the pre-commit configs of api, federation-api, bagel-cli and the docs into one root .pre-commit-config.yaml, scoped per folder and using each tool's own config files; replace the frontends' husky hooks with local hooks that run their lint-staged configs; run the hooks in CI, with the docs link check as a non-blocking job; update the READMEs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tend hooks Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…end dependencies Replace the frontends' husky post-merge hooks with pre-commit post-merge hooks, installed by default, that compare ORIG_HEAD with HEAD for package.json and package-lock.json. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Title:
chore(migration): step 08 root pre-commit hooksBranch:
migration/step-08Can be squash-merged or merged; it imports no history.
Summary
.pre-commit-config.yaml: merges the configs of api, federation-api, bagel-cli and the docs, keeping every hook's upstreamrevand arguments.files: ^tools/<tool>/or^docs/and has an alias<hook>-<folder>forSKIP=.--config=tools/<tool>/pyproject.toml--config=tools/{api,bagel-cli}/.flake8(federation-api keeps its inline args)--settings-path=tools/<tool>/pyproject.toml--config=tools/api/.codespellrc/--config=docs/.codespellrc--config-file=tools/<tool>/pyproject.toml-c docs/.markdownlint.jsonc--config=docs/md_link_check_config.jsonlint-staged-query-toolandlint-staged-annotation-toolrunnpx --no-install lint-stagedin the tool folder, so the unchangedlint-staged.config.jsfiles run typecheck, eslint and prettier on staged files. They fail with "Run npm ci in tools/ first" ifnode_modulesis missing.post-mergehooks become pre-commitpost-mergehooks, installed by a plainpre-commit install(default_install_hook_types: [pre-commit, post-merge]). After a merge or pull, they runnpm ciin a frontend whosepackage.jsonorpackage-lock.jsonchanged betweenORIG_HEADandHEAD.default_stages: [pre-commit]keeps every other hook off that stage."prepare": "husky"/"husky install"from bothpackage.jsonfiles.husky/folders.pre-commit-config.yamlfilespre-commitjob: all hooks on all files, skippingmarkdown-link-check-docsand the two lint-staged hooks.markdown-link-checkjob.ci.ymldescription.uv run pre-commit install.npm ciprerequisite.Checks run
SKIP=markdown-link-check-docs pre-commit run --all-files;git status --porcelainafterwardsSKIPand--show-diff-on-failure(replay of the CI step)pre-commit run markdown-link-check-docs --all-files(CI's non-blocking job)npx markdownlint-cli@0.47.0 -c docs/.markdownlint.jsonc docs/README.mdand the hook both pass; with an added 110-character line both still pass, while markdownlint's defaults would report 16 × MD013import osintools/api/app/main.pytools/api/app/main.py:1:1: F401 'os' imported but unused(discarded)debugger;intools/query-tool/src/App.tsx, stagederror Unexpected 'debugger' statement no-debugger(discarded)npm ciin both frontendspre-commit installpre-commitandpost-merge; merging a README-only branch runs nonpm ci; merging a branch that changestools/query-tool/package.jsonrunsnpm ciin query-tool only; fast-forwarding two commits where only the first changestools/annotation-tool/package.jsonrunsnpm ciin annotation-tool (upstream'sHEAD^comparison would miss it)scripts/check-unchanged.shOKjust lintDocumentation check: in a fresh clone of this branch, run verbatim:
uv run pre-commit installfromtools/api,tools/federation-apiandtools/bagel-cliinstalls the repository hook using the root.pre-commit-config.yaml.pip install pre-commit && pre-commit installfrom the root works.npm ciin both frontends and thenSKIP=markdown-link-check-docs pre-commit run --all-files, exits 0 with no rewrites.npm ci, the frontend hooks print "Run npm ci in tools/query-tool first".Deviations and findings
--src=tools/<tool>, which isort resolved relative to the settings file (tools/api/tools/api). It treatedappas third-party and rewrote 37 protected test files; those changes were discarded and never committed. Only--settings-pathis passed now, matching upstream's grouping exactly.files:replaced the hook's built-in compose-file pattern, so it tried to parse every file intools/api. Fixed with a compose-file pattern.HEAD^withHEADforpackage.jsononly. That misses dependency changes in all but the last commit of a pull, and lockfile-only updates. The new hooks compareORIG_HEADwithHEADfor both files.pre-commit.yml. The newpre-commitCI job covers both. Theci:block stays in the config in case pre-commit.ci is installed on the repository.🤖 Generated with Claude Code