Skip to content

feat: configurable tag_grammar manifest block, wiring, and release-path sinks - #500

Merged
joshua-temple merged 17 commits into
mainfrom
feat/release-path-sinks
Jul 7, 2026
Merged

joshua-temple merged 17 commits into
mainfrom
feat/release-path-sinks

Conversation

@joshua-temple

Copy link
Copy Markdown
Collaborator

Problem

A repo cascade drives cannot declare a non-default release-tag grammar. The tag shape (vX.Y.Z, -rc.N, .hotfix.M, -dryrun.N) was hardcoded across parser, git predicate, promote, generator, and hotfix sinks. Closes #434.

Fix

Add an optional, additive tag_grammar manifest block (schema_version stays 1) resolved to the single-source internal/taggrammar spec (added in #498/#499) and threaded through every runtime and generation sink. A nil/absent block reproduces today's grammar byte-identically, so existing repos are unaffected.

  • Config: tag_grammar block (prefix, prerelease_token, prerelease_separator, dryrun_token, strict_prefix), ResolveTagGrammar(), hard structural validation (git-ref-safe chars, non-empty token, dryrun token distinct from prerelease token), and a non-fatal redundancy advisory when both tag_prefix and tag_grammar.prefix are set (block wins).
  • Wiring: orchestrate and cascade next-version resolve and honor the same spec, so discovery and emission share one grammar.
  • Read tolerance: foreign prereleases (beta.1, rc1) and build metadata (+build.5) are recognized on read so a repo is not invisible to discovery; cascade never emits those shapes.
  • Release-path sinks: promote strips the prerelease and enforces monotonicity via the spec; the generated release workflow bakes a spec-derived sed strip pattern at generation time; hotfix allocation and cleanup parse under the configured token.
  • cascade's own self-release shell stays pinned to the default grammar (documented).

Verification

  • go build ./..., go test ./..., go test ./... -race, golangci-lint run ./... all clean.
  • Zero drift in cascade's own generated workflows (default output byte-identical).
  • New e2e scenario 48-tag-grammar-custom-release-promote drives a release and promotion under prerelease_token: beta, prerelease_separator: "" and asserts the custom-shaped tags, recorded state, and post-publish token strip.
  • Docs build clean (npm run build, 23 pages).

Docs

Manifest reference (the block, extensibility note vs version constraints), cli reference (next-version honors the grammar), versioning explainer, README mention, CONTRIBUTING single-canonical-source standard, and the coverage-matrix row all land in this PR.

Signed-off-by: Joshua Temple <joshua.temple@stablekernel.com>
…ommand

Signed-off-by: Joshua Temple <joshua.temple@stablekernel.com>
Signed-off-by: Joshua Temple <joshua.temple@stablekernel.com>
Signed-off-by: Joshua Temple <joshua.temple@stablekernel.com>
Signed-off-by: Joshua Temple <joshua.temple@stablekernel.com>
Signed-off-by: Joshua Temple <joshua.temple@stablekernel.com>
Explain that the hotfix segment's prefix, prerelease token, and
separator come from the resolved tag_grammar (default v/rc/.), add a
Tag grammar subsection covering read tolerance and the clean-boundary
rule, and cross-link the manifest reference.

Signed-off-by: Joshua Temple <joshua.temple@stablekernel.com>
Three docs stated the rc suffix as an unconditional rule (orchestrate
output, promote's boundary, the hotfix short form). Qualify each as
the default and link to tag_grammar. internals/release-orchestration.md
and simulate-and-verify.md were swept too: their rc/dryrun mentions
describe cascade's own pinned self-release process or are illustrative
examples, so they are left as-is.

Signed-off-by: Joshua Temple <joshua.temple@stablekernel.com>
Add a Capabilities row noting the release-tag grammar (prefix,
prerelease token, separator) is configurable via tag_grammar, with an
omitted block reproducing the historical shape. Full field reference
stays in the docs site.

Signed-off-by: Joshua Temple <joshua.temple@stablekernel.com>
Codify internal/taggrammar as the one place a release-tag shape is
defined, so no tag sink (parser, git predicate, promote strip,
generated template, hotfix) hand-copies a regex or format string
instead of deriving from the resolved spec.

Signed-off-by: Joshua Temple <joshua.temple@stablekernel.com>
… grammar

Signed-off-by: Joshua Temple <joshua.temple@stablekernel.com>
Signed-off-by: Joshua Temple <joshua.temple@stablekernel.com>
… cleanup

Signed-off-by: Joshua Temple <joshua.temple@stablekernel.com>
Signed-off-by: Joshua Temple <joshua.temple@stablekernel.com>
@github-actions

github-actions Bot commented Jul 7, 2026 •

Copy link
Copy Markdown
Contributor

All PR Validation checks passed.

…racters

Signed-off-by: Joshua Temple <joshua.temple@stablekernel.com>
Signed-off-by: Joshua Temple <joshua.temple@stablekernel.com>
…ammar

Signed-off-by: Joshua Temple <joshua.temple@stablekernel.com>
@joshua-temple
joshua-temple merged commit d61d641 into main Jul 7, 2026
20 checks passed
@joshua-temple
joshua-temple deleted the feat/release-path-sinks branch July 7, 2026 03:37
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.

configurable tag grammar for cascade's own release tags

1 participant