Repository navigation
Add pnpm check:contribution, the light check before a pull request, and a dev container - #1204
Merged
Merged
Conversation
…nd a dev container
…packages from source for the changed tests, and pin the devcontainer
…liasing @mnema packages to source
… skip the repeated dependents step, and say what MNEMA_BASE got wrong
…bout vitest's rerun triggers
Member
Author
|
Review: approved at 2606abc. Three rounds of independent review, each with the defect put back to see the test fail:
Known limits, stated in CONTRIBUTING.md: this is a subset; a change only to a vitest config file runs no test locally, and fixtures read from disk are not followed. CI runs the whole suite and is the check that counts. |
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.
What changes and why
Contributors working in small sandboxes hit 5 s timeouts running the whole suite.
pnpm check:contributionis a lighter check to run before a pull request. It runs, in order: lint, build, typecheck, the guards (vitestwith the guards configuration), and only the tests tied to the files changed against the merge base with the project's main. Guards and changed tests run with one worker and a 30 s test timeout, set by this command only and by no workflow. It ends by saying what it ran and that CI runs the whole suite.upstream/main, thenorigin/main, or the ref inMNEMA_BASE. A missing main says which commands fetch it (including addingupstreamin a fork); a shallow clone saysgit fetch --unshallow; aMNEMA_BASEthat is no ref says so.--changeddoes not follow@mnema/*across packages (they resolve todist), so a change underpackages/<name>/srcalso runs every test of the packages that import it. That step is never skipped, even when a changedpackage.jsonmakes vitest run every test anyway, so some files then run twice: skipping it on a guess about which files vitest treats that way was wrong once.packages/chain/verifier/also runs itsself-testandvectors.--planprints the steps as JSON without running them; the test of the command uses it..devcontainer/devcontainer.jsongives Node at the engines floor, pnpm through corepack, Python 3.12 and a frozen-lockfile install, with the image and features pinned. AGENTS.md and CONTRIBUTING.md name the command as the check before a pull request, and a changelog entry is added.The guard that refuses a raised test ceiling lists
run.mjsas the one exception (not its test, which spells the flag in parts).Proof
the-contribution-check-is-the-light-one.test.tsasks the script for its plan and runs the guards step and the changed-tests step on a small filter, so a flag vitest refuses is red (putting back the duplicate--maxWorkersmade it fail with vitest's own error). It also covers the dependents step, the Python step, the refusals and that no workflow names the command. It setsNO_COLORand strips control characters, and fixes the changed-file list so an uncommitted edit does not change it. build, lint, typecheck, the whole suite,test:guardsandpnpm check:contributionitself pass.Written with an agent?