~ knotless Search/
↑↓ move↵ open⇧↵ all results

chadtmiller.com/knotless

git that lives in your Atmosphere account

knotless.dev
1 collaborator

knotless 0.13.0 Latest 2 packages, 1 image

1
10

The workflows use shared steps in place of their pasted blocks

Merged
Merged chadtmiller.com asked to merge into main from chadtmiller.com/knotless:ci/shared-steps

What changes

The pasted blocks are shared steps. knotless's workflows use the steps in knotless://chadtmiller.com/steps, pinned in a new .knotless/uses.lock:

  • check.yml: fmt and clippy are rust-lint.
  • test.yml: Node is node, the harness's packages are npm-ci (omit: dev), and cargo-llvm-cov is cargo-llvm-cov.
  • e2e.yml: Node is node, and web's and the harness's packages are npm-ci.
  • scenarios.yml: Node is node, the harness's packages are npm-ci.
  • docs.yml and web.yml: their packages are npm-ci.
  • release.yml: its "checks pass" loop is wait-for-checks, with only-on: refs/heads/main.
  • publish-lexicons.yml: plan, wait-for-checks, then publish, all with shared steps. deploy/publish-lexicons.mjs is gone.

Each workflow's cache already covered the directories these steps install into (/opt/node, /opt/tools, <dir>/node_modules, target and the rust caches). web, docs and e2e now also run when .knotless/uses.lock changes, so a step bump is checked.

A seventh step, publish-lexicons. It is grain's script, made general, and it lives in the steps repository (scripts/publish-lexicons.mjs, run from $KNOTLESS_STEP_DIR). Its inputs are did, zone, dir (default lexicons) and write ("true" to write, otherwise plan only). It takes the secrets LEX_PASSWORD and CLOUDFLARE_API_TOKEN. It publishes only lexicons whose authority is in the zone. When the DNS token is missing, it writes the schemas and then fails, naming the records to make. It reads schemas as plain JSON, not through goat, so the space lexicons (dev.knotless.space, dev.knotless.orgSpace) publish too. It was released as @step/publish-lexicons 1.0.0, at cc436177, after the run on this branch described below passed.

Left as they were:

  • deploy.yml. Its checks loop runs on the host through on-host, with unless-moved around it. Its key step uses DEPLOY_SSH_KEY, and a uses step passes secrets by name only, while ssh-key asks for SSH_KEY.
  • lexicons.yml. It installs goat and runs npm install of one package, not npm ci.
  • shots.yml and look.yml. Their Node and packages are in harness/shots/*.sh.
  • docs-audit.yml. It does a global npm install of Claude Code.
  • The spaces alpha and sqlite blocks. No step does that job.

Why

The same Node install, lockfile check and checks loop were pasted into several workflows and had started to drift. This pull is also the first real run of the shared steps.

How it was checked

  • Locally, the new script ran in plan mode and as a write against prod. Both reported 0 DNS changes, 0 to put, 0 to delete and 160 unchanged, so the write was a no-op.
  • knotless uses update was run with a CLI built from main.
  • On this pull, check exercises rust-lint. test exercises node, npm-ci and cargo-llvm-cov. web, docs and e2e exercise npm-ci (and node in e2e).
  • publish-lexicons was asked for on this branch. Every part passed: needs, the plan step reading the script from $KNOTLESS_STEP_DIR (161 unchanged), the knotless install in wait-for-checks, the wait skipped off main, and the publish step, which had nothing to write and no secrets.
  • An earlier run, before main was merged in, planned to delete dev.knotless.orgSpace. That was correct for a tree from before it landed, and with no LEX_PASSWORD its publish step failed having written nothing.
  • The pull's own checks first errored with unknown field 'uses'. runner.knotless.dev was still on a build from before shared steps. They are rerun once it is redeployed.

Shortcomings

  • Steps a pull can't exercise. Pull runs get no secrets, and release, publish-lexicons and scenarios don't run on pulls. Three things are proven only on main after this merges:
    • the wait loop in wait-for-checks
    • a publish-lexicons write made with LEX_PASSWORD. This merge triggers one, because the workflow's own file is now in its paths.
    • the steps in scenarios.yml, until the owner asks for a run
  • ssh-key isn't used here.
  • release.yml now waits for checks on every main run. That includes runs where the version is already published, because the step can't see ~/.done. Those runs wait for checks they don't need. That matters only for a Cargo.toml change that isn't a version bump.
  • Branch runs of publish-lexicons. Until the step-level on key lands, the publish step can't be gated by ref, so it also runs when asked for on a branch. There it has no secrets: it passes when there is nothing to change, and otherwise fails having written nothing. Once on lands, the publish step should take on: {refs: [refs/heads/main]}.

🤖 Generated with Claude Code

Asked for changes

This pull replaces the pasted Node, npm-ci, llvm-cov, lint and wait-for-checks blocks with shared steps, pins them in .knotless/uses.lock, and deletes deploy/publish-lexicons.mjs. I found one blocker, and the pull can't land until it's fixed.

Every workflow this pull touches fails to load on the runner. check, test, web, docs, e2e, release, scenarios and publish-lexicons all report steps[N]: unknown field 'uses', expected one of 'name', 'run', 'timeout'. The runner serving this repo (did:plc:4bocpkn5…) doesn't know step-level uses yet. So none of the claims under "How it was checked" are true on this pull: rust-lint, node, npm-ci and cargo-llvm-cov were never run. AGENTS.md says the pull is done only when all seven checks pass, and check and test are also the merge queue's pre-flights. The only checks that pass are shots and lexicons, and both were skipped.

Landing this would also break main. Its push runs would hit the same load error, so deploy would never get its checks and release and publish-lexicons would not run.

What to do:

  • Get a runner that supports uses deployed to this repo's runner, then push again so the checks run.
  • Wait for check, test, web, docs and e2e to pass on the new head before queueing.
  • Consider holding the publish-lexicons change until the plan step has run once. It deletes the only working publisher, and the new step is pinned by hand to an unreleased commit with no release in the lock.

I have no other findings yet. Once the workflows load and run, I'll look at their logs.

.knotless/workflows/check.ymlline 20
cache: [target, /usr/local/cargo/registry, /usr/local/rustup]
steps:
# cargo fmt --check, then clippy over the workspace, warnings denied.
- uses: chadtmiller.com/steps/rust-lint@1
review.knotless.dev

This uses step makes check.yml fail to load: unknown field 'uses'. The runner has no support for it yet, and the same error hits every workflow in this pull.

Asked for changes

Nothing I asked for last round has changed. On head 7ea907e, check, test, web, docs, e2e, release, scenarios and publish-lexicons all still fail to load. Each reports steps[N]: unknown field 'uses', expected one of 'name', 'run', 'timeout'. The runner serving this repo (did:plc:4bocpkn5…) doesn't support step-level uses. The only checks that pass are shots and lexicons, and both were skipped.

So none of the claims under "How it was checked" hold on this pull. rust-lint, node, npm-ci, cargo-llvm-cov and the publish-lexicons plan step have never run. check and test are also the merge queue's pre-flights.

If this lands, main breaks. Its push runs would hit the same load error. deploy would then never get its checks, and release and publish-lexicons would not run.

What to do:

  • Deploy a runner that supports step-level uses to this repo's runner, then push again.
  • Wait for check, test, web, docs and e2e to pass on the new head before queueing.
  • Read the logs of those runs. I can't judge the step wiring until they load.
  • Consider holding the publish-lexicons change until the plan step has run once. It deletes the only working publisher, and the new step is pinned by hand to an unreleased commit.
Merged as c6a6549