docs(adr): record ADR-0033 plugin release tags as <plugin>-v<version>
Every plugin version on main gets an annotated <plugin>-v<version> tag, cut by scripts/tag-plugin-releases.sh after merge. No hook can enforce it: merges via Gitea run no local hook, and pre-commit skips a pushed tag on an already-pushed commit, so tagging is a maintainer step. ADR-0024 gains a forward note that its rejected option 2, ground 2, is now addressed; gates.md explains why tagging is not a gate, and README lists the maintainer's post-merge steps. Refs: #223 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_014uGZTNugst7K9Bd2FTR4Mi
This commit is contained in:
1 parent
bc53b98d61
commit
32d81b32d2
4 files changed
+168
No files matched your search
@@ -99,6 +99,15 @@ See [`docs/spec/gates.md`](docs/spec/gates.md) for what each hook enforces and w
|
|||||||
|
|
||||||
Full model, including what's exempt and why: [`docs/spec/architecture.md`](docs/spec/architecture.md).
|
Full model, including what's exempt and why: [`docs/spec/architecture.md`](docs/spec/architecture.md).
|
||||||
|
|
||||||
|
**After merging a plugin version bump (maintainer):**
|
||||||
|
|
||||||
|
1. Run `git fetch origin --tags`.
|
||||||
|
2. Run `scripts/tag-plugin-releases.sh` (a dry run) and read the table.
|
||||||
|
3. Run `scripts/tag-plugin-releases.sh --apply`.
|
||||||
|
4. Run the `git push origin <tag>…` line it prints.
|
||||||
|
|
||||||
|
Pushing tags is the maintainer's step. Tags are never moved or re-cut. Details are in [ADR-0033](docs/adr/0033-plugin-releases-are-tagged-plugin-v-version.md).
|
||||||
|
|
||||||
## For external consumers
|
## For external consumers
|
||||||
|
|
||||||
Consume the packages through apm, the way this repo does — declare them as `dependencies.apm` git+path entries against the holocron remote and run `apm install`. apm is the only supported install path.
|
Consume the packages through apm, the way this repo does — declare them as `dependencies.apm` git+path entries against the holocron remote and run `apm install`. apm is the only supported install path.
|
||||||
|
|||||||
@@ -140,6 +140,10 @@ Rejected on three grounds, stacking:
|
|||||||
natively and reports zero skills, which is precisely the ADR-0017 defect, reintroduced on the
|
natively and reports zero skills, which is precisely the ADR-0017 defect, reintroduced on the
|
||||||
release path where it is hardest to notice.
|
release path where it is hardest to notice.
|
||||||
|
|
||||||
|
> **Forward note (2026-11-27): ground 2 is addressed by ADR-0033.** Every plugin version on `main`
|
||||||
|
> is now tagged `<plugin>-v<version>`, so the per-package tagging convention exists. This rejection
|
||||||
|
> still stands on grounds 1 and 3, which are unchanged.
|
||||||
|
|
||||||
**Also delete the marketplace catalogue (proposed, then rejected on evidence).** The initial shape
|
**Also delete the marketplace catalogue (proposed, then rejected on evidence).** The initial shape
|
||||||
of this decision deleted `.claude-plugin/marketplace.json` along with everything else, on the
|
of this decision deleted `.claude-plugin/marketplace.json` along with everything else, on the
|
||||||
reasoning that it is a Claude Code artifact. That is wrong. `apm marketplace add` probes
|
reasoning that it is a Claude Code artifact. That is wrong. `apm marketplace add` probes
|
||||||
|
|||||||
@@ -0,0 +1,135 @@
|
|||||||
|
# Every plugin version on `main` is tagged `<plugin>-v<version>`, cut by script after merge
|
||||||
|
|
||||||
|
**Status: accepted (2026-11-27).**
|
||||||
|
|
||||||
|
## Context
|
||||||
|
|
||||||
|
Issue #223. Consumers that pin a holocron package need a git tag per package version. Two consumers
|
||||||
|
are known, and both read the same tag shape:
|
||||||
|
|
||||||
|
- **Renovate's `apm` manager** (≥ 44.153.0) looks up a dependency on a `plugins/<name>` subpath
|
||||||
|
through the `git-tags` datasource. It considers only tags of the form `<prefix>-v<x.y.z>`.
|
||||||
|
- **`apm outdated`** matches the tag pattern `{name}-v{version}`. This was verified with apm 0.28.0
|
||||||
|
against a synthetic repo, and `apm_cli/marketplace/tag_pattern.py` lists `{name}-v{version}`
|
||||||
|
among its patterns.
|
||||||
|
|
||||||
|
The repo's existing tags are repo-level (`v1.0.0`, `v2.0.0`, `v2.0.1`). They match no package,
|
||||||
|
because the eleven plugins are versioned independently, each in its own `apm.yml`. ADR-0024
|
||||||
|
rejected a release-time mirror partly on this ground (its rejected option 2, ground 2): "the
|
||||||
|
tagging convention that would make ref-pinning meaningful would have to be invented first". This
|
||||||
|
ADR defines that convention.
|
||||||
|
|
||||||
|
Two facts limit where enforcement can live:
|
||||||
|
|
||||||
|
- **There is no CI.** Every gate here is a git hook on a developer's machine (ADR-0024, option 2,
|
||||||
|
ground 3).
|
||||||
|
- **Merges run no hook.** A PR merged with Gitea's merge button runs no local hook at all, so
|
||||||
|
nothing fires at the moment a version lands on `main`.
|
||||||
|
|
||||||
|
## Decision
|
||||||
|
|
||||||
|
**Every version a plugin ships on `main` gets an annotated tag `<plugin>-v<version>`.**
|
||||||
|
|
||||||
|
- **Name.** `<plugin>` is the directory under `plugins/` and must equal that `apm.yml`'s `name`.
|
||||||
|
`<version>` is the strict `MAJOR.MINOR.PATCH` from the same file. Example: `git-v1.3.9`. The
|
||||||
|
repo-level `v*` tags stay as they are.
|
||||||
|
- **Target.** The tag goes on the oldest commit, in `main`'s first-parent history, of the
|
||||||
|
contiguous run carrying that version. That is the merge or squash commit where the version first
|
||||||
|
landed on `main`, never a feature-branch commit. An `apm.yml` edit that leaves `version:` alone
|
||||||
|
does not start a new run.
|
||||||
|
- **Immutability.** Tags are never moved, overwritten or silently re-cut. A tag that is lightweight
|
||||||
|
or that peels to the wrong commit is reported as an error for a human to resolve.
|
||||||
|
- **Mechanism.** `scripts/tag-plugin-releases.sh` computes the targets from `origin/main`'s
|
||||||
|
history and cuts the tags after merge. Without arguments it is a dry run: it prints a
|
||||||
|
`plugin version commit status` table and exits 1 if any tag is missing. `--apply` creates the
|
||||||
|
missing tags locally, and only when no error exists anywhere (all or nothing). It then prints the
|
||||||
|
exact `git push origin <tag>…` line, naming each tag explicitly and never using `--tags`. The
|
||||||
|
script never fetches and never pushes. No hook gates any of this.
|
||||||
|
- **Which versions are wanted.** If a plugin already has a `<plugin>-v*` tag reachable from
|
||||||
|
`main`, the script wants every version run from the newest such tag onward. If it has none, the
|
||||||
|
script wants only the current run. That second rule is the backfill: older history is not
|
||||||
|
tagged retroactively.
|
||||||
|
- **One deliberate exception to the backfill: git's previous version, `git-v1.3.8`, is also
|
||||||
|
tagged**, on `32fbe39fb8923854ca8e743a0d2cad81720c736c`, where 1.3.8 first landed on `main`. This
|
||||||
|
gives a consumer pinned to an older git tag something real to check `apm outdated` against. It is
|
||||||
|
a one-off, cut by hand or with `--ref`. After it, the "from the newest tag onward" rule covers
|
||||||
|
git like every other plugin.
|
||||||
|
- **Pushing a release tag is a maintainer-only action. It is not a Propose-tier push under
|
||||||
|
ADR-0032.** ADR-0032's Propose tier ("branch, commit, push, open a PR, comment") covers pushes
|
||||||
|
that propose a change for review: a human still approves the change before it merges. A tag push
|
||||||
|
has no review step behind it. It publishes a release that consumers pin, and because tags are
|
||||||
|
immutable it cannot be quietly taken back. An agent may run the dry run, and may run `--apply`
|
||||||
|
only when a maintainer asks it to. The push itself is always the maintainer's.
|
||||||
|
- **Wiring elsewhere:**
|
||||||
|
- Root `apm.yml`'s `marketplace.build.tagPattern` is `{name}-v{version}`.
|
||||||
|
- `docs/agents/delivery.md` lists the script's dry run under Conventions as a post-merge check.
|
||||||
|
It does not go under Post-merge checks, because that section accepts only forge status names
|
||||||
|
and the repo has no CI.
|
||||||
|
- `AGENTS.md` carries the agent-facing rule and cites this ADR.
|
||||||
|
|
||||||
|
## Considered options
|
||||||
|
|
||||||
|
**A pre-push hook that fails while any `main` version is untagged (rejected).**
|
||||||
|
|
||||||
|
- After every version-bump merge it would block every contributor's next push, on any branch,
|
||||||
|
until someone tagged.
|
||||||
|
- It would read `origin/main` as last fetched, so a stale clone would get a stale verdict.
|
||||||
|
- A tag that exists only locally and was never pushed would satisfy it.
|
||||||
|
- An agent's only way past it would be `SKIP=` or `--no-verify`, which ADR-0032 puts in the Never
|
||||||
|
tier.
|
||||||
|
|
||||||
|
**A pre-push hook that runs when the tag is pushed (rejected).** pre-commit never invokes hooks for
|
||||||
|
exactly this push. In pre-commit 4.6.1, `_pre_push_ns` in `pre_commit/commands/hook_impl.py`
|
||||||
|
(lines 128–174) walks the pushed refs:
|
||||||
|
|
||||||
|
- A new tag has an all-zero remote sha, so the remote-sha branch (`:133`) does not apply.
|
||||||
|
- It then runs `git rev-list <local_sha> --not --remotes=origin` (`:143–146`). A tag on a commit
|
||||||
|
that is already on the pushed `main` lists nothing, so the ref is skipped (`:147–148`).
|
||||||
|
- With nothing left, the function returns `None` (`:174`), and `_run_ns`'s caller returns without
|
||||||
|
running any hook (`:272–273`).
|
||||||
|
|
||||||
|
So a hook on tag push would never fire for the one push it exists to check.
|
||||||
|
|
||||||
|
**A warn-only hook (rejected).** A warning that appears on every push after a merge, and that the
|
||||||
|
person pushing usually cannot act on, is noise people learn to ignore.
|
||||||
|
|
||||||
|
**A step in the `gitea-releases` skill (rejected).** `gitea-releases` is a generic shipped plugin
|
||||||
|
skill, used by consumers with their own tagging schemes. This is holocron's release policy, and it
|
||||||
|
belongs in holocron's own docs and script.
|
||||||
|
|
||||||
|
**A review-held checklist item alone (rejected).** Review happens before merge, but the tag can
|
||||||
|
only be cut after merge, once the target commit exists on `main`. A checklist in review cannot
|
||||||
|
check something that does not exist yet.
|
||||||
|
|
||||||
|
## Consequences
|
||||||
|
|
||||||
|
**1. An untagged window is accepted.** Between a merge and the maintainer's next tagging run, the
|
||||||
|
new version has no tag. Consumers' pins lag behind, but nothing breaks. Lateness also heals itself:
|
||||||
|
targets are computed from history rather than taken from the checkout, so a run made days later
|
||||||
|
cuts the same tags on the same commits.
|
||||||
|
|
||||||
|
**2. The root catalogue's version is not tagged per plugin.** Only the `plugins/<name>/apm.yml`
|
||||||
|
versions get `<plugin>-v*` tags. The marketplace catalogue's own version is out of scope.
|
||||||
|
|
||||||
|
**3. Renovate consumers on this Gitea need an `overridePackageName` rule until upstream fixes
|
||||||
|
it.** On hosts other than GitHub and GitLab, Renovate's apm manager does not strip `/plugins/<name>`
|
||||||
|
from the package URL (`lib/modules/manager/apm/extract.ts`, `resolveRepoPath`), so its `git-tags`
|
||||||
|
lookup targets a repo that does not exist. A consumer-side `packageRules` entry along these lines
|
||||||
|
rewrites it. **It is untested.**
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"matchManagers": ["apm"],
|
||||||
|
"matchDatasources": ["git-tags"],
|
||||||
|
"matchPackageNames": ["/\\/plugins\\/[^/]+$/"],
|
||||||
|
"overridePackageName": "{{{replace '/plugins/[^/]+$' '' packageName}}}"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
**4. Gitea's `create_tag` is an equivalent way to cut a tag**, provided `git cat-file -t <tag>`
|
||||||
|
reports `tag` after fetching. That confirms it is annotated; the script reports a lightweight tag
|
||||||
|
as an error.
|
||||||
|
|
||||||
|
**5. Enforcement is by convention for now.** Nothing fails when a maintainer forgets to tag. A
|
||||||
|
`post-merge:` assertion that the verify stage checks on version-bump PRs is the natural next step
|
||||||
|
and is left as future work.
|
||||||
@@ -1340,6 +1340,26 @@ checks fail offline, with `deployed-files-present` already failing for the same
|
|||||||
`apm-audit-ci` above). The offline guarantee is a property of a populated `apm_modules/`, not of the
|
`apm-audit-ci` above). The offline guarantee is a property of a populated `apm_modules/`, not of the
|
||||||
hook set: run `apm install` once on a new checkout and it holds from then on.
|
hook set: run `apm install` once on a new checkout and it holds from then on.
|
||||||
|
|
||||||
|
## Plugin release tags are not a gate
|
||||||
|
|
||||||
|
Every plugin version on `main` gets an annotated `<plugin>-v<version>` tag (ADR-0033). No hook
|
||||||
|
checks for it, for two reasons:
|
||||||
|
|
||||||
|
- **Nothing runs at the right moment.** A version lands on `main` by merge, and Gitea's merge
|
||||||
|
button runs no local hook. A pre-push hook that failed on untagged versions would instead block
|
||||||
|
every contributor's next push, and an agent's only way past it would be `SKIP=` or
|
||||||
|
`--no-verify`, which ADR-0032 forbids.
|
||||||
|
- **A hook on the tag push never fires.** pre-commit 4.6.1's `_pre_push_ns` skips a pushed ref
|
||||||
|
whose remote sha is all zeros and that has no commits outside `--remotes=origin`. That is exactly
|
||||||
|
a new tag on an already-pushed `main` commit, so no hook runs.
|
||||||
|
|
||||||
|
Tagging is a maintainer step after merge instead. After `git fetch origin --tags`, run
|
||||||
|
`scripts/tag-plugin-releases.sh` (a dry run; it exits 1 while tags are missing), then `--apply`,
|
||||||
|
then push the tags it names.
|
||||||
|
|
||||||
|
See also: `docs/adr/0033-plugin-releases-are-tagged-plugin-v-version.md`,
|
||||||
|
`scripts/tag-plugin-releases.sh`.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## See also
|
## See also
|
||||||
|
|||||||
Reference in new issue
Block a user