feat(version): derive per-component versions from path-scoped commits and strict tag namespaces - #516
Merged
Merged
Conversation
… 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.GetCommitsForPathsscopes the commit range to a component'spath(a commit underservices/api/**is invisible to another component's range).git.GetLatestTagSpecvalidates candidate tags against the component's stricttaggrammarspec, soapi-*never readsweb-*;GetLatestTagstays a permissive wrapper (byte-identical).ResolvedComponent.TagGrammarSpec/TrunkConfig.GetComponentTagPrefixforce the strict prefix;orchestrate.calculateComponentVersionandversion.componentVersionInputsscope commits to the path and tags to the strict spec, selected viaWithComponent/--component.--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 -raceon changed packages (1364 pass),golangci-lint run ./...clean; e2e module build+vet clean. Single-component byte-identical baseline gate green. New e2e scenario45-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.