Repository navigation
Generate the mise tasks from the build targets - #4829
Conversation
`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]>
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]>
| run: mise run serve --help | ||
|
|
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
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]>
Docs preview (local build)Handbook preview: https://docs-v3-preview.elastic.dev/elastic/docs-builder/pull/4829/ Sample changed pages: |
Most
mise runtasks are now generated from the targets of the F# build, somise run testand./build.sh testare the same command andmise.tomlno 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.tomllisted 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 --helplisted only part of what mise could do. The generated include removes the second list.What
Generated include
mise.tomlhas[task_config] includes = [".make/mise-tasks.toml"]. Themise installhook runs__wrappers syncto write that file, a[[watch_files]]hook regenerates it after abuild/*.fsedit, and.make/is gitignored. Each generated task forwards todotnet run --project build -c release -- <target>and carries ausagespec, so mise completes the target's flags.New targets
setup,serve(arguments after--go todocs-builder serve),schemaand thesitenamespace (site:installrunsnpm cionly whenpackage-lock.jsonis newer thannode_modules, and the othersite:tasks run it first).schemawrites the captured output as it is, sodocs/cli-schema.jsonstays byte-identical.Names
Every task name is kept except
setup:tools, whichsetupnow does.lintis a visible target,formatisfmt, andunit-testandair-gapped-*appear as tasks.mise run teststill runs the unit tests:./build.sh testnow defaults to--suite unit, where it used to default toall.CI check
The
mise-tasksjob inci.ymlrunsmise install, then checks thatsite:check,test,serveandversionare each listed, thatversionruns the build target, that an option reaches it (test --suite nonsensefails with the target's own error) and thatsite:checkruns. The other jobs call dotnet and npm directly, so only this one covers the generated tasks.What stays
mise run buildis a one-line override that runs thecompiletarget (release configuration): thebuildtarget cleans and lints first, which is too slow for a compile check. Thesnap:*andjourneys:*tasks stay inmise.tomlunchanged until nullean/argh#142 lets a namespaced target take options; the typed versions are written and wait for that fix.Breaking:
mise run buildnow builds the release configuration of thecompiletarget instead of runningdotnet build(debug), and./build.sh testruns only the unit tests unless--suite allis given. A clone has notest,lintand other generated tasks untilmise installhas run once.Verify