Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
version: 2
# Version updates come monthly, one pull request per entry at a time, and CI
# holds each until someone starts it (see `ci.yml`). The limits don't apply to
# security updates.
updates:
# One entry at the workspace root: it reads `pnpm-workspace.yaml` and covers
# every package, so a package added later needs no change here.
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "weekly"
# Majors apart from the rest, so one that needs reading does not hold the
# minor and patch updates back. The first group a dependency matches wins,
# so the minor and patch group has to come first.
interval: "monthly"
# Majors apart from the rest, so a minor and patch pull request never
# carries one that needs reading. Whichever is open holds the other back.
# The first group a dependency matches wins, so the minor and patch group
# has to come first.
groups:
npm-minor-and-patch:
applies-to: "version-updates"
Expand All @@ -35,13 +39,13 @@ updates:
- dependency-name: "typescript"
update-types:
- "version-update:semver-major"
open-pull-requests-limit: 5
open-pull-requests-limit: 1
labels:
- "dependencies"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
interval: "monthly"
groups:
all-actions:
patterns:
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/audit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ name: Audit
# Informational, never a check: an advisory published against a dependency
# fails this run and leaves every other pull request's checks alone. A failed
# weekly run opens one issue, which later failures comment on. A run
# starts weekly, by hand, and for a pull request that changes the lockfile.
# starts weekly, by hand, and for a pull request that changes the lockfile. A
# run that Dependabot starts is held; push a commit to its branch to audit it.
on:
schedule:
- cron: "29 5 * * 1"
Expand All @@ -23,6 +24,7 @@ permissions:
jobs:
audit:
name: Dependency audit
if: ${{ !(github.event_name == 'pull_request' && github.actor == 'dependabot[bot]') }}
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
Expand Down
26 changes: 17 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
name: CI

# A run that Dependabot starts is held: every job is skipped and the required
# `Full CI` stays expected, so nothing merges. To run it, start a run yourself:
# `gh pr ready --undo <n> && gh pr ready <n>`, or push a commit to the branch.
# Rerunning a held run leaves it held. Don't close and reopen the pull request,
# because closing it makes Dependabot drop the update.
on:
push:
branches: [main]
Expand Down Expand Up @@ -28,6 +33,7 @@ jobs:
# workflow, which the script asks the API for, hence `actions: read`.
changes:
name: Classify changes
if: ${{ !(github.event_name == 'pull_request' && github.actor == 'dependabot[bot]') }}
runs-on: ubuntu-latest
timeout-minutes: 5
permissions:
Expand Down Expand Up @@ -65,7 +71,7 @@ jobs:
checks:
name: Checks
needs: changes
if: ${{ !cancelled() }}
if: ${{ !cancelled() && !(github.event_name == 'pull_request' && github.actor == 'dependabot[bot]') }}
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
Expand Down Expand Up @@ -101,7 +107,7 @@ jobs:
tests:
name: Tests ${{ matrix.shard }}/3 on ${{ matrix.node == 'pinned' && 'the pinned Node' || format('Node {0}', matrix.node) }}
needs: changes
if: ${{ !cancelled() && needs.changes.outputs.full != 'false' && (needs.changes.result != 'success' || needs.changes.outputs.tests != 'false') }}
if: ${{ !cancelled() && !(github.event_name == 'pull_request' && github.actor == 'dependabot[bot]') && needs.changes.outputs.full != 'false' && (needs.changes.result != 'success' || needs.changes.outputs.tests != 'false') }}
runs-on: ubuntu-latest
timeout-minutes: 20
strategy:
Expand Down Expand Up @@ -142,7 +148,7 @@ jobs:
proof:
name: Proof ${{ matrix.shard }}/${{ strategy.job-total }}
needs: changes
if: ${{ !cancelled() && (needs.changes.result != 'success' || needs.changes.outputs.proof != 'false') }}
if: ${{ !cancelled() && !(github.event_name == 'pull_request' && github.actor == 'dependabot[bot]') && (needs.changes.result != 'success' || needs.changes.outputs.proof != 'false') }}
runs-on: ubuntu-latest
timeout-minutes: 45
strategy:
Expand Down Expand Up @@ -175,7 +181,7 @@ jobs:
plugins:
name: Plugins
needs: changes
if: ${{ !cancelled() && (needs.changes.result != 'success' || needs.changes.outputs.plugins != 'false') }}
if: ${{ !cancelled() && !(github.event_name == 'pull_request' && github.actor == 'dependabot[bot]') && (needs.changes.result != 'success' || needs.changes.outputs.plugins != 'false') }}
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
Expand All @@ -195,7 +201,7 @@ jobs:
bundles:
name: Bundles
needs: changes
if: ${{ !cancelled() && (needs.changes.result != 'success' || needs.changes.outputs.bundles != 'false') }}
if: ${{ !cancelled() && !(github.event_name == 'pull_request' && github.actor == 'dependabot[bot]') && (needs.changes.result != 'success' || needs.changes.outputs.bundles != 'false') }}
runs-on: ubuntu-latest
timeout-minutes: 25
steps:
Expand Down Expand Up @@ -237,7 +243,7 @@ jobs:
stop:
name: Stop the slow jobs
needs: checks
if: ${{ always() && github.event_name == 'pull_request' && needs.checks.result == 'failure' }}
if: ${{ always() && github.event_name == 'pull_request' && needs.checks.result == 'failure' && !(github.event_name == 'pull_request' && github.actor == 'dependabot[bot]') }}
runs-on: ubuntu-latest
timeout-minutes: 5
permissions:
Expand All @@ -255,11 +261,13 @@ jobs:
# It runs after a failed job and fails then. A cancelled run skips it, and a
# skipped job never reports as `Full CI`, so a cancel cannot leave it green.
# The exception is the cancel `stop` makes after a failed `Checks`: the gate
# still runs then, and fails, so `Full CI` is red and not cancelled.
# still runs then, and fails, so `Full CI` is red and not cancelled. A held
# Dependabot run skips it too, and its name then is never `Full CI`, so the
# required check stays expected.
gate:
name: ${{ github.event.pull_request.draft && 'Draft CI' || 'Full CI' }}
name: ${{ github.event_name == 'pull_request' && github.actor == 'dependabot[bot]' && 'Held CI' || (github.event.pull_request.draft && 'Draft CI' || 'Full CI') }}
needs: [changes, checks, tests, proof, plugins, bundles]
if: ${{ !cancelled() || needs.checks.result == 'failure' }}
if: ${{ (!cancelled() || needs.checks.result == 'failure') && !(github.event_name == 'pull_request' && github.actor == 'dependabot[bot]') }}
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ name: CodeQL
# instructions starts no run. CodeQL is not a required check, so a run that
# never starts leaves no check pending. A draft pull request is analyzed once
# it is marked ready for review, and on every push after that. A weekly run
# analyzes the whole tree.
# analyzes the whole tree. A run that Dependabot starts is held and analyzes
# nothing; `ci.yml` says how to opt a pull request in.
on:
push:
branches: [main]
Expand Down Expand Up @@ -44,7 +45,7 @@ permissions:
jobs:
analyze:
name: Analyze (${{ matrix.language }})
if: ${{ !github.event.pull_request.draft }}
if: ${{ !github.event.pull_request.draft && !(github.event_name == 'pull_request' && github.actor == 'dependabot[bot]') }}
runs-on: ubuntu-latest
timeout-minutes: 30
permissions:
Expand Down
3 changes: 2 additions & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ A connector's process exits `0` once stopped cleanly, `1` for any other failure,
- Getting finished work to `main` comes first. Branches need not be up to date with `main`, so update one only for a conflict or for something on `main` it needs. When `main` is red, fix it first in one small pull request, because a red `main` fails every open pull request's checks. An admin merge (`gh pr merge <number> --squash --admin --delete-branch`) goes ahead without waiting for `Full CI` in five cases, and the pull request says which: jobs the change cannot affect; check bookkeeping on a head that passed its full checks; a fix for a red `main` that changes only tests, once its local quick checks pass; a pull request that failed only because `main` was red, once `main` is fixed, when the only failed jobs are the ones `main` broke and its local quick checks pass, with no rebase and full rerun; and a clean update from `main` of a head that passed `Full CI`, once the run the update starts is cancelled and `git diff origin/main...HEAD` shows the same change as before the update. GitHub merges no draft, so mark one ready and cancel the run that starts first. After an admin merge, watch the merged commit's runs on `main` and fix `main` forward if one fails. A change to data, access, the Marfa pin (`scripts/monorepo.commit`), a migration or a release always waits for `Full CI` to pass.
- Make worktrees in `.claude/worktrees/` (`git worktree add .claude/worktrees/<name> -b <branch> origin/main`). Once the work is merged, remove the worktree and its local branch (`git worktree remove`, then `git branch -D`, because git sees a squash-merged branch as unmerged) and run `git pull --ff-only` on `main`. If git refuses a removal, report it rather than forcing it.
- This repository is public while development continues. Public visibility is not a release milestone.
- Every Actions workflow uses standard GitHub-hosted runners, never personal self-hosted runners or paid third-party runners. Never hold back a push or a check to ration runners; keep stacked changes in order and cancel superseded runs.
- Every Actions workflow uses standard GitHub-hosted runners, never personal self-hosted runners or paid third-party runners. Never hold back a push or a check to ration runners; keep stacked changes in order and cancel superseded runs. The one exception is the Dependabot hold below.
- A run that Dependabot starts (it opens, pushes to or rebases a pull request) is held: every job in `ci.yml`, `codeql.yml` and `audit.yml` that a pull request starts is skipped, the gate included, and the skipped gate is never named `Full CI`, so the required `Full CI` stays expected and blocks a merge. To check a Dependabot pull request, start a run yourself with `gh pr ready --undo <number> && gh pr ready <number>`, or push a commit to its branch (a push also runs the audit, which the draft toggle doesn't). Rerunning a held run leaves it held. Don't close and reopen the pull request, because closing it makes Dependabot drop the update. `scripts/test/ci-changes.test.ts` pins the hold.
- `scripts/ci-changes.ts` decides what a pull request or a push to `main` runs. `Checks` always formats and scans every file, and builds, typechecks and lints for a change to code: it is the quick job. `Tests` runs the unit tests in three shards (Vitest `--shard`) on Node 22 and again on the Node `host/node.json` pins (which the `Classify changes` job reads, so no workflow repeats the version; the tests that start a bundle under the permission flags run on the pinned Node only, since `--allow-net` exists from Node 25), `Proof` runs the proof in three shards, `Plugins` runs `marfa plugins check` on each plugin's source folder with no dependencies installed, and `Bundles` builds and bundles every connector on the pinned Node, runs each bundle's `--help` under the permission flags and runs the proof's `rss` group from the RSS bundle, each only for a change that can affect it. `release.yml` builds on the pinned Node too. A change under `host/` runs `Checks`, `Tests` and `Proof` (its tests alone for `host/test/`), and `host/node.json`, the launcher (`host/sandbox/` and the two scripts that compile it in CI) and the files of `host/src/` that start a bundle (`permission-flags`, `launch`, `probe`, `sandbox-plan`, `sandbox-paths`, `macos-profile`) also run `Bundles`. `Bundles` also runs the launcher's Rust tests. A change that touches only `scripts/proof/` runs `Proof` alone, except `scripts/proof/rss.ts` and `scripts/proof/main.ts`, which also run `Bundles`, and the files a unit test imports, which also run `Tests` and `Bundles`. A change that touches one connector and nothing in `kit/`, `shared/` or the template runs that connector's tests only (`scope`); any doubt runs everything. Anything under `types/<name>/` or `connectors/<name>/plugin/` is that plugin's code, Markdown included, since a type's guidance is Markdown: it runs `Plugins` and `Proof`. Other Markdown, the license and the settings and instructions under `.claude/`, `.agents/`, `.codex/` and `.githooks/` are documentation, and an unnamed path, a fixture, a workflow, an empty or unreadable diff, a schedule and a manual run run everything. A push to `main` is classified the same way, but only when the commit before it has a green `ci.yml` push run, and runs everything otherwise, so a documentation commit never shows green over one that was red or unchecked. A skipped job passes its required check; `scripts/test/ci-changes.test.ts` pins the rules. A draft runs only `Checks` without its tests; marking it ready for review, and every push after, runs everything.
- The proof is a list of groups in `scripts/proof/shards.ts`, each a `prove` function with the statements it makes and the seconds it took. A shard runs the groups that a split by longest time first gives it, the same in every process, and boots its own server, which the shard's groups with `instance: "shared"` use together; a group with `instance: "own"` boots a server of its own, empty, because it installs plugins or holds a source that another group's connector would hold on a shared one. A new group needs its entry there and its runner in `scripts/proof/main.ts`; with no time given it is weighed at a minute. Refresh a group's seconds when its time changes a lot. `pnpm proof --group <name>` runs one group, which is how the release gates itself. The GitHub group is one stateful flow, so it sets the length of the longest shard.
- A test that fails runs once more in CI (`retry` in `vitest.config.ts`), and `scripts/retried-tests.ts` lists each one that then passed in the job summary and as a warning. A test reported more than once gets an issue and a fix. A test never asserts how long something took: it counts the work, or it relies on the test timeout to end a hang.
Expand Down
8 changes: 4 additions & 4 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading