Skip to content

chore(ci): every workflow step runs a just recipe - #4098

Merged
kixelated merged 4 commits into
quest/m1/tooling/READMEfrom
quest/m1/tooling/workflows-call-just
Sep 25, 2026
Merged

kixelated merged 4 commits into
quest/m1/tooling/READMEfrom
quest/m1/tooling/workflows-call-just

Conversation

@kixelated

@kixelated kixelated commented Sep 25, 2026 •

Copy link
Copy Markdown
Collaborator

Completes /quest/m1/tooling/workflows-call-just.md.

Problem

About 97 workflow run: lines called scripts by path, so moving a script or changing its arguments meant editing up to twenty workflows. The just menu wasn't the whole command surface.

Approach

  • Pass-through recipes, named by role under their area module:
    • gh: release, alert, formula, install-formula, trigger-repo-publish
    • rs: package-binary, package-windows, package-nfpm, package-ffi, package-libmoq, package-gst, gst-smoke
    • swift: package-ffi, verify, verify-ffi, publish, publish-ffi
    • go: publish-ffi, publish-wrapper
    • also dart package, obs package and js bench
    • Each is one line using [positional-arguments] and "$@", so quoting survives. The swift/go/kt/dart/obs module recipes are [no-cd], so a relative --output or --tarball still resolves from the repo root. I checked that just go package-wrapper --output X writes to ./X, not go/X.
  • Every step rewritten. apt-repo and rpm-repo pass $GITHUB_WORKSPACE/artifacts to the existing infra <repo> publish recipe, which otherwise resolves artifacts inside infra/<repo>.
  • just for non-nix jobs (plain ubuntu, macOS and Windows runners): a new composite action .github/actions/just installs a checksum-verified prebuilt through taiki-e/install-action (SHA-pinned, just@1.58.0 to match nixpkgs). It runs right after checkout in each job, and replaces nightly's and android's cargo install just@1.52.0.
  • Enforcement: just gh check runs sh/gh/check-runs.ts. It parses every workflow with Bun.YAML and fails on any run: line naming a .sh, .py, .ts, .js or .mjs file. It reads only run: steps, so paths: filters naming a script are fine. The rule is one line in a new CI section of CONTRIBUTING.md.
  • The direnv hook test moved from check.yml to the nightly just gh test, with the other tooling self-tests, following the line's rule that PRs don't test the tooling itself.

Impact

  • No public API or wire changes.
  • New recipes, listed above. swift package, go package-ffi|package-wrapper and kt package are now [no-cd]. Their callers were workflows running from the repo root.
  • One new third-party action: taiki-e/install-action.

Verification

  • Local: actionlint, just gh check (0 violations), justfile fmt, shell, markdown and taplo pass. I dry-ran gh release parse-version|read-version with GITHUB_OUTPUT, and ran the argument errors of formula, package-nfpm, package-binary and swift verify.
  • Tag-triggered release workflows (moq-cli, moq-relay, moq-gst, libmoq, release-*) get their end-to-end check from the next release.
  • apt-repo and rpm-repo have no dry-run input. A workflow_dispatch with an existing tag re-syncs the production R2 bucket (idempotent), so I haven't run it without approval.
  • release-winget calls no scripts and is unchanged.

Alternatives

  • cargo install just in each job (the quest's original pattern) costs about a minute of compile per release job.
  • Wrapping each step in nix develop --command doesn't work on Windows and adds a heavy Nix setup.

Follow-ups

  • release-binary is now ready. It no longer lists this quest under Required.

(written by Claude Opus 5.5)

🤖 Generated with Claude Code

kixelated and others added 2 commits September 24, 2026 20:58
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
No workflow `run:` step names a `.sh` file any more. Each script a workflow
needs has a pass-through recipe under its area module (`just gh release`,
`just rs package-binary`, `just swift publish`, ...), and `just gh check`
enforces the rule with sh/gh/check-runs.ts. Module recipes that take paths
are `[no-cd]` so relative arguments mean what they did to the script.

Jobs outside the nix dev shell install just through the new
.github/actions/just (taiki-e/install-action, just 1.58.0), which also
replaces nightly's and android's `cargo install just`. The direnv hook test
moves to the nightly `just gh test` with the other tooling self-tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated

Copy link
Copy Markdown
Collaborator Author

I dispatched both repo workflows from this branch with moq-relay-v0.15.2, and both succeeded. In each, .github/actions/just installed just, then just infra <repo> publish "$GITHUB_WORKSPACE/artifacts" found the downloaded artifacts and re-synced:

(written by Claude Opus 5.5)

@kixelated
kixelated marked this pull request as ready for review September 25, 2026 05:14
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-25T06:58:06.078180Z 96b7dbc New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b5e68f1fb7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .github/justfile Outdated
sh/gh/release.test.sh
python3 sh/rs/package-rename.test.py
sh/go/publish-wrapper.test.sh
.claude/hooks/direnv.test.sh

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Run the non-executable hook test through Bash

When the nightly gh test matrix entry reaches this command, it fails with Permission denied because .claude/hooks/direnv.test.sh is tracked as mode 100644. I reproduced the failure with nix develop --command just gh test; the previous workflow explicitly used bash, so moving the test here makes its only CI wiring fail unconditionally. Invoke it through Bash or make the file executable.

AGENTS.md reference: AGENTS.md:L23-L23

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 40524f6: the recipe runs it as bash .claude/hooks/direnv.test.sh, like the old check.yml step.

(written by Claude Opus 5.5)

Comment thread .github/workflows/release-go-ffi.yml Outdated
Comment on lines +19 to +23
- "just gh release"
- "go/ffi/**"
- "sh/go/package-ffi.sh"
- "sh/go/publish-ffi.sh"
- "rs/moq-ffi/build.sh"
- "just go package-ffi"
- "just go publish-ffi"
- "just rs package-ffi"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Restore repository paths in workflow filters

GitHub interprets these paths entries as repository-relative glob patterns, not commands, so names such as just gh release and just go package-ffi cannot match changes to sh/gh/release.sh, sh/go/package-ffi.sh, or the relevant justfiles. Consequently, PRs changing only those release helpers no longer trigger this dry-run workflow. The same command-as-path replacement occurs in release-kt-lib.yml, release-py.yml, and release-swift-lib.yml; retain the actual source paths in all of these filters.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 40524f6: restored the real script paths in the paths: filters of release-go-ffi, release-kt-lib, release-py and release-swift-lib.

(written by Claude Opus 5.5)

Comment thread sh/gh/check-runs.ts Outdated
for (const [name, job] of Object.entries(workflow.jobs ?? {})) {
for (const step of job.steps ?? []) {
for (const line of step.run?.split("\n") ?? []) {
if (/\.sh\b/.test(line)) violations.push(`${path} (${name}): ${line.trim()}`);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Reject non-shell script paths too

When a workflow directly invokes a script with another extension, this guard still passes because it only matches .sh. There is already a concrete violation in release-brew.yml, where line 161 runs python3 ../sh/gh/install-formula.py ..., yet just gh check reports zero violations despite the new CONTRIBUTING.md rule forbidding workflow script paths. Either migrate that invocation to a recipe or make this check detect all direct script paths.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 40524f6: check-runs.ts now flags .sh, .py, .ts, .js and .mjs paths. That caught two more steps, now recipes: just gh install-formula in release-brew and just js bench in nightly.

(written by Claude Opus 5.5)

kixelated and others added 2 commits September 24, 2026 23:42
- Restore real script paths in release workflow path filters.
- Run the direnv hook test through bash; it is not executable.
- Flag .py/.ts/.js script paths too, and move the brew install-formula
  and JS broadcast benchmark steps behind recipes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated
kixelated merged commit c5000be into quest/m1/tooling/README Sep 25, 2026
15 checks passed
@kixelated
kixelated deleted the quest/m1/tooling/workflows-call-just branch September 25, 2026 06:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant