Skip to content

Generate the mise tasks from the build targets - #4829

Merged
Mpdreamz merged 6 commits into
mainfrom
chore/mise-tasks-from-build
Nov 12, 2026
Merged

Mpdreamz merged 6 commits into
mainfrom
chore/mise-tasks-from-build

Conversation

@Mpdreamz

@Mpdreamz Mpdreamz commented Nov 12, 2026 •

Copy link
Copy Markdown
Member

Most mise run tasks are now generated from the targets of the F# build, so mise run test and ./build.sh test are the same command and mise.toml no longer holds a second list.

Affects: Automation

Prompt summary: Make the mise tasks run real Nullean.Make.Fs targets, using the argh feature that syncs mise tasks from them, with the build written as Proc.Fs shell { } blocks. This is PR 3 of 3, after #4823, #4824 and #4825.

Why

mise.toml listed 31 tasks. Nine called the build project and the rest ran their own commands, so a task's logic lived in two places and ./build.sh --help listed only part of what mise could do. The generated include removes the second list.

What

Generated include

mise.toml has [task_config] includes = [".make/mise-tasks.toml"]. The mise install hook runs __wrappers sync to write that file, a [[watch_files]] hook regenerates it after a build/*.fs edit, and .make/ is gitignored. Each generated task forwards to dotnet run --project build -c release -- <target> and carries a usage spec, so mise completes the target's flags.

New targets

setup, serve (arguments after -- go to docs-builder serve), schema and the site namespace (site:install runs npm ci only when package-lock.json is newer than node_modules, and the other site: tasks run it first). schema writes the captured output as it is, so docs/cli-schema.json stays byte-identical.

Names

Every task name is kept except setup:tools, which setup now does. lint is a visible target, format is fmt, and unit-test and air-gapped-* appear as tasks. mise run test still runs the unit tests: ./build.sh test now defaults to --suite unit, where it used to default to all.

CI check

The mise-tasks job in ci.yml runs mise install, then checks that site:check, test, serve and version are each listed, that version runs the build target, that an option reaches it (test --suite nonsense fails with the target's own error) and that site:check runs. The other jobs call dotnet and npm directly, so only this one covers the generated tasks.

What stays

mise run build is a one-line override that runs the compile target (release configuration): the build target cleans and lints first, which is too slow for a compile check. The snap:* and journeys:* tasks stay in mise.toml unchanged until nullean/argh#142 lets a namespaced target take options; the typed versions are written and wait for that fix.

Breaking: mise run build now builds the release configuration of the compile target instead of running dotnet build (debug), and ./build.sh test runs only the unit tests unless --suite all is given. A clone has no test, lint and other generated tasks until mise install has run once.

Verify

mise install                 # writes .make/mise-tasks.toml
mise tasks                   # the same names as before, plus unit-test and air-gapped-*
mise run test --parallelism 4
mise run schema && git diff --exit-code docs/cli-schema.json
mise run site:check

`mise.toml` included `.make/mise-tasks.toml`, which `mise install` writes with `__wrappers sync` and git ignores, so each task is a call of the F# build target of the same name. The `site` namespace and `setup`, `serve` and `schema` become targets, `lint` is visible, `format` is `fmt`, and `test` runs the unit tests by default.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@Mpdreamz
Mpdreamz requested a review from a team as a code owner November 12, 2026 10:10
@Mpdreamz Mpdreamz added the automation packaging, ci/cd. label Nov 12, 2026
@Mpdreamz
Mpdreamz requested a review from technige November 12, 2026 10:10
Comment thread build/Targets.fs Resolved
Comment thread build/Targets.fs Resolved
Comment thread mise.toml Resolved
Comment thread mise.toml Resolved
Mpdreamz and others added 2 commits November 12, 2026 11:15
The test suite default is documented as unit, the frontend install holds a file lock so parallel tasks cannot run npm ci on the same node_modules, the postinstall and watch hooks share one sync-tasks task, and CI exercises the generated mise tasks.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
zizmor's blanket policy requires third-party actions to be hash-pinned.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Comment thread .github/workflows/ci.yml Resolved
Comment thread .github/workflows/ci.yml Outdated
Comment on lines +120 to +121
run: mise run serve --help

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Severity: P3 (Low)

This does not test argument forwarding: --help is handled by mise using the generated task usage, without executing the serve target. The earlier test --help check likewise only validates generated help, so wrappers that drop options or rest arguments can still pass this job. Add an invocation that actually reaches the underlying command and assert on its output.

Generated by Libra. React with 👍 or 👎 to give feedback on this comment.

@Mpdreamz Mpdreamz Nov 12, 2026 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Keeping the check: the mise-tasks job is restored in 95bca16. It is the only coverage of fresh-clone generation, task discovery and argument forwarding, because the other jobs call dotnet and npm directly.

Mpdreamz and others added 3 commits November 12, 2026 11:22
The job installed mise and checked the generated tasks on every code change. It passed on its first run and guards a path that only local development uses, so it is not worth the minutes.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
The other jobs call dotnet and npm directly, so they pass even when `mise install` stops producing usable tasks. The job is the only coverage of fresh-clone generation, task discovery and argument forwarding.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@github-actions

Copy link
Copy Markdown
Contributor

@Mpdreamz
Mpdreamz merged commit bd4f92e into main Nov 12, 2026
45 checks passed
@Mpdreamz
Mpdreamz deleted the chore/mise-tasks-from-build branch November 12, 2026 10:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automation packaging, ci/cd.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant