Skip to content

task: the tasks every repository has are written once, and ship with go tool task - #136

Merged
aledbf merged 2 commits into
mainfrom
task/shared-tasks
Nov 22, 2026
Merged

aledbf merged 2 commits into
mainfrom
task/shared-tasks

Conversation

@aledbf

@aledbf aledbf commented Nov 22, 2026 •

Copy link
Copy Markdown
Member

Why

The maintenance tasks every spin-stack repository has (versions, bump, release, lint:workflows, consumers) should mean the same thing everywhere, without depending on how a prompt was worded that day. Today each repository types them again: bump takes VERSION= in go-tools and shipset and TO= in spin, a release is three tasks here and a copied naming rule in brand (spin-stack/brand#54), and five repositories with a versions.yaml have no versions task at all.

This is the first PR of #135: the shared Taskfile shipped with go tool task, and the two commands brand had to copy.

What changed

  • cmd/task/tasks.yml, the common tasks, one name and one contract each. release:build puts it in every platform's archive beside the commands it calls, and cmd/task names the unpacked copy in GO_TOOLS_TASKS. A repository writes one include and commits no copy:

    includes:
      common:
        taskfile: '{{.GO_TOOLS_TASKS}}'
        flatten: true
        vars: {GATE_WORKFLOW: ci.yml, GATE_JOBS: Gate}
    task contract
    versions versions check over every file in VERSIONS_FILES (default versions.yaml), all of them asked, exit 1 when any is behind
    bump NAME= [TO=] [FILE=] versions bump -file FILE NAME TO
    release [SHA=] fetch tags; proven release -workflow GATE_WORKFLOW -events push,pull_request -ran GATE_JOBS -also '' on main's head or SHA; name it with release; gh release create <name> RELEASE_FILES --target <sha> --latest --generate-notes
    lint:workflows actionlint at the actionlint pin, -shellcheck=, over .github and WORKFLOWS_ALSO; fails on an action used by a tag
    consumers [-- flags] fetch tags; consumers -table CONSUMERS; refused with a message when the repository has no table
  • The parameters are the include's vars: GATE_WORKFLOW, GATE_JOBS, RELEASE_FILES, VERSIONS_FILES, WORKFLOWS_ALSO, CONSUMERS. A repository that names no gate does not release, and task release says missing required variables: GATE_WORKFLOW, GATE_JOBS. Not versions.yaml: it is a list of pins, and a block that is not a pin would be a format change every reader takes. Not the Taskfile's root vars: measured below, a root var beats the command line inside an included task.

  • cmd/release replaces internal/release/cmd/releasename. release <commit> prints the next v<YYYYMMDD>.<NN> and refuses a commit a release names (brand's cmd/release). release -outputs <commit> is what release.yml reads (version=, new=, module=), unchanged. Tags that are not releases (screens-v..., v0.<day>.<n>, one-digit sequences) count for nothing.

  • cmd/consumers and package consumers, moved from brand with its tests. Two things were brand's by name and are the table's now: top-level name (the entry a consumer's versions.yaml pins this repository under) and optional scope (the npm scope whose unpinned packages are reported, brand's @fontsource). The report's fonts line is packages, -brand is -dir. Every git and gh call takes a context. consumers.Load is exported so brand's test that holds its table to its tree keeps working.

  • go-tools takes its own tasks. Its Taskfile includes the tree's cmd/task/tasks.yml with GO_TOOLS: 'go run ./cmd/' (the tree's commands, not the last release's) and no longer defines versions, bump, lint:workflows or release:publish. release.yml publishes with task release, the task everyone releases with, so it gains actions: read for proven. release:name, release:build and release:module stay go-tools' own.

  • bump takes TO=, not VERSION=.

  • Docs: site pages tasks, release, consumers; Getting started; README.

Scope

Not here: the gate that fails a repository lacking or redefining a common task (#135 item 3), and the changes to brand, shipset, spin and the others. The exact diff for each of those three is in a comment on #135.

Tradeoffs

Each candidate was run under Task 3.54.0, the version every versions.yaml pins, in throwaway repositories.

candidate what it printed verdict
include by a path from the environment, flatten: true --list shows versions, release with their descriptions beside the repository's own; task versions runs with cwd and ROOT_DIR the repository's, from a subdirectory too; include vars reach the tasks taken
same, a repository defines versions itself task: Found multiple tasks (versions) included by "common", exit 203, for every task asked what the gate will build on
same, without flatten tasks are common:versions; Task "versions" does not exist lost
two -t flags only the last file's tasks are listed; -t a,b is No Taskfile found lost
a root Taskfile in the cache that includes the repository's (go tool task -t <cache>) works with no line in the repository, but ROOT_DIR=/…/cache in the repository's own tasks, and every Taskfile here builds paths from ROOT_DIR lost
remote include not trusted by user (exit 104) without --yes; Download of … failed (exit 103) with the server gone unless --offline; its cache is .task/remote/ per checkout, apart from the release the commands come from lost

What the winner costs:

  • A Task run without go tool task has no GO_TOOLS_TASKS and says include cycle detected between Taskfile.yml <--> Taskfile.yml (exit 110), since an empty path is the Taskfile itself. A repository's go-tools commands are not on PATH there either, so nothing that worked stops working, but the message is poor. The site's page says it.
  • A root var wins over the command line inside an included task: with RELEASE_WORKFLOW: pages.yml at the root, task release RELEASE_WORKFLOW=cli.yml still ran -workflow pages.yml. Hence include vars for the parameters and TO for bump.
  • excludes: [versions] on the include lets a repository replace a task without Task refusing. The gate has to look at where each task is defined (--list-all --json gives location.taskfile), not only at Task's exit status.
  • go-tools' release notes become GitHub's generated ones (--generate-notes) where they were a fixed sentence, so that the task has no notes parameter.
  • task release asks proven again inside release.yml, which already runs only after CI succeeded. One API round, and the same refusal every repository gets.
  • github.com/BurntSushi/toml becomes a direct requirement of go-tools (it was indirect at an older pseudo-version). It has no dependencies of its own.

Blast Radius

Every repository runs go-tools' latest release through go tool task.

At the next release, for every repository, with no change of its own:

  • the archive holds tasks.yml, release and consumers beside the other commands. Nothing reads them until a Taskfile includes the file.
  • releasename was never in the archive (internal/), so nothing is removed from anyone's PATH.

What does not change until a repository acts:

  • GO_TOOLS_TASKS is set by cmd/task, which each repository compiles from its own go.mod. A repository gets it only when its go-tools requirement moves to this release's module version (the Dependabot PR). Until then its Taskfile and tasks are exactly what they are today.
  • brand keeps running its own cmd/release and cmd/consumers.

go-tools itself: release.yml changes, and it runs only on main after CI passes, so it cannot be run on this PR. If task release fails there, no release is published and no tag is made (the release makes the tag, last); the repositories go on with the previous release.

Verification

  • task lint: exit 0. task test: exit 0, 85.89% of what CI runs.
  • task mutate BASE=origin/main: 133 edits over 5 files. First run: 90 refused, 3 survived, all on one line of cmd/consumers (where, the git rev-list failure). Answered with TestAPinGitCannotCountFromIsStillPlaced. Final run: 91 refused, 0 survived, 42 did not build.
  • cmd/task/tasks_test.go runs tasks.yml under the pinned Task against fixture repositories, with the commands it calls replaced by recorders: a repository whose Taskfile is only the include lists exactly the five tasks, from a subdirectory too; GATE_WORKFLOW, GATE_JOBS and RELEASE_FILES reach proven and gh release create; SHA, GH_TOKEN and GITHUB_REPOSITORY are taken from a workflow's environment; a commit proven refuses is not named or released; a repository with no gate is refused before anything runs; one that redefines versions is refused for every task; a tagged action fails lint:workflows in either directory; go-tools' own Taskfile takes all five from tasks.yml.
  • Run by hand in this tree: proven release -repo spin-stack/go-tools -sha <main> -workflow ci.yml -events push,pull_request -ran Gate -also '' answered ci.yml passed on 38fdcbc…'s tree; release HEAD answered HEAD is released already, as v20261122.03 and release -outputs HEAD the three lines release.yml reads; task versions asked all three files and exited 1 on the one that is behind (sfw-linux-amd64 1.15.4 → 1.16.0); task lint:workflows exit 0.
  • task release:build: exit 0, and go-tools_linux_amd64.tar.gz holds tasks.yml, release and consumers. A scratch repository whose Taskfile is only the include, run under the pinned Task with that archive unpacked on PATH and named in GO_TOOLS_TASKS, lists the five tasks from a subdirectory, runs versions against the real upstreams (exit 0), and refuses release (missing required variables: GATE_WORKFLOW, GATE_JOBS) and consumers (no consumers.toml).
  • Not verified: release.yml itself, which first runs on main, and gh release create with the run's token.

Part of #135

🤖 Generated with Claude Code

aledbf and others added 2 commits November 22, 2026 12:36
…t is on

brand wrote this for itself (spin-stack/brand#54): a consumers.toml naming who copies
its stylesheets and marks, and a command that reads each one's pin, copies and faces.
The question is every repository's whose outputs are copied, so the command is here
and brand keeps only its table.

What was brand's by name is the table's now: `name`, what a consumer's versions.yaml
calls the repository, and `scope`, the npm scope whose packages are its to pin
(brand's @fontsource). The report's "fonts" line is "packages". The table is read by
the consumers package, so a repository's own test can hold its table to its tree.

Part of #135

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…go tool task

versions, bump, release and lint:workflows were typed again in each repository, a
little differently each time: bump took VERSION= here and TO= in spin, a release was
three tasks here and a copied naming rule in brand (spin-stack/brand#54). They are
cmd/task/tasks.yml now, with consumers. The release archive carries the file beside
the commands it calls, and go tool task names the unpacked copy in GO_TOOLS_TASKS,
so a repository's Taskfile takes it in one flattened include and commits no copy.
What differs between repositories is the include's vars: the gate's workflow and
jobs, the files a release carries, where the consumers table is.

An include by an environment path won over the others by what each did under the
pinned Task 3.54.0. Two -t flags: the last one is the only Taskfile. A root Taskfile
in the cache that includes the repository's: ROOT_DIR is the cache. A remote
Taskfile: a trust prompt, a download on every run, a cache per checkout. With the
flattened include a repository that defines a common name is refused by Task
("Found multiple tasks").

The release name is a command, cmd/release, where internal/release/cmd/releasename
was go-tools' alone: `release <commit>` is the next name and refuses a commit
released already, `release -outputs` is what release.yml reads. This repository
includes its tree's tasks.yml with its tree's commands and writes none of those
tasks: release.yml publishes with `task release`, the task every repository
releases with, which asks proven of the gate first - hence actions: read. bump's
version is TO=, since a Taskfile's own VERSION answers before the command line's in
an included task.

Part of #135

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@aledbf
aledbf merged commit ede9302 into main Nov 22, 2026
3 checks passed
@aledbf
aledbf deleted the task/shared-tasks branch November 22, 2026 15:50
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