diff --git a/.coderabbit.yaml b/.coderabbit.yaml new file mode 100644 index 00000000..95c6bb14 --- /dev/null +++ b/.coderabbit.yaml @@ -0,0 +1,39 @@ +# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json +reviews: + # The description is the author's: no summary written into it, nor a fortune while it runs. + high_level_summary: false + in_progress_fortune: false + suggested_reviewers: false + # A version bump has nothing of ours to review; CI checks it. + auto_review: + ignore_usernames: + - 'dependabot[bot]' + # Not ours to change: H5P's vendored core, the pack's generated index, lz-string as shipped. + path_filters: + - '!packages/runtime/vendor/**' + - '!packages/libraries/index.js' + - '!packages/libraries/install.js' + - '!packages/embed/scorm/lz-string.js' + # The repository lints with oxlint (pnpm lint); the others would hold it to rules it does not keep. + tools: + biome: + enabled: false + eslint: + enabled: false + markdownlint: + enabled: false + languagetool: + enabled: false + htmlhint: + enabled: false + stylelint: + enabled: false + yamllint: + enabled: false +knowledge_base: + code_guidelines: + # Added to the defaults, which read AGENTS.md. A plain entry would govern design/ alone, but the + # rules there, its bold sentences, are for the whole repository. + filePatterns: + - files: design/*.md + applyTo: '**' diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 32770358..319c0d41 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,6 +12,7 @@ on: - 'docs/**' - '*.md' - LICENSE + - .coderabbit.yaml pull_request: branches: - main @@ -20,6 +21,7 @@ on: - 'docs/**' - '*.md' - LICENSE + - .coderabbit.yaml # Everything, and the week's caches saved on main, which pull requests restore. schedule: - cron: '0 5 * * 1' @@ -35,7 +37,7 @@ env: jobs: # Heavy packages get a lane each, the rest one. A change picks its packages and dependents; a file - # outside packages/, apps/, skills/, design/, docs/, root *.md, LICENSE picks all (reach unknown). + # outside packages/, apps/, skills/, design/, docs/, root *.md, LICENSE, .coderabbit.yaml picks all. scope: runs-on: ubuntu-latest outputs: @@ -64,7 +66,7 @@ jobs: esac if [ -n "$base" ]; then changed=$(git diff --name-only "$base" HEAD) - if grep -qvE '^(packages|apps|skills|design|docs)/|^[^/]+\.md$|^LICENSE$' <<< "$changed"; then all=true; fi + if grep -qvE '^(packages|apps|skills|design|docs)/|^[^/]+\.md$|^LICENSE$|^\.coderabbit\.yaml$' <<< "$changed"; then all=true; fi fi # pnpm counts a file outside the packages as the root's, whose test script tests them all. names() { pnpm "$@" ls --depth -1 --json | jq -r --arg root "$PWD" '.[] | select(.path != $root) | .name'; } diff --git a/design/testing.md b/design/testing.md index af5e39fe..a56b7b50 100644 --- a/design/testing.md +++ b/design/testing.md @@ -11,7 +11,7 @@ the packages (the lockfile, a workflow, the root's `package.json`) tests every p is one of the docs below. The player, the verifier, the skills, the embed package and the learner journeys take most of the time, so each tests in a job of its own, side by side, and the rest in one more. Every package that has a `typecheck` script runs it whatever the change, since each -package's check writes the types the next one reads. A change to `design/`, `docs/`, a root `.md` or `LICENSE` alone starts +package's check writes the types the next one reads. A change to `design/`, `docs/`, a root `.md`, `LICENSE` or `.coderabbit.yaml` alone starts no run. The `scope` job in `ci.yml` decides. **The costly checks run weekly and by hand.** These are Firefox and WebKit, the player's browser @@ -22,6 +22,12 @@ which also runs when `packages/vscode` changes. The slow files are `stalling-hos publishing the player, run CI by hand on main (`gh workflow run ci.yml`) and publish once it is green. +**CodeRabbit reviews each pull request against `AGENTS.md` and `design/`.** `.coderabbit.yaml` +skips what `pnpm lint` skips and Dependabot's pull requests, leaves linting to oxlint alone, and +writes nothing into a pull request's description. It reads the file from the pull request's own +branch, so a branch made before a change to it is reviewed without that change until rebased. +`@coderabbitai review` in a comment asks it again. + **A test's time limit is its package's, set once in its config for a slow runner** (#255). A limit stops a hang; it does not time a test. The author's Node tests ran on vitest's 5 s a test, and a CI runner builds packages and writes bundles two to four times slower than a laptop: three