Skip to content

feat(version): derive per-component versions from path-scoped commits and strict tag namespaces - #516

Merged
joshua-temple merged 1 commit into
mainfrom
feat/component-versioning
Jul 8, 2026
Merged

joshua-temple merged 1 commit into
mainfrom
feat/component-versioning

Conversation

@joshua-temple

Copy link
Copy Markdown
Collaborator

Problem

F-stage generation emits per-component orchestrate workflows, but each still ran an identical repo-wide orchestrate setup, so every component computed the same version. Per-component versioning needs each component's version derived from its own path and tag namespace, in isolation.

Fix

  • git.GetCommitsForPaths scopes the commit range to a component's path (a commit under services/api/** is invisible to another component's range).
  • git.GetLatestTagSpec validates candidate tags against the component's strict taggrammar spec, so api-* never reads web-*; GetLatestTag stays a permissive wrapper (byte-identical).
  • ResolvedComponent.TagGrammarSpec / TrunkConfig.GetComponentTagPrefix force the strict prefix; orchestrate.calculateComponentVersion and version.componentVersionInputs scope commits to the path and tags to the strict spec, selected via WithComponent / --component.
  • Component workflows emit --component <name>; an empty component keeps the single-component path byte-identical.

Closes #287; completes the versioning half of #288 (the structural fan-out shipped in #514).

Verification

go build ./..., go test ./... (2573 pass), go test -race on changed packages (1364 pass), golangci-lint run ./... clean; e2e module build+vet clean. Single-component byte-identical baseline gate green. New e2e scenario 45-component-versioning.yaml (Per-Component Version Scoping) passes locally in the act+gitea harness (28.5s). Per-component version isolation is proven by fast Go tests (internal/git, internal/orchestrate, internal/version).

Refs #287, #288.

… and strict tag namespaces

Each component now computes its own version from commits under its path and its own strict tag namespace, so one component's tags and commits never influence another's. GetCommitsForPaths scopes the commit range to a component path; GetLatestTagSpec validates candidate tags against the component's strict taggrammar spec (GetLatestTag stays a permissive wrapper, byte-identical). Component workflows pass --component so orchestrate and version compute the scoped version; an empty component keeps the single-component path byte-identical. This closes the versioning half that F-stage generation left component-blind (every per-component workflow previously ran an identical repo-wide setup).

Refs #287, #288.

Signed-off-by: Joshua Temple <joshua.temple@stablekernel.com>
@joshua-temple
joshua-temple merged commit 74a398a into main Jul 8, 2026
20 checks passed
@joshua-temple
joshua-temple deleted the feat/component-versioning branch July 8, 2026 04:55
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.

compute each component's version from its own paths and tags

1 participant