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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
55 changes: 44 additions & 11 deletions .agents/skills/releasing/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,50 @@ into `main` through a PR, and the merge is what publishes.
CLI binaries, the `.vsix` and the browser zips, updates the rolling
`latest` release, and then publishes to each store.

CI runs on `pull_request` into `main` only. Six checks: `extension
versions bumped` (PRs only), `build`, `public proxy routes`,
`cargo test + clippy`, `cargo test --features db-tests`, and
`graph + editor`.

## Run the checks CI runs, not the ones you touched

`cargo clippy --workspace --all-targets --locked -- -D warnings` is
the CI line. Running clippy on the crates you edited is not the same
thing and has already sent a PR red on a lint in a crate the change
only touched indirectly.
CI runs on `pull_request` into `main` only. Every check is its own
job, so they run side by side. The main ruleset requires four names:
`extension versions bumped` (PRs only), `cargo test --features
db-tests`, and two gates that are green only when every job under them
is: `cargo test + clippy` (nextest, doc tests, clippy, the parse-only
build, the examples) and `graph + editor` (each JS package, the VS Code
extension, the WhatsApp bridge, the browser extension). The docs book
builds beside them. On `main`, `release.yml` runs the same suite as its
gate, and starts the builds (binaries, .vsix, browser zips) beside it;
only what publishes waits for the gate.

## Before every push to a PR, run what the PR runs

Before you push a commit to a branch with a PR (the first push that
opens it, and every fix pushed after), run locally everything the PR's
checks run, not only the tests your change reaches. This is the one
place the [test scope] does not apply: a red PR costs a full CI round
trip, and twice a PR has gone red on a test in a crate the change only
touched indirectly. Background the run, and fix everything before the
push, not after. Locally the cargo commands go one after another (they
share one build directory, which cargo locks, and overlapping cargo runs
have crashed this machine); the JS checks and the docs build run beside
them.

The PR runs `.github/workflows/ci.yml` and `.github/workflows/docs.yml`;
read them for the current list. At the time of writing:

- `scripts/check-extension-bump.sh origin/main`
- `cargo nextest run --workspace --locked`
- `cargo test --workspace --locked --doc`
- `cargo clippy --workspace --all-targets --locked -- -D warnings`
- `cargo check -p weft-compiler --no-default-features --locked`
- `scripts/validate-examples.sh`
- `scripts/run-db-tests.sh` (every crate, no filter)
- `pnpm -C packages/weft-graph test`, `pnpm -C packages/weft-connect test`,
`pnpm -C packages/weft-syntax test`, `pnpm -C extension-vscode test`,
`pnpm -C extension-vscode run compile`
- `node --test catalog/bailey/bridge/images/bridge/src/*.test.js`
- `pnpm -C extension-browser exec tsc --noEmit`, `pnpm -C extension-browser check`
- the docs build: `cd docs && mdbook-mermaid install . && mdbook build`

Clippy on the crates you edited is not the same as the workspace line
above, and has sent a PR red on a lint in a crate the change only
touched indirectly.

`scripts/validate-examples.sh` compiles every example. It fails on
ERRORS only, so a warning is advice an example may carry. If an
Expand Down
21 changes: 15 additions & 6 deletions .claude/skills/releasing/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,16 @@ into `main` through a PR, and the merge is what publishes.
CLI binaries, the `.vsix` and the browser zips, updates the rolling
`latest` release, and then publishes to each store.

CI runs on `pull_request` into `main` only. Six checks: `extension
versions bumped` (PRs only), `build`, `public proxy routes`,
`cargo test + clippy`, `cargo test --features db-tests`, and
`graph + editor`.
CI runs on `pull_request` into `main` only. Every check is its own
job, so they run side by side. The main ruleset requires four names:
`extension versions bumped` (PRs only), `cargo test --features
db-tests`, and two gates that are green only when every job under them
is: `cargo test + clippy` (nextest, doc tests, clippy, the parse-only
build, the examples) and `graph + editor` (each JS package, the VS Code
extension, the WhatsApp bridge, the browser extension). The docs book
builds beside them. On `main`, `release.yml` runs the same suite as its
gate, and starts the builds (binaries, .vsix, browser zips) beside it;
only what publishes waits for the gate.

## Before every push to a PR, run what the PR runs

Expand All @@ -50,8 +56,11 @@ opens it, and every fix pushed after), run locally everything the PR's
checks run, not only the tests your change reaches. This is the one
place the [test scope] does not apply: a red PR costs a full CI round
trip, and twice a PR has gone red on a test in a crate the change only
touched indirectly. Background each one, and fix everything before the
push, not after.
touched indirectly. Background the run, and fix everything before the
push, not after. Locally the cargo commands go one after another (they
share one build directory, which cargo locks, and overlapping cargo runs
have crashed this machine); the JS checks and the docs build run beside
them.

The PR runs `.github/workflows/ci.yml` and `.github/workflows/docs.yml`;
read them for the current list. At the time of writing:
Expand Down
6 changes: 3 additions & 3 deletions .github/ISSUE_TEMPLATE/provider_request.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
name: Provider request
description: Ask for a paid provider to be usable on the shared keys in app.weavemind.ai.
description: Ask for a paid provider's meter to ship with weft, so its calls are measured.
labels: ["provider-request", "triage"]
body:
- type: markdown
attributes:
value: |
Ask here for a provider whose calls people can make without bringing their own key, billed to app.weavemind.ai instead.
Ask here for a provider whose meter should ship with weft: the code that records what each of its calls cost. Without one, its calls go through unmeasured, and an install cannot offer its own key for it, because that key only travels on routes a meter knows.

You are not blocked waiting on us. A provider defined inside your own project works today with your own key: write its meter as a shared `.rs` file in your package ([how meters work](https://weavemindai.github.io/weft/connections/meters.html)) and set the key on the node. This request is only about the shared keys, which need a reviewed meter shipped in weft itself.
You are not blocked waiting on us. A provider defined inside your own project works today with your own key: write its meter as a shared `.rs` file in your package ([how meters work](https://weavemindai.github.io/weft/connections/meters.html)) and set the key on the node. This request is about a meter shipped in weft itself, which every install gets.

- type: input
id: name
Expand Down
153 changes: 141 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,14 @@ jobs:
fetch-depth: 0
- run: scripts/check-extension-bump.sh "origin/${{ github.base_ref }}"

rust:
name: cargo test + clippy
# The Rust checks, each on its own runner so they run side by side:
# the wall time is the slowest one instead of their sum. Each builds
# what it needs from the tests job's cache (`shared-key`), which only
# that job saves, on main: one warm copy in the repo's cache space
# instead of one per job. The `rust` job below gathers them under the
# one name the main ruleset requires.
test:
name: cargo nextest
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -61,29 +67,89 @@ jobs:
- run: rustup toolchain install
# Restores everywhere, saves only on main (release.yml's call of
# this file): a PR reads main's copy and leaves nothing behind, and
# release.yml's prune-caches keeps one copy per job.
# release.yml's prune-caches keeps one copy per cache.
- uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2
with:
shared-key: workspace
save-if: ${{ github.ref == 'refs/heads/main' }}

# No compile-time query macros anywhere, so the workspace suite needs no
# database. The tests that do want one are behind the `db-tests` feature.
# Under cargo-nextest, as developers run it: each test in its own
# process, which tests that set the process's env vars rely on. Doc
# tests are the one kind nextest does not run.
# process, which tests that set the process's env vars rely on.
- run: curl -LsSf https://get.nexte.st/latest/linux | tar zxf - -C "${CARGO_HOME:-$HOME/.cargo}/bin"
- run: cargo nextest run --workspace --locked

doc:
name: cargo doc tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: rustup toolchain install
- uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2
with:
shared-key: workspace
save-if: false
# Doc tests are the one kind nextest does not run.
- run: cargo test --workspace --locked --doc

clippy:
name: cargo clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: rustup toolchain install
- uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2
with:
shared-key: workspace
save-if: false
- run: cargo clippy --workspace --all-targets --locked -- -D warnings

parse-only:
name: parse-only build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: rustup toolchain install
- uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2
with:
shared-key: workspace
save-if: false
# The parse-only build (weft-core without its `runtime` layer, what a
# WASM parser links). A workspace build always turns `runtime` on, so
# nothing else compiles this shape.
- run: cargo check -p weft-compiler --no-default-features --locked

examples:
name: examples compile
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: rustup toolchain install
- uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2
with:
shared-key: workspace
save-if: false
# The examples are the first thing a new user copies, and nothing
# else compiles them. The script tolerates only the
# connect-a-credential diagnostics a fresh checkout produces.
- run: scripts/validate-examples.sh

# The name the main ruleset requires: green only when every Rust check
# above is. It runs whatever happened above (unless the run was
# cancelled), so a failure there shows here as a failure, never as a
# skip the ruleset would wait on.
rust:
name: cargo test + clippy
needs: [test, doc, clippy, parse-only, examples]
if: ${{ !cancelled() }}
runs-on: ubuntu-latest
env:
NEEDS: ${{ toJSON(needs) }}
steps:
- run: |
jq -e 'all(.[]; .result == "success")' <<< "$NEEDS" >/dev/null \
|| { jq -r 'to_entries[] | "\(.key): \(.value.result)"' <<< "$NEEDS"; exit 1; }

db:
name: cargo test --features db-tests
runs-on: ubuntu-latest
Expand Down Expand Up @@ -115,8 +181,10 @@ jobs:
# container, so the crate list lives in exactly one place.
- run: scripts/run-db-tests.sh

editor:
name: graph + editor
# The JS checks, side by side like the Rust ones, gathered under the
# name the main ruleset requires by the `editor` job below.
graph:
name: weft-graph tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -125,17 +193,78 @@ jobs:
workspace: extension-vscode
borrow-packages: packages/weft-graph packages/weft-syntax packages/weft-connect
- run: pnpm -C packages/weft-graph test

connect:
name: weft-connect tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-node-workspace
with:
workspace: extension-vscode
borrow-packages: packages/weft-graph packages/weft-syntax packages/weft-connect
- run: pnpm -C packages/weft-connect test

syntax:
name: weft-syntax tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-node-workspace
with:
workspace: extension-vscode
borrow-packages: packages/weft-graph packages/weft-syntax packages/weft-connect
- run: pnpm -C packages/weft-syntax test

vscode:
name: VS Code extension
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-node-workspace
with:
workspace: extension-vscode
borrow-packages: packages/weft-graph packages/weft-syntax packages/weft-connect
- run: pnpm -C extension-vscode test
- run: pnpm -C extension-vscode run compile
# The WhatsApp bridge's pure parts; `node --test` needs no install.

bridge:
name: WhatsApp bridge tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# The bridge's pure parts; `node --test` needs no install.
- run: node --test catalog/bailey/bridge/images/bridge/src/*.test.js
# The browser extension ships to three stores gated only on a
# version bump, so its checks belong in the same gate as
# everything else JS.

# The browser extension ships to three stores gated only on a version
# bump, so its checks belong in the same gate as everything else JS.
browser:
name: browser extension
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# svelte-check reads the connect library's own sources and its
# svelte.config, whose packages live in the editor's workspace:
# the library borrows that install, as it does locally.
- uses: ./.github/actions/setup-node-workspace
with:
workspace: extension-vscode
borrow-packages: packages/weft-connect
- uses: ./.github/actions/setup-node-workspace
with:
workspace: extension-browser
- run: pnpm -C extension-browser exec tsc --noEmit
- run: pnpm -C extension-browser check

# The name the main ruleset requires (see the `rust` job).
editor:
name: graph + editor
needs: [graph, connect, syntax, vscode, bridge, browser]
if: ${{ !cancelled() }}
runs-on: ubuntu-latest
env:
NEEDS: ${{ toJSON(needs) }}
steps:
- run: |
jq -e 'all(.[]; .result == "success")' <<< "$NEEDS" >/dev/null \
|| { jq -r 'to_entries[] | "\(.key): \(.value.result)"' <<< "$NEEDS"; exit 1; }
Loading
Loading