Skip to content

feat: Atmos Version Tracker β€” managed version tracks with lock file - #2688

Merged
Erik Osterman (Cloud Posse) (osterman) merged 46 commits into
osterman/atmos-yaml-schema-splitfrom
osterman/atmos-version-lock-ci
Jul 7, 2026
Merged

Erik Osterman (Cloud Posse) (osterman) merged 46 commits into
osterman/atmos-yaml-schema-splitfrom
osterman/atmos-version-lock-ci

Conversation

@osterman

@osterman Erik Osterman (Cloud Posse) (osterman) commented Jul 4, 2026 •

Copy link
Copy Markdown
Member

Note

Stacked on #2664 (osterman/atmos-yaml-schema-split) β€” this PR's base is that branch so the diff shows only Version Tracker changes. Retarget to main after #2664 merges.

Draft: resolver/manager foundations are in; remaining phases (digest pinning, OCI resolver, update-policy enforcement, file managers with apply --check, CRUD verbs, PRD/docs/blog/roadmap, CI demonstration workflow) land on this branch before marking ready.

what

  • Introduce the Atmos Version Tracker: manage external dependency versions as first-class Atmos configuration β€” declared in atmos.yaml, resolved deterministically into a committed versions.lock.yaml, and consumed at runtime.
  • Version catalog schema under version: in atmos.yaml: providers, defaults, groups (Dependabot/Renovate-style batches with match rules), and tracks (named version lanes such as dev/staging/prod, with extends inheritance); policy merges global defaults β†’ track defaults β†’ entry β†’ matched group.
  • New atmos version track command group (alias: tracks): list, show, lock, update, status, diff, verify (CI gate), and render (render a template file with locked .version values, --check for drift). Track selection falls back positional arg β†’ --track β†’ version.track config.
  • Runtime consumption: !version <name> YAML function and {{ .version.<name> }} template context, resolved from the lock file only (no network at stack-processing time); stacks assert their lane with version.track.
  • Datasource resolver registry (pkg/version/resolver): pluggable Resolver interface (Versions/Pin) with init-time registration and ecosystem aliases. Implemented resolvers: toolchain (Aqua registry), github-tags and github-releases (via pkg/github; tags carry commit SHAs, releases carry publish timestamps for future cooldown checks).
  • Version selection supports latest, SemVer constraints (~1.10, >= 1.2, < 2), and concrete pins, with allow (prerelease gating) and ignore (glob/substring) rules, built on the updatecli versionfilter engine.
  • pkg/github.ListTags: paginated tag listing with commit SHAs, sharing the existing token chain and rate-limit handling.

why

  • Teams pin external versions (GitHub Actions refs, image tags, tool versions) in many places with no single source of truth, no deterministic locking, and no policy for how updates advance; this brings Renovate/Dependabot-style capabilities into the Atmos model (policy in atmos.yaml, resolved state in a lock file, tracks per environment) without integrating with or generating those tools' configs.
  • Deterministic runtime: applying stacks reads only the committed lock file, so version resolution never depends on network state at deploy time; CI verifies lock freshness with atmos version track verify.
  • The resolver registry follows the mandatory Atmos registry pattern so additional datasources (OCI/Docker digests, GitLab, Helm) plug in without touching the manager; importing updatecli's versionfilter was verified to bump only one indirect dependency.

references

Summary by CodeRabbit

  • New Features

    • Added version tracking support with new commands to list, inspect, add, update, lock, verify, diff, apply, and remove managed versions.
    • Introduced support for version-managed files, including workflow refs, annotated text replacements, and template-based rendering.
    • Added a !version YAML helper and version-track-aware template context resolution.
  • Bug Fixes

    • Improved drift detection and verification so version changes can be checked reliably in CI.
    • Updated dependency and license handling for new allowed components.

@atmos-pro

atmos-pro Bot commented Jul 4, 2026 •

Copy link
Copy Markdown
Contributor

Tip

Atmos Pro Β 

No affected stacks workflow was detected for this pull request.
If this is expected, no action is needed.
Learn More. Ask AI.

@osterman Erik Osterman (Cloud Posse) (osterman) added the minor New features that do not break anything label Jul 4, 2026
@github-actions github-actions Bot added the size/l Large size PR label Jul 4, 2026
@github-actions

github-actions Bot commented Jul 4, 2026 •

Copy link
Copy Markdown

Dependency Review

βœ… No vulnerabilities or license issues found.

Scanned Files

  • .github/workflows/version-tracker.yaml
  • go.mod

@mergify

mergify Bot commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Important

Cloud Posse Engineering Team Review Required

This pull request modifies files that require Cloud Posse's review. Please be patient, and a core maintainer will review your changes.

To expedite this process, reach out to us on Slack in the #pr-reviews channel.

@osterman

Copy link
Copy Markdown
Member Author

CodeRabbit (@coderabbitai) full review

@coderabbitai

coderabbitai Bot commented Jul 4, 2026 •

Copy link
Copy Markdown
Contributor
βœ… Action performed

Full review finished.

@coderabbitai

coderabbitai Bot commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

πŸ“ Walkthrough

Walkthrough

This PR introduces the Atmos Version Tracker: a schema, resolver, and manager system for managing external tool/action/image versions, deterministic locking to versions.lock.yaml, policy-driven updates, file managers that rewrite managed files, a full atmos version track CLI, runtime !version/.version template integration, a demo example, CI workflow, and documentation.

Changes

Atmos Version Tracker

Layer / File(s) Summary
Schema and YAML tag foundation
pkg/schema/version.go, pkg/utils/yaml_utils*.go
Adds VersionProvider/VersionEntry/VersionTrack/etc. types and registers the !version YAML tag.
Effective track/policy resolution
pkg/version/manager/manager.go, policy.go, refs.go, *_test.go
Computes effective entries via track inheritance/group merging and implements strategy/cooldown update decisions and pin-aware version refs.
Lock file and atmos.yaml CRUD
pkg/version/manager/lock.go, crud.go, *_test.go
Adds lock read/write/resolve/lock-track logic and add/set/remove entry editing of atmos.yaml.
Resolution engine and resolvers
pkg/version/manager/resolve*.go, pkg/version/resolver/*, pkg/github/tags.go
Adds resolver registry, candidate filtering, and GitHub/OCI/toolchain datasource resolvers.
Status and update tracking
pkg/version/manager/status.go, update.go, *_test.go
Reports lock status (current/blocked/unlocked) and advances locked versions per policy.
Runtime template/YAML integration
pkg/version/manager/context*.go, internal/exec/*.go, pkg/oci/auth.go
Injects version into template context, resolves !version, and centralizes GHCR auth.
File managers
pkg/version/managers/*
Orchestrates planning/applying/checking and rewrites GitHub Actions, marker-annotated, and template files.
CLI commands
cmd/version/track/*.go, cmd/version/version.go
Adds atmos version track subcommands and wires them into the CLI.
Demo example and CI workflow
examples/demo-version-tracker/*, .github/workflows/version-tracker.yaml
Adds an example project and CI validation of the tracker workflow.
Docs, PRD, roadmap, misc config
docs/prd/*, website/docs/*, website/blog/*, NOTICE, go.mod, .gitignore, .golangci.yml, .github/workflows/dependency-review.yml, tests/snapshots/*
Documents the feature and updates dependency/config/snapshot files.

Estimated code review effort: 5 (Critical) | ~150 minutes

Sequence Diagram(s)

sequenceDiagram
  participant CLI as atmos version track apply
  participant Manager as pkg/version/manager
  participant Managers as pkg/version/managers
  participant FileManager as github-actions/marker/template
  CLI->>Manager: EffectiveEntries + LoadLock
  Manager-->>CLI: VersionRefs
  CLI->>Managers: Plan(RunOptions)
  Managers->>FileManager: Plan(Input)
  FileManager-->>Managers: FileChange list
  Managers-->>CLI: PlannedChange list
  CLI->>Managers: Apply(changes)
  Managers-->>CLI: files rewritten on disk
Loading
sequenceDiagram
  participant YAML as Stack YAML (!version)
  participant ExecUtils as internal/exec
  participant Manager as pkg/version/manager
  participant Lock as versions.lock.yaml
  YAML->>ExecUtils: !version name
  ExecUtils->>Manager: ResolveYAMLFunc(name, stackInfo)
  Manager->>Lock: ResolveLocked(track, name)
  Lock-->>Manager: locked version
  Manager-->>ExecUtils: resolved value
  ExecUtils-->>YAML: substituted value
Loading

Possibly related PRs

  • cloudposse/atmos#943: Both PRs extend the same custom YAML tag registration logic in pkg/utils/yaml_utils.go.
  • cloudposse/atmos#1759: Both PRs modify the exported Version struct in pkg/schema/version.go.
  • cloudposse/atmos#2558: Both PRs extend the same processSimpleTags dispatch in internal/exec/yaml_func_utils.go for new custom tags.
πŸš₯ Pre-merge checks | βœ… 5
βœ… Passed checks (5 passed)
Check name Status Explanation
Description Check βœ… Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check βœ… Passed The title clearly summarizes the main change: adding Atmos Version Tracker with managed version tracks and a lock file.
Docstring Coverage βœ… Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check βœ… Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check βœ… Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
πŸ“ Generate docstrings
  • Create stacked PR
  • Commit on current branch
πŸ§ͺ Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch osterman/atmos-version-lock-ci

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❀️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 13

Note

Due to the large number of review comments, Critical, Major severity comments were prioritized as inline comments.

🟑 Minor comments (12)
website/docs/cli/configuration/version/managed-versions.mdx-250-250 (1)

250-250: 🎯 Functional Correctness | 🟑 Minor | ⚑ Quick win

Don't describe get as mutating.

get is read-only, so grouping it with add/set/remove as an editing command is inaccurate. Consider rewording this as version-entry management, or split get into its own sentence.

πŸ€– Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@website/docs/cli/configuration/version/managed-versions.mdx` at line 250, The
sentence in managed-versions.mdx incorrectly groups the read-only get subcommand
with the mutating add, set, and remove commands. Reword the description around
the version track subcommands so only add, set, and remove are described as
editing managed version entries in atmos.yaml, and mention get separately as a
read-only lookup in the version track docs.
website/blog/2026-07-04-atmos-version-tracker.mdx-89-89 (1)

89-89: 🎯 Functional Correctness | 🟑 Minor | ⚑ Quick win

Use a version key that exists in the example.

dd_forwarder isn't declared in the YAML snippet above, so this example won't work as-is. Either add that entry to the catalog snippet or switch the template reference to one of the keys already shown.

πŸ€– Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@website/blog/2026-07-04-atmos-version-tracker.mdx` at line 89, The example
references dd_forwarder, but that key is not present in the catalog/YAML snippet
shown above, so the template usage is inconsistent. Update the blog example in
the atmos version tracker post by either adding dd_forwarder to the displayed
catalog snippet or changing the template reference in the *.tmpl / stack
manifest example to use one of the existing keys already declared in the
snippet, keeping the .version and !version name references aligned with the
shown data.
cmd/version/track/get.go-29-31 (1)

29-31: 🎯 Functional Correctness | 🟑 Minor | ⚑ Quick win

Swallowed error hides real lock-file failures.

Any error from ResolveLocked is treated the same as "not locked" β€” including genuine failures like a corrupt versions.lock.yaml. Only manager.ErrVersionNotLocked should be silently ignored; other errors should propagate.

πŸ› Proposed fix
-		if locked, err := manager.ResolveLocked(atmosConfig, track, args[0]); err == nil {
-			entry.Locked = locked
-		}
+		locked, err := manager.ResolveLocked(atmosConfig, track, args[0])
+		switch {
+		case err == nil:
+			entry.Locked = locked
+		case errors.Is(err, manager.ErrVersionNotLocked):
+			// Entry has no locked version yet; leave entry.Locked empty.
+		default:
+			return err
+		}

(requires adding "errors" to the stdlib import group)

πŸ€– Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@cmd/version/track/get.go` around lines 29 - 31, The version-track lookup in
get.go is swallowing all errors from manager.ResolveLocked, which treats real
lock-file failures the same as β€œnot locked.” Update the error handling in the
get command so only manager.ErrVersionNotLocked is ignored, and all other errors
are returned/preserved; use errors.Is in the ResolveLocked call path and keep
entry.Locked assignment only for the successful case.
.github/workflows/version-tracker.yaml-22-26 (1)

22-26: 🩺 Stability & Availability | 🟑 Minor | ⚑ Quick win

Add actionlint runner-label config
runs-on.yml only configures RunsOn; actionlint still treats these custom labels as unknown. Add a self-hosted-runner label config (for example in .actionlintrc) so runs-on=*, runner=terraform, tag=atmos, extras=s3-cache, and private=false are accepted.

πŸ€– Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/version-tracker.yaml around lines 22 - 26, Add an
actionlint self-hosted-runner label configuration so the custom labels used in
the workflow are recognized. Update the repository’s actionlint config (for
example, the .actionlintrc used by actionlint) to whitelist the RunsOn labels
referenced in version-tracker.yaml: runs-on=*, runner=terraform, tag=atmos,
extras=s3-cache, and private=false. Keep the existing workflow entries
unchanged; just ensure actionlint knows these labels are valid.

Source: Linters/SAST tools

cmd/version/track/render.go-41-53 (1)

41-53: πŸ“ Maintainability & Code Quality | 🟑 Minor | ⚑ Quick win

Wrap the raw os.ReadFile error.

Line 46-49 returns the bare stdlib error from os.ReadFile directly instead of wrapping it in a project static error, unlike the sentinel-error pattern used elsewhere (e.g., ErrEntryNotFound in crud.go).

As per coding guidelines, "All errors MUST be wrapped using static errors defined in errors/errors.go ... NEVER use dynamic errors directly."

πŸ› Proposed fix
 			current, err := os.ReadFile(checkPath)
 			if err != nil {
-				return err
+				return fmt.Errorf("%w: %s: %w", ErrRenderCheckRead, checkPath, err)
 			}
πŸ€– Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@cmd/version/track/render.go` around lines 41 - 53, The check path in render
logic returns the raw `os.ReadFile` error, which violates the project’s
static-error wrapping pattern. Update the `check` branch in `render.go` so the
`os.ReadFile` failure is wrapped with an existing static error from
`errors/errors.go` (or a new one if needed), similar to the sentinel-error
handling used in `crud.go`, and keep `ErrRenderDrift` for the content mismatch
case.

Source: Coding guidelines

pkg/version/resolver/github/github.go-42-53 (1)

42-53: 🩺 Stability & Availability | 🟑 Minor | ⚑ Quick win

Thread ctx through GitHub releases
releaseCandidates drops the caller context, and pkg/github.GetReleases also creates its own context.Background(), so github-releases cannot honor cancellation/timeouts like github-tags does. Pass ctx into GetReleases and its client setup so both datasources behave consistently.

πŸ€– Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pkg/version/resolver/github/github.go` around lines 42 - 53, The GitHub
releases path is dropping the caller context, so cancellation and timeouts from
Resolver.Versions are not honored. Update Resolver.Versions to pass ctx into
releaseCandidates, then thread that through the releases flow in
releaseCandidates and pkg/github.GetReleases, including any client setup that
currently uses context.Background(). Make the releases datasource use the same
request context as tagCandidates so both paths behave consistently.

Source: Learnings

pkg/version/manager/policy.go-53-76 (1)

53-76: 🎯 Functional Correctness | 🟑 Minor | ⚑ Quick win

parseCooldown doesn't reject negative durations.

"-1d"/"-1w" parse successfully into a negative time.Duration. Combined with cooledDown's cooldown <= 0 short-circuit, a negative cooldown silently behaves as "no cooldown" instead of surfacing a configuration error.

πŸ›‘οΈ Proposed fix
 	if number, ok := strings.CutSuffix(value, "d"); ok {
 		days, err := strconv.Atoi(number)
-		if err != nil {
+		if err != nil || days < 0 {
 			return 0, fmt.Errorf("%w: %q", ErrInvalidCooldown, value)
 		}
πŸ€– Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pkg/version/manager/policy.go` around lines 53 - 76, parseCooldown currently
accepts negative values like "-1d" and "-1w", which later bypass cooldown checks
via cooledDown’s cooldown <= 0 handling. Update parseCooldown to validate the
parsed duration is strictly non-negative for all supported formats (suffix
days/weeks and time.ParseDuration), and return ErrInvalidCooldown for any
negative result so invalid configuration fails fast.
pkg/version/manager/crud.go-72-77 (1)

72-77: 🎯 Functional Correctness | 🟑 Minor | ⚑ Quick win

Non-deterministic field write order in SetEntryFields.

Iterating fields (a Go map) means the order in which atmosyaml.Set is applied is randomized per run. When a field write creates a new nested key (e.g. update.pin where update: doesn't yet exist), the resulting key position in the rewritten YAML can differ between invocations with the same input.

πŸ›‘οΈ Proposed fix: sort field paths for deterministic application order
+	sortedFields := make([]string, 0, len(fields))
+	for field := range fields {
+		sortedFields = append(sortedFields, field)
+	}
+	sort.Strings(sortedFields)
-	for field, value := range fields {
-		content, err = atmosyaml.Set(content, path+"."+field, value)
+	for _, field := range sortedFields {
+		content, err = atmosyaml.Set(content, path+"."+field, fields[field])
 		if err != nil {
 			return "", err
 		}
 	}

(requires adding "sort" to imports)

πŸ€– Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pkg/version/manager/crud.go` around lines 72 - 77, SetEntryFields applies
updates by ranging over the fields map, which makes atmosyaml.Set run in random
order and can produce nondeterministic YAML key placement when creating nested
paths. Update SetEntryFields to collect the field names, sort them before
applying writes, and then iterate in that stable order so updates like
path.field are applied deterministically; add the needed sort import.
pkg/version/manager/manager.go-78-87 (1)

78-87: 🩺 Stability & Availability | 🟑 Minor | ⚑ Quick win

TrackNames panics on a nil atmosConfig.

Unlike EffectiveEntries (which returns errUtils.ErrAtmosConfigIsNil), TrackNames dereferences atmosConfig.Version.Tracks unconditionally. If ever called with a nil config it will panic instead of failing gracefully.

πŸ›‘οΈ Proposed fix
 func TrackNames(atmosConfig *schema.AtmosConfiguration) []string {
 	defer perf.Track(atmosConfig, "manager.TrackNames")()
 
+	if atmosConfig == nil {
+		return nil
+	}
 	names := make([]string, 0, len(atmosConfig.Version.Tracks))
πŸ€– Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pkg/version/manager/manager.go` around lines 78 - 87, TrackNames currently
dereferences atmosConfig.Version.Tracks without any nil guard, so it can panic
on a nil config; update manager.TrackNames to handle a nil atmosConfig the same
way other helpers like EffectiveEntries do, returning
errUtils.ErrAtmosConfigIsNil (or an equivalent graceful failure path) before
accessing Version or Tracks. Keep the existing perf.Track(atmosConfig,
"manager.TrackNames") tracing and place the nil check at the start of the
function so the rest of the name collection and sort logic only runs when the
config is valid.
pkg/version/manager/resolve.go-44-51 (1)

44-51: 🎯 Functional Correctness | 🟑 Minor | ⚑ Quick win

Error message is misleading when pin=true and the desired version is already concrete.

When concrete == true and pin == true but the datasource has no registered resolver, execution falls through to the generic error "has no registered resolver; use a concrete desired version" β€” even though the caller already supplied a concrete version. The real reason for the failure is that pinning requires a resolver with digest support, not that the version isn't concrete.

πŸ’¬ Proposed fix: differentiate the message by intent
 	if !ok {
 		if concrete && !pin {
 			return resolver.Candidate{Version: entry.Desired}, nil
 		}
+		if concrete && pin {
+			return resolver.Candidate{}, fmt.Errorf("%w: datasource %q has no registered resolver; cannot pin a digest", ErrResolverUnsupported, entry.Datasource)
+		}
 		return resolver.Candidate{}, fmt.Errorf("%w: datasource %q has no registered resolver; use a concrete desired version", ErrResolverUnsupported, entry.Datasource)
 	}
πŸ€– Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pkg/version/manager/resolve.go` around lines 44 - 51, The fallback error in
resolve.go is too generic when resolver.Lookup fails and pin is true even though
entry.Desired is already concrete. Update the logic around the concrete check in
the resolver path to distinguish β€œno resolver for pinning/digest support” from
β€œdesired version is not concrete,” likely in the resolver.Lookup and return
branch. Keep the existing concrete fast-path for non-pinned lookups, but when
pin is true and no datasource resolver exists, return an error message that says
pinning requires a registered resolver or digest-capable resolver rather than
telling the caller to use a concrete desired version.
pkg/version/resolver/filter.go-19-24 (1)

19-24: 🩺 Stability & Availability | 🟑 Minor | ⚑ Quick win

Avoid silencing logrus at package init

logrus.SetOutput(io.Discard) mutates the default logger for the whole process as soon as this package is imported, which drops diagnostics from other Atmos code that also uses logrus (for example the logger adapter and SAML auth path). Prefer explicit configuration in the caller or scope the discard to updatecli's logger instead of the global default.

πŸ€– Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pkg/version/resolver/filter.go` around lines 19 - 24, The package-level init
in filter.go is mutating the global logrus default logger, which silences logs
for the entire process as soon as pkg/version/resolver is imported. Remove the
logrus.SetOutput(io.Discard) call from init and instead scope suppression to the
updatecli-specific logger or configure output in the caller that creates the
resolver; keep the change localized to the relevant resolver path and identify
it via init and any updatecli logger setup in this package.
pkg/version/resolver/oci/oci.go-101-109 (1)

101-109: 🩺 Stability & Availability | 🟑 Minor | ⚑ Quick win

Swallowed GHCR auth error hides root cause on fallback.

atmosoci.GHCRAuth's error is discarded (auth, _ :=). If GHCR-specific auth is misconfigured, the code silently falls back to the default keychain, and any resulting registry failure surfaces as a generic auth error with no trace of why GHCR auth itself failed.

πŸ” Suggested fix: log the GHCR auth error before falling back
 	if repo.RegistryStr() == ghcrHost {
-		if auth, _ := atmosoci.GHCRAuth(req.Config); auth != nil {
+		if auth, err := atmosoci.GHCRAuth(req.Config); auth != nil {
 			return append(opts, v1remote.WithAuth(auth))
+		} else if err != nil {
+			log.Debug("ghcr auth unavailable, falling back to default keychain", "error", err)
 		}
 	}
πŸ€– Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pkg/version/resolver/oci/oci.go` around lines 101 - 109, The remoteOptions
helper is swallowing the error returned by atmosoci.GHCRAuth, which causes GHCR
auth misconfiguration to fail later as a generic registry auth issue. Update
remoteOptions to capture the error from atmosoci.GHCRAuth when
repo.RegistryStr() equals ghcrHost, and log it before falling back to
authn.DefaultKeychain. Keep the existing auth selection behavior, but make sure
the GHCR-specific failure reason is surfaced with context from remoteOptions and
GHCRAuth.
🧹 Nitpick comments (6)
pkg/version/resolver/github/github.go (1)

26-27: πŸ“ Maintainability & Code Quality | πŸ”΅ Trivial | ⚑ Quick win

Local sentinel error instead of errors/errors.go.

ErrInvalidPackage is defined locally with errors.New(...) rather than in the centralized errors/errors.go.

As per coding guidelines: "All errors MUST be wrapped using static errors defined in errors/errors.go... NEVER use dynamic errors directly."

πŸ€– Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pkg/version/resolver/github/github.go` around lines 26 - 27,
ErrInvalidPackage is being created locally in github.go instead of using the
centralized static errors package. Move the sentinel definition to
errors/errors.go and update the github resolver code (and any callers such as
the github package parsing logic) to reference that shared error symbol rather
than errors.New, keeping the error name consistent for comparisons.

Source: Coding guidelines

pkg/version/manager/refs_test.go (1)

1-75: πŸ“ Maintainability & Code Quality | πŸ”΅ Trivial | ⚑ Quick win

Add a direct test for VersionRefs.

Good coverage for String(), normalizePin, and pin inheritance, but VersionRefs itself (the function that actually merges entries+lock into the template-context map) has no direct unit test here β€” it's only exercised indirectly through context_test.go. Worth adding a focused case (e.g., an entry present in lock but absent from entries, and vice versa) to lock down the merge contract.

As per coding guidelines: "Every new feature must include comprehensive unit tests targeting >80% code coverage for all packages."

πŸ€– Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pkg/version/manager/refs_test.go` around lines 1 - 75, Add a direct unit test
for VersionRefs to cover its merge behavior, since it is only exercised
indirectly today. Create a focused case in refs_test.go that calls VersionRefs
with entries and lock containing mismatched keys (for example, one key only in
entries and one only in lock) and assert the returned template-context map
includes the expected merged results. Use VersionRefs, entries, and lock as the
main symbols to locate the implementation.

Source: Coding guidelines

pkg/schema/version.go (1)

67-100: πŸ“ Maintainability & Code Quality | πŸ”΅ Trivial | ⚑ Quick win

Duplicated policy fields across three structs.

Update/Allow/Ignore/Labels are repeated verbatim in VersionPolicy (Line 68-72), VersionGroup (Line 82-85), and VersionEntry (Line 96-99). Consider embedding VersionPolicy (with mapstructure:",squash" / inline yaml) in VersionGroup and VersionEntry to avoid drift as fields evolve.

♻️ Sketch of embedding approach
 type VersionGroup struct {
 	Ecosystems      []string            `yaml:"ecosystems,omitempty" mapstructure:"ecosystems" json:"ecosystems,omitempty"`
 	Datasources     []string            `yaml:"datasources,omitempty" mapstructure:"datasources" json:"datasources,omitempty"`
 	Providers       []string            `yaml:"providers,omitempty" mapstructure:"providers" json:"providers,omitempty"`
 	Patterns        []string            `yaml:"patterns,omitempty" mapstructure:"patterns" json:"patterns,omitempty"`
 	ExcludePatterns []string            `yaml:"exclude_patterns,omitempty" mapstructure:"exclude_patterns" json:"exclude_patterns,omitempty"`
-	Update          VersionUpdatePolicy `yaml:"update,omitempty" mapstructure:"update" json:"update,omitempty"`
-	Allow           []string            `yaml:"allow,omitempty" mapstructure:"allow" json:"allow,omitempty"`
-	Ignore          []string            `yaml:"ignore,omitempty" mapstructure:"ignore" json:"ignore,omitempty"`
-	Labels          []string            `yaml:"labels,omitempty" mapstructure:"labels" json:"labels,omitempty"`
+	VersionPolicy   `yaml:",inline" mapstructure:",squash"`
 }
πŸ€– Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pkg/schema/version.go` around lines 67 - 100, The policy fields are
duplicated across VersionPolicy, VersionGroup, and VersionEntry, which risks
drift. Refactor VersionGroup and VersionEntry to embed VersionPolicy instead of
re-declaring Update/Allow/Ignore/Labels, and keep the existing
YAML/mapstructure/JSON behavior by using inline/squash-style tags on the
embedded field. Update any struct initialization or field access sites that
reference the duplicated fields so they now use the embedded VersionPolicy on
VersionGroup and VersionEntry.
pkg/version/manager/manager.go (1)

26-32: πŸ“ Maintainability & Code Quality | πŸ”΅ Trivial | ⚑ Quick win

Sentinel errors defined outside errors/errors.go.

New static errors (ErrTrackNotFound, ErrVersionNotFound, etc.) are declared here rather than centralized in errors/errors.go. The same pattern recurs in policy.go (ErrInvalidCooldown) and crud.go (ErrEntryExists, ErrEntryNotFound).

As per coding guidelines: "All errors MUST be wrapped using static errors defined in errors/errors.go... NEVER use dynamic errors directly."

πŸ€– Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pkg/version/manager/manager.go` around lines 26 - 32, The manager package is
defining new sentinel errors locally instead of using the ΰ€•ΰ₯‡ΰ€‚ΰ€¦ralized static
errors in errors/errors.go. Move ErrTrackNotFound, ErrVersionNotFound,
ErrVersionNotLocked, ErrTrackNotVerified, and ErrDesiredVersionRequired into
errors/errors.go, then update manager.go to reference those shared symbols;
apply the same cleanup pattern to ErrInvalidCooldown in policy.go and
ErrEntryExists/ErrEntryNotFound in crud.go so all static errors come from the
shared errors package.

Source: Coding guidelines

pkg/version/manager/context_test.go (1)

60-85: 🎯 Functional Correctness | πŸ”΅ Trivial | ⚑ Quick win

Good coverage of the exists-key contract β€” but consider adding a case matching the real version.track collision risk.

TestAddTemplateContextAddsVersionToNonEmptyContext's second assertion (Lines 76-84) confirms the exists-check behavior with a string "keep" value, which is the same mechanism that could silently swallow a real version: {track: ...} config value (see comment on context.go). A test seeding context["version"] with a map[string]any{"track": "x"} (mirroring the real manifest shape) would make this contract failure mode explicit and catch regressions/root-cause fixes.

πŸ€– Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pkg/version/manager/context_test.go` around lines 60 - 85,
`TestAddTemplateContextAddsVersionToNonEmptyContext` only covers preserving a
scalar existing version value; add a case that seeds the input context with a
real `version` map containing `track` to mirror the collision risk from
`AddTemplateContext`. Verify that the existing `version.track` structure is
preserved or handled as intended instead of being overwritten by the version
injection logic, and keep the check anchored to `AddTemplateContext` and the
`version` key behavior.
pkg/version/managers/githubactions/githubactions.go (1)

51-81: πŸ“ Maintainability & Code Quality | πŸ”΅ Trivial | ⚑ Quick win

Wrap os.ReadFile error with the file path for debuggability.

When scanning many workflow files, a bare err from os.ReadFile doesn't identify which file failed.

♻️ Proposed fix
 		content, err := os.ReadFile(file)
 		if err != nil {
-			return nil, err
+			return nil, fmt.Errorf("%s: %w", file, err)
 		}
πŸ€– Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pkg/version/managers/githubactions/githubactions.go` around lines 51 - 81,
The bare error returned from os.ReadFile in Manager.Plan does not identify which
workflow file failed, making failures hard to trace. Update the read error
handling inside Manager.Plan to wrap or annotate the error with the current file
path before returning it, so callers can see which path caused the failure while
scanning files.
πŸ€– Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@cmd/version/track/track.go`:
- Around line 34-40: The version-tracker sentinel errors are defined locally in
track.go instead of the centralized errors/errors.go. Move
ErrRenderFileRequired, ErrRenderDrift, and ErrUnsupportedFormat into
errors/errors.go with the other static sentinels, then update track.go and any
callers in the version-tracker flow to reference those shared error values so
the feature consistently wraps centralized errors like ErrEntryExists and
ErrTrackNotVerified.

In `@NOTICE`:
- Around line 508-510: The NOTICE file is stale and was hand-edited instead of
being regenerated from the dependency graph. Rerun ./scripts/generate-notice.sh
and commit the updated generated output so the entries for
github.com/opencontainers/go-digest (and the other affected NOTICE sections)
match the current dependency data. Do not manually change the dependency URLs;
let the generator refresh the NOTICE content.

In `@pkg/version/manager/policy.go`:
- Around line 171-194: In decidePolicy, the cooldown fallback can still produce
a Candidate with an empty Version when inputs.locked is unset, which later
breaks ResolveLocked and makes the saved state look unlocked. Update the
policyDecision flow so that when resolver.Select on cooled fails, you either
fall back to capBest only if it has a real Version, or return an explicit error
when no prior lock exists; keep the change localized around decidePolicy,
buildBlockReasons, and the target/raw selection path.
- Around line 138-166: Thread the caller context through update resolution
instead of using context.Background(), since policy decisions in decideUpdate
should respect cancellation/timeout from StatusTrack and UpdateTrack. Update the
decideUpdate flow and its callers so the context is passed into the resolver
request and used in res.Versions, while keeping the existing policy logic in
policyDecision and decidePolicy unchanged.

In `@pkg/version/manager/resolve.go`:
- Around line 53-67: ResolveEntry currently creates an unbounded
context.Background() before calling resolver methods, so network-backed
resolution can hang indefinitely. Update ResolveEntry (and, if needed,
ResolveTarget) to accept a context.Context from the caller and pass it through
to selectCandidate, res.Versions, and res.Pin; if you cannot thread caller
context yet, apply a bounded timeout context around these resolver calls and
ensure it is canceled. Keep the change localized around ResolveEntry and related
resolver helpers.

In `@pkg/version/manager/status.go`:
- Around line 111-128: VerifyTrack is incorrectly treating StatusLocked as a
passing state, which lets unresolved or resolver-error entries succeed
verification. Update VerifyTrack in status.go so only genuinely healthy states
pass, and make sure entries marked StatusLocked from statusForEntry/decideUpdate
are returned as ErrTrackNotVerified just like other failures. Keep the check
aligned with the StatusTrack/TrackStatus entry status handling so locked due to
errors is not considered verified.

In `@pkg/version/manager/update_test.go`:
- Around line 19-28: The cooldown test and `policyFakeResolver.Versions` rely on
fixed `ReleasedAt` dates, which makes
`TestUpdateTrackCooldownHoldsBackFreshRelease` depend on the real clock. Update
the test setup to use timestamps relative to `time.Now()` (or a mocked clock) so
the β€œfresh” and β€œold” candidates stay on either side of the `26w` cooldown
regardless of when the test runs. Keep the change focused in
`policyFakeResolver.Versions` and the cooldown test assertions that compare the
selected version.

In `@pkg/version/manager/update.go`:
- Around line 125-131: pinDigest currently calls res.Pin with
context.Background(), so the OCI pin request cannot be cancelled or timed out.
Update pinDigest to create a bounded context with a timeout before calling
res.Pin, pass that context through resolverRequest, and ensure the timeout is
derived from existing configuration or a reasonable default so version tracking
cannot hang indefinitely; use the pinDigest and res.Pin symbols to locate the
change.

In `@pkg/version/managers/githubactions/githubactions.go`:
- Around line 103-119: rewriteWorkflow is dropping existing trailing comments
when it rewrites a managed uses line with a non-pinned ref. Update the rewrite
logic in rewriteWorkflow to preserve match[4] for plain-version rewrites, while
still replacing the trailer for pinned entries produced by actionRef. Use the
existing usesLinePattern capture groups and actionRef behavior to distinguish
the two cases, and keep any unrelated comment text attached to the original
line.

In `@pkg/version/managers/managers.go`:
- Around line 215-233: `Apply` currently writes directly with `os.WriteFile`,
which can corrupt managed project files if the process fails mid-write. Update
`Apply` to use an atomic temp-file-then-rename flow for each `PlannedChange`:
write the content to a temp file in the same directory, preserve the existing
permission handling from `os.Stat`/`managedFilePerm`, then replace the
destination with a rename once the write succeeds. Keep the existing
`perf.Track` and `MkdirAll` behavior, and make sure the new logic still lives in
`Apply` and operates on `PlannedChange.Path`/`PlannedChange.New`.
- Around line 251-276: ExpandPaths is swallowing real glob errors from
u.GetGlobMatches and treating them like harmless no-match cases. Update
ExpandPaths in managers.go to distinguish a true β€œno matches” result from actual
failures, and return the error instead of continuing when the glob expansion
itself fails. Preserve the existing deduping and sorting logic for the
successful match path.

In `@pkg/version/managers/marker/marker.go`:
- Around line 142-165: parseAnnotation is misclassifying standalone HTML
annotations because the shorter "--" delimiter can override the longer "<!--"
match when scanning commentDelimiters. Update the delimiter detection logic in
parseAnnotation so the chosen commentStart is based on the intended
longest-match behavior (or otherwise ignores nested shorter delimiters once a
valid longer delimiter is found). Keep the standalone-comment check intact, and
add a regression test for a line like "<!-- atmos:version opentofu -->" followed
by a target line to verify HTML standalone annotations are rewritten correctly.

In `@pkg/version/resolver/toolchain/toolchain.go`:
- Around line 28-52: The Resolver.Versions flow is ignoring the provided
context, so cancellation and deadlines cannot interrupt the toolchain registry
lookup. Update the Versions method to thread ctx into both the tool spec parsing
and the Aqua registry version fetch, using the relevant Resolver,
toolchain.NewInstaller/ParseToolSpec, and lister.GetAvailableVersions call
sites. If those APIs don’t accept context yet, extend them or add a local
timeout around the registry call so the request can be aborted promptly.

---

Minor comments:
In @.github/workflows/version-tracker.yaml:
- Around line 22-26: Add an actionlint self-hosted-runner label configuration so
the custom labels used in the workflow are recognized. Update the repository’s
actionlint config (for example, the .actionlintrc used by actionlint) to
whitelist the RunsOn labels referenced in version-tracker.yaml: runs-on=*,
runner=terraform, tag=atmos, extras=s3-cache, and private=false. Keep the
existing workflow entries unchanged; just ensure actionlint knows these labels
are valid.

In `@cmd/version/track/get.go`:
- Around line 29-31: The version-track lookup in get.go is swallowing all errors
from manager.ResolveLocked, which treats real lock-file failures the same as
β€œnot locked.” Update the error handling in the get command so only
manager.ErrVersionNotLocked is ignored, and all other errors are
returned/preserved; use errors.Is in the ResolveLocked call path and keep
entry.Locked assignment only for the successful case.

In `@cmd/version/track/render.go`:
- Around line 41-53: The check path in render logic returns the raw
`os.ReadFile` error, which violates the project’s static-error wrapping pattern.
Update the `check` branch in `render.go` so the `os.ReadFile` failure is wrapped
with an existing static error from `errors/errors.go` (or a new one if needed),
similar to the sentinel-error handling used in `crud.go`, and keep
`ErrRenderDrift` for the content mismatch case.

In `@pkg/version/manager/crud.go`:
- Around line 72-77: SetEntryFields applies updates by ranging over the fields
map, which makes atmosyaml.Set run in random order and can produce
nondeterministic YAML key placement when creating nested paths. Update
SetEntryFields to collect the field names, sort them before applying writes, and
then iterate in that stable order so updates like path.field are applied
deterministically; add the needed sort import.

In `@pkg/version/manager/manager.go`:
- Around line 78-87: TrackNames currently dereferences
atmosConfig.Version.Tracks without any nil guard, so it can panic on a nil
config; update manager.TrackNames to handle a nil atmosConfig the same way other
helpers like EffectiveEntries do, returning errUtils.ErrAtmosConfigIsNil (or an
equivalent graceful failure path) before accessing Version or Tracks. Keep the
existing perf.Track(atmosConfig, "manager.TrackNames") tracing and place the nil
check at the start of the function so the rest of the name collection and sort
logic only runs when the config is valid.

In `@pkg/version/manager/policy.go`:
- Around line 53-76: parseCooldown currently accepts negative values like "-1d"
and "-1w", which later bypass cooldown checks via cooledDown’s cooldown <= 0
handling. Update parseCooldown to validate the parsed duration is strictly
non-negative for all supported formats (suffix days/weeks and
time.ParseDuration), and return ErrInvalidCooldown for any negative result so
invalid configuration fails fast.

In `@pkg/version/manager/resolve.go`:
- Around line 44-51: The fallback error in resolve.go is too generic when
resolver.Lookup fails and pin is true even though entry.Desired is already
concrete. Update the logic around the concrete check in the resolver path to
distinguish β€œno resolver for pinning/digest support” from β€œdesired version is
not concrete,” likely in the resolver.Lookup and return branch. Keep the
existing concrete fast-path for non-pinned lookups, but when pin is true and no
datasource resolver exists, return an error message that says pinning requires a
registered resolver or digest-capable resolver rather than telling the caller to
use a concrete desired version.

In `@pkg/version/resolver/filter.go`:
- Around line 19-24: The package-level init in filter.go is mutating the global
logrus default logger, which silences logs for the entire process as soon as
pkg/version/resolver is imported. Remove the logrus.SetOutput(io.Discard) call
from init and instead scope suppression to the updatecli-specific logger or
configure output in the caller that creates the resolver; keep the change
localized to the relevant resolver path and identify it via init and any
updatecli logger setup in this package.

In `@pkg/version/resolver/github/github.go`:
- Around line 42-53: The GitHub releases path is dropping the caller context, so
cancellation and timeouts from Resolver.Versions are not honored. Update
Resolver.Versions to pass ctx into releaseCandidates, then thread that through
the releases flow in releaseCandidates and pkg/github.GetReleases, including any
client setup that currently uses context.Background(). Make the releases
datasource use the same request context as tagCandidates so both paths behave
consistently.

In `@pkg/version/resolver/oci/oci.go`:
- Around line 101-109: The remoteOptions helper is swallowing the error returned
by atmosoci.GHCRAuth, which causes GHCR auth misconfiguration to fail later as a
generic registry auth issue. Update remoteOptions to capture the error from
atmosoci.GHCRAuth when repo.RegistryStr() equals ghcrHost, and log it before
falling back to authn.DefaultKeychain. Keep the existing auth selection
behavior, but make sure the GHCR-specific failure reason is surfaced with
context from remoteOptions and GHCRAuth.

In `@website/blog/2026-07-04-atmos-version-tracker.mdx`:
- Line 89: The example references dd_forwarder, but that key is not present in
the catalog/YAML snippet shown above, so the template usage is inconsistent.
Update the blog example in the atmos version tracker post by either adding
dd_forwarder to the displayed catalog snippet or changing the template reference
in the *.tmpl / stack manifest example to use one of the existing keys already
declared in the snippet, keeping the .version and !version name references
aligned with the shown data.

In `@website/docs/cli/configuration/version/managed-versions.mdx`:
- Line 250: The sentence in managed-versions.mdx incorrectly groups the
read-only get subcommand with the mutating add, set, and remove commands. Reword
the description around the version track subcommands so only add, set, and
remove are described as editing managed version entries in atmos.yaml, and
mention get separately as a read-only lookup in the version track docs.

---

Nitpick comments:
In `@pkg/schema/version.go`:
- Around line 67-100: The policy fields are duplicated across VersionPolicy,
VersionGroup, and VersionEntry, which risks drift. Refactor VersionGroup and
VersionEntry to embed VersionPolicy instead of re-declaring
Update/Allow/Ignore/Labels, and keep the existing YAML/mapstructure/JSON
behavior by using inline/squash-style tags on the embedded field. Update any
struct initialization or field access sites that reference the duplicated fields
so they now use the embedded VersionPolicy on VersionGroup and VersionEntry.

In `@pkg/version/manager/context_test.go`:
- Around line 60-85: `TestAddTemplateContextAddsVersionToNonEmptyContext` only
covers preserving a scalar existing version value; add a case that seeds the
input context with a real `version` map containing `track` to mirror the
collision risk from `AddTemplateContext`. Verify that the existing
`version.track` structure is preserved or handled as intended instead of being
overwritten by the version injection logic, and keep the check anchored to
`AddTemplateContext` and the `version` key behavior.

In `@pkg/version/manager/manager.go`:
- Around line 26-32: The manager package is defining new sentinel errors locally
instead of using the ΰ€•ΰ₯‡ΰ€‚ΰ€¦ralized static errors in errors/errors.go. Move
ErrTrackNotFound, ErrVersionNotFound, ErrVersionNotLocked, ErrTrackNotVerified,
and ErrDesiredVersionRequired into errors/errors.go, then update manager.go to
reference those shared symbols; apply the same cleanup pattern to
ErrInvalidCooldown in policy.go and ErrEntryExists/ErrEntryNotFound in crud.go
so all static errors come from the shared errors package.

In `@pkg/version/manager/refs_test.go`:
- Around line 1-75: Add a direct unit test for VersionRefs to cover its merge
behavior, since it is only exercised indirectly today. Create a focused case in
refs_test.go that calls VersionRefs with entries and lock containing mismatched
keys (for example, one key only in entries and one only in lock) and assert the
returned template-context map includes the expected merged results. Use
VersionRefs, entries, and lock as the main symbols to locate the implementation.

In `@pkg/version/managers/githubactions/githubactions.go`:
- Around line 51-81: The bare error returned from os.ReadFile in Manager.Plan
does not identify which workflow file failed, making failures hard to trace.
Update the read error handling inside Manager.Plan to wrap or annotate the error
with the current file path before returning it, so callers can see which path
caused the failure while scanning files.

In `@pkg/version/resolver/github/github.go`:
- Around line 26-27: ErrInvalidPackage is being created locally in github.go
instead of using the centralized static errors package. Move the sentinel
definition to errors/errors.go and update the github resolver code (and any
callers such as the github package parsing logic) to reference that shared error
symbol rather than errors.New, keeping the error name consistent for
comparisons.
πŸͺ„ Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
βš™οΈ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 526a847d-dcb9-44ff-8381-8efb7ea9e588

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between 1b9f8e2 and 5dcdfd2.

β›” Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum
πŸ“’ Files selected for processing (78)
  • .github/workflows/dependency-review.yml
  • .github/workflows/version-tracker.yaml
  • .gitignore
  • .golangci.yml
  • NOTICE
  • cmd/version/track/add.go
  • cmd/version/track/apply.go
  • cmd/version/track/diff.go
  • cmd/version/track/get.go
  • cmd/version/track/list.go
  • cmd/version/track/lock.go
  • cmd/version/track/remove.go
  • cmd/version/track/render.go
  • cmd/version/track/set.go
  • cmd/version/track/show.go
  • cmd/version/track/status.go
  • cmd/version/track/track.go
  • cmd/version/track/update.go
  • cmd/version/track/verify.go
  • cmd/version/version.go
  • docs/prd/atmos-version-management.md
  • examples/demo-version-tracker/Dockerfile
  • examples/demo-version-tracker/README.md
  • examples/demo-version-tracker/atmos.yaml
  • examples/demo-version-tracker/versions.json
  • examples/demo-version-tracker/versions.json.tmpl
  • examples/demo-version-tracker/versions.lock.yaml
  • examples/demo-version-tracker/workflows/ci.yaml
  • go.mod
  • internal/exec/oci_utils.go
  • internal/exec/stack_processor_utils.go
  • internal/exec/utils.go
  • internal/exec/yaml_func_utils.go
  • pkg/github/tags.go
  • pkg/oci/auth.go
  • pkg/schema/version.go
  • pkg/utils/yaml_utils.go
  • pkg/utils/yaml_utils_test.go
  • pkg/version/manager/context.go
  • pkg/version/manager/context_test.go
  • pkg/version/manager/crud.go
  • pkg/version/manager/crud_test.go
  • pkg/version/manager/lock.go
  • pkg/version/manager/manager.go
  • pkg/version/manager/manager_test.go
  • pkg/version/manager/policy.go
  • pkg/version/manager/refs.go
  • pkg/version/manager/refs_test.go
  • pkg/version/manager/registry_imports.go
  • pkg/version/manager/resolve.go
  • pkg/version/manager/resolve_test.go
  • pkg/version/manager/status.go
  • pkg/version/manager/update.go
  • pkg/version/manager/update_test.go
  • pkg/version/managers/githubactions/githubactions.go
  • pkg/version/managers/githubactions/githubactions_test.go
  • pkg/version/managers/managers.go
  • pkg/version/managers/marker/marker.go
  • pkg/version/managers/marker/marker_test.go
  • pkg/version/managers/template/template.go
  • pkg/version/managers/template/template_test.go
  • pkg/version/resolver/filter.go
  • pkg/version/resolver/filter_test.go
  • pkg/version/resolver/github/github.go
  • pkg/version/resolver/oci/oci.go
  • pkg/version/resolver/oci/oci_test.go
  • pkg/version/resolver/resolver.go
  • pkg/version/resolver/toolchain/toolchain.go
  • tests/snapshots/TestCLICommands_atmos_describe_config.stdout.golden
  • tests/snapshots/TestCLICommands_secrets-masking_describe_config.stdout.golden
  • website/blog/2026-07-04-atmos-version-tracker.mdx
  • website/docs/cli/commands/version/track.mdx
  • website/docs/cli/configuration/version/managed-versions.mdx
  • website/docs/cli/configuration/version/version.mdx
  • website/docs/design-patterns/version-management/index.mdx
  • website/docs/functions/yaml/index.mdx
  • website/docs/functions/yaml/version.mdx
  • website/src/data/roadmap.js

Comment thread cmd/version/track/track.go Resolved
Comment thread NOTICE Resolved
Comment thread pkg/version/manager/policy.go Resolved
Comment thread pkg/version/manager/policy.go Resolved
Comment thread pkg/version/manager/resolve.go Resolved
Comment thread pkg/version/managers/managers.go Resolved
Comment thread pkg/version/managers/managers.go Resolved
Comment thread pkg/version/managers/marker/marker.go Resolved
…vendor

Add a shared pkg/yaml editing engine built on yqlib (fed raw bytes) that
preserves comments, anchors/aliases, Atmos YAML functions, and Go templates,
with a strict guard that rejects edits which would alter or expand an anchor.

Expose it via three dot-notation command groups:
- atmos config get|set|delete  (edits the active atmos.yaml)
- atmos stack  get|set|delete  (provenance resolves the manifest that defines
  the effective value; --file override)
- atmos vendor get|set         (version pinning by component name)

Includes a PRD, Docusaurus docs, a changelog blog post, and a roadmap
milestone. Supersedes the hardcoded sources[].version writer from the old
feat/vendor-diff-and-update branch.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
The new top-level `config` and `stack` command groups appear in `atmos --help`,
`help`, and the unknown-command list. Regenerate the affected golden snapshots
via -regenerate-snapshots (content-only change, identical across linux/macos/windows).

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
…serving engine

atmos vendor update checks each Git-backed source for a newer allowed version
(honoring per-source semver constraints, exclusions, and no_prereleases) and
updates the version field in place via the shared pkg/yaml engine β€” preserving
comments, anchors, and {{.Version}} templates. Supports --check (dry run),
--pull, --component, --tags, and --outdated.

atmos vendor diff shows the Git diff between two versions of a vendored
component without a local checkout.

Both use go-git (no git binary) behind mockable interfaces; tag listing and
ref-to-ref diff are network-isolated in tests. Adds a constraints schema to
AtmosVendorSource, a PRD, command docs, and reuses the existing
Masterminds/semver dependency. Supersedes the YAML-write approach of the old
feat/vendor-diff-and-update branch (~7k lines) with ~1k lines on the shared
engine.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@mergify

mergify Bot commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

πŸ’₯ This pull request now has conflicts. Could you fix it Erik Osterman (Cloud Posse) (@osterman)? πŸ™

@mergify mergify Bot added the conflict This PR has conflicts label Jul 5, 2026
…' into osterman/atmos-version-lock-ci

# Conflicts:
#	.github/workflows/test.yml
@mergify

mergify Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

πŸ’₯ This pull request now has conflicts. Could you fix it Erik Osterman (Cloud Posse) (@osterman)? πŸ™

@mergify mergify Bot added the conflict This PR has conflicts label Jul 6, 2026
Replaces the bare list of track names with a pivot table (one row per
dependency, one column per track) so versions can be compared across
tracks at a glance, reusing the existing pkg/list/format table/csv/json/yaml
renderer. Adds --show (desired|locked) and --max-columns flags, and fixes
TrackNames to include the implicit default track so it agrees with
EffectiveEntries.

Also includes:
- docs_generate: fix the default fallback template to read through the
  "config" gomplate datasource instead of bare fields, since
  ProcessTmplWithDatasourcesGomplate binds root "." to the outer Env
  wrapper, not the merged input data.
- pkg/hooks: fix a gocritic rangeValCopy lint finding blocking the
  --new-from-rev=origin/main pre-commit gate.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
@github-actions github-actions Bot added size/xxl and removed size/xl Extra large size PR labels Jul 6, 2026
@mergify

mergify Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Warning

This PR exceeds the recommended limit of 10,000 lines.

Large PRs are difficult to review and may be rejected due to their size.

Please verify that this PR does not address multiple issues.
Consider refactoring it into smaller, more focused PRs to facilitate a smoother review process.

…' into osterman/atmos-version-lock-ci

# Conflicts:
#	pkg/hooks/hooks.go
#	scripts/generate-notice.sh
The track overview table still said "List configured version tracks."
after list.mdx was rewritten for the dependency x track matrix view.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
The Version Tracker's !version YAML function was wired into
pkg/utils/yaml_utils.go (AtmosYamlFuncVersion) but never added to
pkg/function/tag, the canonical tag catalog used for validation and
"unsupported tag" error messages. This left fntag.AllYAML()/IsValidYAML
out of sync with pkg/utils, failing TestFntagPackage_ContainsAllSupportedYamlTags
and TestAllSupportedYamlTagsList in CI on all three platforms.

Adds the Version constant (and its pkg/function mirror, TagVersion) to
the catalog, and updates the enumerated tag lists in tag_test.go and
tags_test.go to match.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
@osterman
Erik Osterman (Cloud Posse) (osterman) merged commit bae6a64 into osterman/atmos-yaml-schema-split Jul 7, 2026
23 checks passed
@osterman
Erik Osterman (Cloud Posse) (osterman) deleted the osterman/atmos-version-lock-ci branch July 7, 2026 03:14
@atmos-pro

atmos-pro Bot commented Jul 7, 2026 •

Copy link
Copy Markdown
Contributor

Tip

Atmos Pro Β 

No affected stacks workflow was detected for this pull request.
If this is expected, no action is needed.
Learn More. Ask AI.

@mergify mergify Bot removed the needs-cloudposse Needs Cloud Posse assistance label Jul 7, 2026
Andriy Knysh (aknysh) pushed a commit that referenced this pull request Jul 8, 2026
* feat(yaml): format-preserving get/set/delete for config, stacks, and vendor

Add a shared pkg/yaml editing engine built on yqlib (fed raw bytes) that
preserves comments, anchors/aliases, Atmos YAML functions, and Go templates,
with a strict guard that rejects edits which would alter or expand an anchor.

Expose it via three dot-notation command groups:
- atmos config get|set|delete  (edits the active atmos.yaml)
- atmos stack  get|set|delete  (provenance resolves the manifest that defines
  the effective value; --file override)
- atmos vendor get|set         (version pinning by component name)

Includes a PRD, Docusaurus docs, a changelog blog post, and a roadmap
milestone. Supersedes the hardcoded sources[].version writer from the old
feat/vendor-diff-and-update branch.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* test: regenerate CLI snapshots for new config and stack commands

The new top-level `config` and `stack` command groups appear in `atmos --help`,
`help`, and the unknown-command list. Regenerate the affected golden snapshots
via -regenerate-snapshots (content-only change, identical across linux/macos/windows).

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* feat(vendor): add 'vendor update' and 'vendor diff' on the format-preserving engine

atmos vendor update checks each Git-backed source for a newer allowed version
(honoring per-source semver constraints, exclusions, and no_prereleases) and
updates the version field in place via the shared pkg/yaml engine β€” preserving
comments, anchors, and {{.Version}} templates. Supports --check (dry run),
--pull, --component, --tags, and --outdated.

atmos vendor diff shows the Git diff between two versions of a vendored
component without a local checkout.

Both use go-git (no git binary) behind mockable interfaces; tag listing and
ref-to-ref diff are network-isolated in tests. Adds a constraints schema to
AtmosVendorSource, a PRD, command docs, and reuses the existing
Masterminds/semver dependency. Supersedes the YAML-write approach of the old
feat/vendor-diff-and-update branch (~7k lines) with ~1k lines on the shared
engine.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* fix(yaml): address CodeRabbit review on format-preserving editing

Resolve the actionable CodeRabbit findings on the YAML get/set/delete PR:

- yaml.Query: return a legitimate empty-string scalar instead of treating
  it as not-found (detect missing from the pre-trimmed result).
- yaml.atomicWrite: use the shared cross-platform filesystem.WriteFileAtomic
  so an existing file can be replaced on Windows; preserve existing mode.
- yaml.splitDotPath: reject empty path segments (a..b, trailing a.) so a typo
  cannot silently target a different key; refactor into dotPathScanner.
- config: only os.IsNotExist maps to "no editable config"; propagate other
  stat errors with context (firstExistingConfig now returns an error).
- vendoring.SetComponentVersion: gate the "component not found" rewrite on
  errors.Is(ErrYAMLPathNotFound); surface unreadable/invalid-YAML causes.
- stack get: split the read path from the editable resolver (requireEditable)
  so get honors --file and does not fail on inherited/imported values.
- stack edit: escape component-name path segments (BuildComponentYqPath +
  yaml.QuotePathSegment) so dotted/bracketed names address the right node,
  while keeping the raw path for provenance lookups.
- docs: add the mandatory Screengrab block to all new config/stack/vendor
  command pages and register their --help screengrabs in demo-stacks.txt.

Add regression tests for each fix.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* Address vendor review feedback and coverage

* Fix Windows acceptance test and vendor test cleanup

* Normalize vendor report test output

* Add config path listing commands

* Show values in config path lists

* Align config path value previews

* Filter config path lists by pattern

* Add config format commands

* Pin Playwright integration test driver version

* Harden YAML editor edge cases

* Fix markdown link check

* feat(yaml): preserve file style via EditorConfig in pkg/yaml edits

YAML file edits (Set/SetRaw/Delete/Eval) were silently overwriting a
file's existing indent width, line endings, and trailing newline with
package defaults instead of preserving them. Add EditorConfig-aware
style resolution so in-place edits keep the file's detected style,
while FormatFile normalizes to the resolved EditorConfig settings.

Also fixes a gocritic rangeValCopy finding in pkg/hooks/hooks.go
surfaced by the --new-from-rev lint gate on this branch.

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* ci: warm up Go build cache for macos-intel runner

Build (macos-intel) times out at 30m while the ARM macos leg finishes
in ~9m, because setup-go-cache-warmup.yml's nightly matrix only warms
windows and macos (arm64) β€” never macos-15-intel. Every PR build on
that runner starts with a cold GOMODCACHE/GOCACHE, and downloading the
full dependency tree from scratch blows through the timeout, which
then cascades into skipped [k3s-macos] jobs and a failing
"Check k3s matrix result" gate. Add macos-intel to the warmup matrix
so it gets the same nightly cache as the other ephemeral hosted
runners.

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* feat: Atmos Version Tracker β€” managed version tracks with lock file (#2688)

* feat(yaml): format-preserving get/set/delete for config, stacks, and vendor

Add a shared pkg/yaml editing engine built on yqlib (fed raw bytes) that
preserves comments, anchors/aliases, Atmos YAML functions, and Go templates,
with a strict guard that rejects edits which would alter or expand an anchor.

Expose it via three dot-notation command groups:
- atmos config get|set|delete  (edits the active atmos.yaml)
- atmos stack  get|set|delete  (provenance resolves the manifest that defines
  the effective value; --file override)
- atmos vendor get|set         (version pinning by component name)

Includes a PRD, Docusaurus docs, a changelog blog post, and a roadmap
milestone. Supersedes the hardcoded sources[].version writer from the old
feat/vendor-diff-and-update branch.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* test: regenerate CLI snapshots for new config and stack commands

The new top-level `config` and `stack` command groups appear in `atmos --help`,
`help`, and the unknown-command list. Regenerate the affected golden snapshots
via -regenerate-snapshots (content-only change, identical across linux/macos/windows).

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* feat(vendor): add 'vendor update' and 'vendor diff' on the format-preserving engine

atmos vendor update checks each Git-backed source for a newer allowed version
(honoring per-source semver constraints, exclusions, and no_prereleases) and
updates the version field in place via the shared pkg/yaml engine β€” preserving
comments, anchors, and {{.Version}} templates. Supports --check (dry run),
--pull, --component, --tags, and --outdated.

atmos vendor diff shows the Git diff between two versions of a vendored
component without a local checkout.

Both use go-git (no git binary) behind mockable interfaces; tag listing and
ref-to-ref diff are network-isolated in tests. Adds a constraints schema to
AtmosVendorSource, a PRD, command docs, and reuses the existing
Masterminds/semver dependency. Supersedes the YAML-write approach of the old
feat/vendor-diff-and-update branch (~7k lines) with ~1k lines on the shared
engine.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* fix(yaml): address CodeRabbit review on format-preserving editing

Resolve the actionable CodeRabbit findings on the YAML get/set/delete PR:

- yaml.Query: return a legitimate empty-string scalar instead of treating
  it as not-found (detect missing from the pre-trimmed result).
- yaml.atomicWrite: use the shared cross-platform filesystem.WriteFileAtomic
  so an existing file can be replaced on Windows; preserve existing mode.
- yaml.splitDotPath: reject empty path segments (a..b, trailing a.) so a typo
  cannot silently target a different key; refactor into dotPathScanner.
- config: only os.IsNotExist maps to "no editable config"; propagate other
  stat errors with context (firstExistingConfig now returns an error).
- vendoring.SetComponentVersion: gate the "component not found" rewrite on
  errors.Is(ErrYAMLPathNotFound); surface unreadable/invalid-YAML causes.
- stack get: split the read path from the editable resolver (requireEditable)
  so get honors --file and does not fail on inherited/imported values.
- stack edit: escape component-name path segments (BuildComponentYqPath +
  yaml.QuotePathSegment) so dotted/bracketed names address the right node,
  while keeping the raw path for provenance lookups.
- docs: add the mandatory Screengrab block to all new config/stack/vendor
  command pages and register their --help screengrabs in demo-stacks.txt.

Add regression tests for each fix.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* Address vendor review feedback and coverage

* Fix Windows acceptance test and vendor test cleanup

* Normalize vendor report test output

* Add config path listing commands

* Show values in config path lists

* Align config path value previews

* Filter config path lists by pattern

* Add config format commands

* feat(version): managed version tracks with lock file, !version function, and tracks command (WIP)

Phase 1 of the version-management PRD: version catalog in atmos.yaml
(providers/defaults/groups/tracks), versions.lock.yaml, !version YAML
function and .version template context, and the atmos version tracks
command group (list/show/lock/update/status/diff/verify/render).

Co-Authored-By: Claude Fable 5 <[email protected]>

* chore: ignore repo-local .cache/ directory

Co-Authored-By: Claude Fable 5 <[email protected]>

* refactor(version): singular 'version track' namespace, StandardParser flags, pkg-owned context logic

Phase A of the Version Tracker: move the .version template-context and
!version YAML-function bodies from internal/exec into
pkg/version/manager/context.go (internal/exec keeps one-line call
sites), and rebuild the command group as 'atmos version track <verb>'
(alias: tracks) with one verb per file, flags.NewStandardParser, and
data.WriteYAML/WriteJSON output. Track selection now falls back from
positional arg to --track to version.track in atmos.yaml.

Co-Authored-By: Claude Fable 5 <[email protected]>

* feat(version): datasource resolver registry with github and toolchain resolvers

Phase B of the Version Tracker: pkg/version/resolver defines the
Resolver interface (Versions/Pin) with an init-registered datasource
registry and ecosystem aliases. The toolchain resolver moves out of
the manager; new github-tags/github-releases resolvers build on
pkg/github (new ListTags returns tag names with commit SHAs; releases
carry publish timestamps for future cooldown checks). Version
selection (latest/constraint + allow/ignore rules) wraps the
updatecli versionfilter engine; 'latest' is order-independent
highest-SemVer with a datasource-order fallback for non-SemVer tags.

Imports github.com/updatecli/updatecli; MVS impact verified: only
opencontainers/go-digest bumped (indirect, patch).

Co-Authored-By: Claude Fable 5 <[email protected]>

* [autocommit] formatting fixes

* fix(version): never let .version context injection trigger early template processing

Fixes three CI failures on the Version Tracker branch:

- The .version template-context injection used a naive substring check
  that matched '{{ .vars.versioning_enabled }}' and, worse, could turn
  an empty template context non-empty. A non-empty context is what
  gates whole-file template processing in the stack processor, so
  generate-section templates like '{{ .vars.environment }}' were
  evaluated too early with only the version key in scope, breaking all
  terraform_generate_files acceptance tests. AddTemplateContext now
  requires an already-non-empty context (piggybacks only on processing
  that would happen anyway) and matches \.version\b with a word
  boundary. Regression tests added.

- Regenerate describe_config snapshots for the new version.defaults
  schema field (-regenerate-snapshots).

- Allow github.com/opencontainers/go-digest in dependency review: the
  pseudo-version required by updatecli scans as 'Apache-2.0 AND
  CC-BY-SA-4.0', but the CC-BY-SA part covers documentation only.
  Regenerate NOTICE for the new dependencies.

Co-Authored-By: Claude Fable 5 <[email protected]>

* [autocommit] formatting fixes

* refactor(version): move track command group into cmd/version/track package

Follows the cmd/terraform/cache nested-command precedent: the track
package exposes GetTrackCommand() and SetAtmosConfig(), and the parent
version command wires both.

Co-Authored-By: Claude Fable 5 <[email protected]>

* feat(version): SHA/digest pinning with pin policy and OCI resolver

Phase C of the Version Tracker: opt-in 'pin: digest' (alias: sha)
policy field inherits through the defaults -> track -> entry -> group
chain. Locking resolves the immutable identifier alongside the version
(git commit SHA for GitHub tags, sha256 manifest digest for OCI) into
LockEntry.Digest plus the upstream released_at timestamp for future
cooldown checks. A configured pin on a datasource that cannot pin
fails loudly instead of being silently skipped.

The .version template context now yields VersionRef values: String()
emits the digest for pinned entries so '{{ .version.name }}' renders
the pinned form, with .Version/.Digest individually addressable.

New oci-tags/docker-tags resolver on go-containerregistry (tag listing
+ manifest digest pinning), with default-keychain auth and a GHCR
token fallback extracted from internal/exec into pkg/oci for reuse.
Providers gain 'insecure' for local/emulated registries.

Co-Authored-By: Claude Fable 5 <[email protected]>

* test(utils): add !version to the expected YAML tags list

TestAtmosYamlTagsMap_ContainsAllTags asserts the exact tag count; the
Version Tracker's !version function tag makes it 30.

Co-Authored-By: Claude Fable 5 <[email protected]>

* feat(version): enforce update policy β€” strategy caps, cooldown, structured block reasons

Phase D of the Version Tracker: 'atmos version track update' now
advances within each entry's effective policy instead of aliasing
lock. Strategy caps (major/minor/patch relative to the locked version;
pin/digest never advance, refreshing pinned digests only), cooldown
windows against upstream release timestamps (14d/2w/Go durations), and
allow/ignore rules all apply, and every held-back candidate produces a
structured reason (strategy and cooldown blocks reported separately).

Status is now policy-aware: update-available means an update the
policy would take, while a newer version held back by policy reports
'newer-available (blocked)' with the reason β€” and passes verify, since
the locked version is exactly what the policy wants. Update gains
--only to limit the run to named entries.

Co-Authored-By: Claude Fable 5 <[email protected]>

* feat(version): file managers β€” in-place workflow refs, marker comments, template rendering

Phase E of the Version Tracker: a file-manager registry
(pkg/version/managers) keeps project files in sync with the lock, with
pure Plan() output driven by shared Apply/Check drivers.

Three managers ship:
- github-actions: scans workflow 'uses:' lines and rewrites refs from
  the lock, matching entries by owner/repo (subdirectory actions and
  reusable workflow paths included; local ./ and docker:// refs never
  match). Pinned entries render the round-trippable convention
  'uses: owner/repo@<commit-sha> # <version>'. Line-based rewriting β€”
  never a YAML round-trip β€” so formatting and comments survive.
- marker: the Renovate regex-manager equivalent. A comment annotation
  '<comment> atmos:version <name> [match=<regex>]' marks a line
  (trailing) or the next line (standalone) for in-place rewriting,
  with comment delimiters detected across languages (#, //, ;, --,
  <!--, /*). Pinned entries replace digest tokens.
- template: *.tmpl sources render to a sibling file with the .version
  context; covers comment-hostile formats like JSON.

version.files rules in atmos.yaml declare which paths each manager
maintains (defaults: workflows + templates). New verb
'atmos version track apply' (alias: sync) rewrites everything in one
command; --check fails listing stale paths for CI, and verify now
also fails when managed files drift from the lock.

Co-Authored-By: Claude Fable 5 <[email protected]>

* feat(version): CRUD verbs for managed entries on the format-preserving YAML engine

Phase F of the Version Tracker: 'atmos version track add|set|remove|get'
manage version entries without hand-editing YAML. Edits go through the
pkg/yaml engine (yqlib) so comments, anchors, and formatting in
atmos.yaml survive, targeting the editable config resolved by the same
precedence as 'atmos config set'. Add infers the ecosystem from the
package coordinate (actions/* is github-actions, registry-hosted
images are oci, bare tool names are toolchain, owner/repo is github);
get shows the effective entry with its locked version.

Co-Authored-By: Claude Fable 5 <[email protected]>

* ci(version): demo example and end-to-end workflow for the Version Tracker

examples/demo-version-tracker exercises all three file managers
(github-actions uses: refs, marker-annotated Dockerfile, rendered
template) against a committed lock with concrete versions, so the
whole flow runs offline. The version-tracker.yaml workflow builds
atmos on every PR touching the feature and validates the lifecycle:
verify passes on the committed state, apply --check fails on injected
drift, apply repairs it byte-identically, and verify passes again.

Co-Authored-By: Claude Fable 5 <[email protected]>

* docs(version): Version Tracker docs, blog post, roadmap, and PRD v2 decisions

- New comprehensive command-group page for 'atmos version track'
  (replaces the tracks.mdx draft) covering all 13 verbs, the pinning
  workflow, and CI usage with apply --check + verify.
- managed-versions.mdx updated for v2: pin policy, update-vs-lock
  semantics, blocked status, the three file managers with the marker
  syntax and per-language comment delimiter table, version.files
  rules, provider insecure, CRUD editing, implemented datasources.
- !version function doc: always returns the version; template
  accessors emit the pinned form.
- Changelog post (slug: atmos-version-tracker) and a shipped roadmap
  milestone on the Vendoring & Resilience initiative (pr 2688).
- PRD retitled Atmos Version Tracker with an Implemented Decisions
  section recording the v2 architecture (resolver registry, pinning,
  policy engine, file managers, CRUD, updatecli import).

Co-Authored-By: Claude Fable 5 <[email protected]>

* Refine version tracker conventions

* Use dependencies for version tracker catalog

* fix(version): address tracker review feedback

* [autocommit] formatting fixes

* ci: harden macos k3s workflow

* Add version tracker coverage

* Fix version tracker workflow build step

* Document version tracker subcommands

* Add version tracker candidate filters

* Render `atmos version track list` as a dependency x track version matrix

Replaces the bare list of track names with a pivot table (one row per
dependency, one column per track) so versions can be compared across
tracks at a glance, reusing the existing pkg/list/format table/csv/json/yaml
renderer. Adds --show (desired|locked) and --max-columns flags, and fixes
TrackNames to include the implicit default track so it agrees with
EffectiveEntries.

Also includes:
- docs_generate: fix the default fallback template to read through the
  "config" gomplate datasource instead of bare fields, since
  ProcessTmplWithDatasourcesGomplate binds root "." to the outer Env
  wrapper, not the merged input data.
- pkg/hooks: fix a gocritic rangeValCopy lint finding blocking the
  --new-from-rev=origin/main pre-commit gate.

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* Update stale subcommand description for `version track list`

The track overview table still said "List configured version tracks."
after list.mdx was rewritten for the dependency x track matrix view.

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* Register the !version YAML tag in the pkg/function/tag catalog

The Version Tracker's !version YAML function was wired into
pkg/utils/yaml_utils.go (AtmosYamlFuncVersion) but never added to
pkg/function/tag, the canonical tag catalog used for validation and
"unsupported tag" error messages. This left fntag.AllYAML()/IsValidYAML
out of sync with pkg/utils, failing TestFntagPackage_ContainsAllSupportedYamlTags
and TestAllSupportedYamlTagsList in CI on all three platforms.

Adds the Version constant (and its pkg/function mirror, TagVersion) to
the catalog, and updates the enumerated tag lists in tag_test.go and
tags_test.go to match.

Co-Authored-By: Claude Sonnet 5 <[email protected]>

---------

Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
Co-authored-by: atmos-pro[bot] <173522224+atmos-pro[bot]@users.noreply.github.com>

* test: raise coverage on cmd/{stack,config,vendor}, pkg/yaml, pkg/list/renderer

Codecov flagged this branch's patch coverage at 76.34% (below the informational
80% target) with cmd/stack, cmd/config, and cmd/vendor as the main drag.
Closes the specific gaps it called out with unit tests, following each
package's existing test patterns (no production code changes):

- cmd/stack: 46.8% -> 85.7%
- cmd/config: 61.7% -> 87.2%
- cmd/vendor: 62.1% -> 86.3%
- pkg/yaml: 94.4% -> 96.0%
- pkg/list/renderer: 88.7% -> 92.7%
- pkg/vendoring/version: 94.3% (added direct tests for previously
  indirectly-covered FilterBySemverConstraint/FilterExcludedVersions branches)

Also includes a one-line CodeQL suppression comment in
pkg/provisioner/workdir/fs.go documenting a false-positive
go/weak-sensitive-data-hashing alert (content-checksum hashing, not password
hashing) dismissed on GitHub as alert #5252.

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* fix: Windows-safe relative-path test + CodeQL allocation-overflow finding

TestRelativePathForStackDisplay's "normal relative case" built synthetic
absolute paths from filepath.Separator alone (no drive letter), which
Go's Windows filepath.IsAbs does not recognize as absolute -- causing
relativePathForStackDisplay to hit its early-return branch instead of
computing a relative path. Anchor the fixture to t.TempDir() instead,
which is a real OS-native absolute path on every platform. Production
code was already correct; only the test fixture was platform-unsafe.

Also fixes a CodeQL go/allocation-size-overflow finding flagged as a
new high-severity alert on this PR: make(map[string]any, len(x)+1) in
internal/exec/utils.go. Map size hints are just capacity hints, so
dropping the +1 is a safe no-op fix.

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* fix: CI bootstrap self-hosting + flaky link check failures

The "Version Tracker E2E" job failed with "Unknown command build for
atmos" because .atmos.d/build.yaml's working_directory used the new
!repo-root YAML tag, which doesn't exist in the pinned CI bootstrap
binary (ATMOS_BOOTSTRAP_VERSION: 1.222.0 -- confirmed via `git show
v1.222.0:pkg/function/tag/tag.go`, no repo-root registration). Since
that bootstrap binary is what builds atmos from source in CI, it
couldn't parse the custom command using a tag newer than itself.

Move repo-root resolution into the shell layer instead (git rev-parse
--show-toplevel in scripts/build-atmos.sh and each subcommand's inline
step), so the bootstrap-critical "build" command has no dependency on
any atmos YAML feature newer than the pinned bootstrap version.
Verified atmos build/deps/version all still resolve to the repo root
correctly.

Also fixes "Check Markdown Links": a link to a real, valid GitHub
release page (v1.203.0, verified reachable via gh api and curl) hit a
transient 500 from GitHub's gateway in CI. Added a scoped exclusion to
lychee.toml matching the repo's existing pattern for known-flaky
external URLs.

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* fix: remove remaining !repo-root usage breaking CI bootstrap

The previous fix (5e53cb1) only removed !repo-root from
.atmos.d/build.yaml, but .atmos.d/dev.yaml also used it (in
"dev generate notices" and "dev generate snapshots"), which kept
breaking the Version Tracker E2E job's "atmos build" bootstrap step
with "Unknown command build for atmos".

Root-caused by downloading the actual pinned bootstrap binary
(v1.222.0) and bisecting .atmos.d/*.yaml against it: any file in
.atmos.d/ containing an unsupported YAML tag breaks the *entire*
custom-command merge, not just the offending file -- which is why
"build" vanished from the command list even though build.yaml itself
was already clean.

"notices" already had its repo root resolved internally by
scripts/generate-notice.sh, so working_directory was redundant there;
removed it. "snapshots" needed the cd moved into its inline shell step
via git rev-parse --show-toplevel, matching the pattern already used
in build.yaml/build-atmos.sh.

Verified by running the real v1.222.0 binary against the repo:
`atmos build` now succeeds end-to-end.

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* feat(vendor): make vendor get/set true aliases of vendor config get/set

Makes atmos vendor get|set <component> a literal thin wrapper over
atmos vendor config get|set <path>, matching how atmos stack
get|set|delete|format already alias atmos stack config
get|set|delete|format (same free functions under both entry points).

Previously vendor get/set were NOT aliases: they built a yq
select-by-component-name expression and evaluated it via
atmosyaml.QueryFile/EvalFile, while vendor config took a literal
dot-notation path and called atmosyaml.GetFile/SetFileWithType --
two different underlying primitives that happened to overlap for the
single-component-version use case.

- pkg/vendoring/files.go: add ComponentVersionPath(vendorFile,
  component) resolving a component name to its spec.sources[N].version
  dot-path (matched by name via readVendorSources, so manifest
  ordering still doesn't matter -- the index is resolved fresh on
  every call, never cached).
- cmd/vendor/config.go: extract runVendorConfigGet/runVendorConfigSet
  free functions, mirroring runStackGet/runStackSet.
- cmd/vendor/edit.go: vendorGetCmd/vendorSetCmd now resolve the
  component's path via ComponentVersionPath and delegate to the same
  runVendorConfigGet/runVendorConfigSet the config commands use.
- pkg/vendoring/edit.go deleted (GetComponentVersion,
  selectByComponent, yqStringLiteral -- confirmed dead after the
  refactor). SetComponentVersion had one other caller
  (pkg/vendoring/update.go) and was kept, reimplemented on top of the
  same ComponentVersionPath + atmosyaml.SetFileWithType rather than
  the old yq-expression path, so vendor update's internal
  version-writes also now go through the canonical path-based engine.
- New test proving the alias property end-to-end (same component,
  same manifest, vendor get/set and vendor config get/set produce
  identical results); ported SetComponentVersion's existing test
  cases against the new implementation.

Also documents the previously-undocumented atmos stack config * and
atmos vendor config * command groups (added to the branch after the
original PRD/blog/CLI docs were written, never given Docusaurus
pages), and reframes config get|set|delete|format|list as the
canonical command set for config/stack/vendor, with the non-config
shorthand commands documented as aliases:

- New website/docs/cli/commands/{stack,vendor}/config/ subdirectories
  (get/set/delete/format/list + overview), following the existing
  terraform/cache/ subdirectory precedent.
- New pages for previously-undocumented commands: atmos stack format,
  atmos config list, atmos config format.
- Alias cross-link notes added to the 5 existing flat command pages.
- docs/prd/yaml-editing-get-set.md updated to describe the full
  current surface.

Verified: go build/test clean, atmos lint changed clean, manual
demonstration that vendor get/set and vendor config get/set agree on
the same component without disturbing neighboring sources, and
`cd website && npm run build` passes.

Co-Authored-By: Claude Sonnet 5 <[email protected]>

---------

Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
Co-authored-by: atmos-pro[bot] <173522224+atmos-pro[bot]@users.noreply.github.com>
Andriy Knysh (aknysh) added a commit that referenced this pull request Jul 14, 2026
#2698)

* feat(yaml): format-preserving get/set/delete for config, stacks, and vendor

Add a shared pkg/yaml editing engine built on yqlib (fed raw bytes) that
preserves comments, anchors/aliases, Atmos YAML functions, and Go templates,
with a strict guard that rejects edits which would alter or expand an anchor.

Expose it via three dot-notation command groups:
- atmos config get|set|delete  (edits the active atmos.yaml)
- atmos stack  get|set|delete  (provenance resolves the manifest that defines
  the effective value; --file override)
- atmos vendor get|set         (version pinning by component name)

Includes a PRD, Docusaurus docs, a changelog blog post, and a roadmap
milestone. Supersedes the hardcoded sources[].version writer from the old
feat/vendor-diff-and-update branch.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* test: regenerate CLI snapshots for new config and stack commands

The new top-level `config` and `stack` command groups appear in `atmos --help`,
`help`, and the unknown-command list. Regenerate the affected golden snapshots
via -regenerate-snapshots (content-only change, identical across linux/macos/windows).

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* feat(vendor): add 'vendor update' and 'vendor diff' on the format-preserving engine

atmos vendor update checks each Git-backed source for a newer allowed version
(honoring per-source semver constraints, exclusions, and no_prereleases) and
updates the version field in place via the shared pkg/yaml engine β€” preserving
comments, anchors, and {{.Version}} templates. Supports --check (dry run),
--pull, --component, --tags, and --outdated.

atmos vendor diff shows the Git diff between two versions of a vendored
component without a local checkout.

Both use go-git (no git binary) behind mockable interfaces; tag listing and
ref-to-ref diff are network-isolated in tests. Adds a constraints schema to
AtmosVendorSource, a PRD, command docs, and reuses the existing
Masterminds/semver dependency. Supersedes the YAML-write approach of the old
feat/vendor-diff-and-update branch (~7k lines) with ~1k lines on the shared
engine.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* fix(yaml): address CodeRabbit review on format-preserving editing

Resolve the actionable CodeRabbit findings on the YAML get/set/delete PR:

- yaml.Query: return a legitimate empty-string scalar instead of treating
  it as not-found (detect missing from the pre-trimmed result).
- yaml.atomicWrite: use the shared cross-platform filesystem.WriteFileAtomic
  so an existing file can be replaced on Windows; preserve existing mode.
- yaml.splitDotPath: reject empty path segments (a..b, trailing a.) so a typo
  cannot silently target a different key; refactor into dotPathScanner.
- config: only os.IsNotExist maps to "no editable config"; propagate other
  stat errors with context (firstExistingConfig now returns an error).
- vendoring.SetComponentVersion: gate the "component not found" rewrite on
  errors.Is(ErrYAMLPathNotFound); surface unreadable/invalid-YAML causes.
- stack get: split the read path from the editable resolver (requireEditable)
  so get honors --file and does not fail on inherited/imported values.
- stack edit: escape component-name path segments (BuildComponentYqPath +
  yaml.QuotePathSegment) so dotted/bracketed names address the right node,
  while keeping the raw path for provenance lookups.
- docs: add the mandatory Screengrab block to all new config/stack/vendor
  command pages and register their --help screengrabs in demo-stacks.txt.

Add regression tests for each fix.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* Address vendor review feedback and coverage

* Fix Windows acceptance test and vendor test cleanup

* Normalize vendor report test output

* Add config path listing commands

* Show values in config path lists

* Align config path value previews

* Filter config path lists by pattern

* Add config format commands

* Pin Playwright integration test driver version

* Harden YAML editor edge cases

* Fix markdown link check

* feat(yaml): preserve file style via EditorConfig in pkg/yaml edits

YAML file edits (Set/SetRaw/Delete/Eval) were silently overwriting a
file's existing indent width, line endings, and trailing newline with
package defaults instead of preserving them. Add EditorConfig-aware
style resolution so in-place edits keep the file's detected style,
while FormatFile normalizes to the resolved EditorConfig settings.

Also fixes a gocritic rangeValCopy finding in pkg/hooks/hooks.go
surfaced by the --new-from-rev lint gate on this branch.

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* ci: warm up Go build cache for macos-intel runner

Build (macos-intel) times out at 30m while the ARM macos leg finishes
in ~9m, because setup-go-cache-warmup.yml's nightly matrix only warms
windows and macos (arm64) β€” never macos-15-intel. Every PR build on
that runner starts with a cold GOMODCACHE/GOCACHE, and downloading the
full dependency tree from scratch blows through the timeout, which
then cascades into skipped [k3s-macos] jobs and a failing
"Check k3s matrix result" gate. Add macos-intel to the warmup matrix
so it gets the same nightly cache as the other ephemeral hosted
runners.

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* feat: Atmos Version Tracker β€” managed version tracks with lock file (#2688)

* feat(yaml): format-preserving get/set/delete for config, stacks, and vendor

Add a shared pkg/yaml editing engine built on yqlib (fed raw bytes) that
preserves comments, anchors/aliases, Atmos YAML functions, and Go templates,
with a strict guard that rejects edits which would alter or expand an anchor.

Expose it via three dot-notation command groups:
- atmos config get|set|delete  (edits the active atmos.yaml)
- atmos stack  get|set|delete  (provenance resolves the manifest that defines
  the effective value; --file override)
- atmos vendor get|set         (version pinning by component name)

Includes a PRD, Docusaurus docs, a changelog blog post, and a roadmap
milestone. Supersedes the hardcoded sources[].version writer from the old
feat/vendor-diff-and-update branch.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* test: regenerate CLI snapshots for new config and stack commands

The new top-level `config` and `stack` command groups appear in `atmos --help`,
`help`, and the unknown-command list. Regenerate the affected golden snapshots
via -regenerate-snapshots (content-only change, identical across linux/macos/windows).

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* feat(vendor): add 'vendor update' and 'vendor diff' on the format-preserving engine

atmos vendor update checks each Git-backed source for a newer allowed version
(honoring per-source semver constraints, exclusions, and no_prereleases) and
updates the version field in place via the shared pkg/yaml engine β€” preserving
comments, anchors, and {{.Version}} templates. Supports --check (dry run),
--pull, --component, --tags, and --outdated.

atmos vendor diff shows the Git diff between two versions of a vendored
component without a local checkout.

Both use go-git (no git binary) behind mockable interfaces; tag listing and
ref-to-ref diff are network-isolated in tests. Adds a constraints schema to
AtmosVendorSource, a PRD, command docs, and reuses the existing
Masterminds/semver dependency. Supersedes the YAML-write approach of the old
feat/vendor-diff-and-update branch (~7k lines) with ~1k lines on the shared
engine.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* fix(yaml): address CodeRabbit review on format-preserving editing

Resolve the actionable CodeRabbit findings on the YAML get/set/delete PR:

- yaml.Query: return a legitimate empty-string scalar instead of treating
  it as not-found (detect missing from the pre-trimmed result).
- yaml.atomicWrite: use the shared cross-platform filesystem.WriteFileAtomic
  so an existing file can be replaced on Windows; preserve existing mode.
- yaml.splitDotPath: reject empty path segments (a..b, trailing a.) so a typo
  cannot silently target a different key; refactor into dotPathScanner.
- config: only os.IsNotExist maps to "no editable config"; propagate other
  stat errors with context (firstExistingConfig now returns an error).
- vendoring.SetComponentVersion: gate the "component not found" rewrite on
  errors.Is(ErrYAMLPathNotFound); surface unreadable/invalid-YAML causes.
- stack get: split the read path from the editable resolver (requireEditable)
  so get honors --file and does not fail on inherited/imported values.
- stack edit: escape component-name path segments (BuildComponentYqPath +
  yaml.QuotePathSegment) so dotted/bracketed names address the right node,
  while keeping the raw path for provenance lookups.
- docs: add the mandatory Screengrab block to all new config/stack/vendor
  command pages and register their --help screengrabs in demo-stacks.txt.

Add regression tests for each fix.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* Address vendor review feedback and coverage

* Fix Windows acceptance test and vendor test cleanup

* Normalize vendor report test output

* Add config path listing commands

* Show values in config path lists

* Align config path value previews

* Filter config path lists by pattern

* Add config format commands

* feat(version): managed version tracks with lock file, !version function, and tracks command (WIP)

Phase 1 of the version-management PRD: version catalog in atmos.yaml
(providers/defaults/groups/tracks), versions.lock.yaml, !version YAML
function and .version template context, and the atmos version tracks
command group (list/show/lock/update/status/diff/verify/render).

Co-Authored-By: Claude Fable 5 <[email protected]>

* chore: ignore repo-local .cache/ directory

Co-Authored-By: Claude Fable 5 <[email protected]>

* refactor(version): singular 'version track' namespace, StandardParser flags, pkg-owned context logic

Phase A of the Version Tracker: move the .version template-context and
!version YAML-function bodies from internal/exec into
pkg/version/manager/context.go (internal/exec keeps one-line call
sites), and rebuild the command group as 'atmos version track <verb>'
(alias: tracks) with one verb per file, flags.NewStandardParser, and
data.WriteYAML/WriteJSON output. Track selection now falls back from
positional arg to --track to version.track in atmos.yaml.

Co-Authored-By: Claude Fable 5 <[email protected]>

* feat(version): datasource resolver registry with github and toolchain resolvers

Phase B of the Version Tracker: pkg/version/resolver defines the
Resolver interface (Versions/Pin) with an init-registered datasource
registry and ecosystem aliases. The toolchain resolver moves out of
the manager; new github-tags/github-releases resolvers build on
pkg/github (new ListTags returns tag names with commit SHAs; releases
carry publish timestamps for future cooldown checks). Version
selection (latest/constraint + allow/ignore rules) wraps the
updatecli versionfilter engine; 'latest' is order-independent
highest-SemVer with a datasource-order fallback for non-SemVer tags.

Imports github.com/updatecli/updatecli; MVS impact verified: only
opencontainers/go-digest bumped (indirect, patch).

Co-Authored-By: Claude Fable 5 <[email protected]>

* [autocommit] formatting fixes

* fix(version): never let .version context injection trigger early template processing

Fixes three CI failures on the Version Tracker branch:

- The .version template-context injection used a naive substring check
  that matched '{{ .vars.versioning_enabled }}' and, worse, could turn
  an empty template context non-empty. A non-empty context is what
  gates whole-file template processing in the stack processor, so
  generate-section templates like '{{ .vars.environment }}' were
  evaluated too early with only the version key in scope, breaking all
  terraform_generate_files acceptance tests. AddTemplateContext now
  requires an already-non-empty context (piggybacks only on processing
  that would happen anyway) and matches \.version\b with a word
  boundary. Regression tests added.

- Regenerate describe_config snapshots for the new version.defaults
  schema field (-regenerate-snapshots).

- Allow github.com/opencontainers/go-digest in dependency review: the
  pseudo-version required by updatecli scans as 'Apache-2.0 AND
  CC-BY-SA-4.0', but the CC-BY-SA part covers documentation only.
  Regenerate NOTICE for the new dependencies.

Co-Authored-By: Claude Fable 5 <[email protected]>

* [autocommit] formatting fixes

* refactor(version): move track command group into cmd/version/track package

Follows the cmd/terraform/cache nested-command precedent: the track
package exposes GetTrackCommand() and SetAtmosConfig(), and the parent
version command wires both.

Co-Authored-By: Claude Fable 5 <[email protected]>

* feat(version): SHA/digest pinning with pin policy and OCI resolver

Phase C of the Version Tracker: opt-in 'pin: digest' (alias: sha)
policy field inherits through the defaults -> track -> entry -> group
chain. Locking resolves the immutable identifier alongside the version
(git commit SHA for GitHub tags, sha256 manifest digest for OCI) into
LockEntry.Digest plus the upstream released_at timestamp for future
cooldown checks. A configured pin on a datasource that cannot pin
fails loudly instead of being silently skipped.

The .version template context now yields VersionRef values: String()
emits the digest for pinned entries so '{{ .version.name }}' renders
the pinned form, with .Version/.Digest individually addressable.

New oci-tags/docker-tags resolver on go-containerregistry (tag listing
+ manifest digest pinning), with default-keychain auth and a GHCR
token fallback extracted from internal/exec into pkg/oci for reuse.
Providers gain 'insecure' for local/emulated registries.

Co-Authored-By: Claude Fable 5 <[email protected]>

* test(utils): add !version to the expected YAML tags list

TestAtmosYamlTagsMap_ContainsAllTags asserts the exact tag count; the
Version Tracker's !version function tag makes it 30.

Co-Authored-By: Claude Fable 5 <[email protected]>

* feat(version): enforce update policy β€” strategy caps, cooldown, structured block reasons

Phase D of the Version Tracker: 'atmos version track update' now
advances within each entry's effective policy instead of aliasing
lock. Strategy caps (major/minor/patch relative to the locked version;
pin/digest never advance, refreshing pinned digests only), cooldown
windows against upstream release timestamps (14d/2w/Go durations), and
allow/ignore rules all apply, and every held-back candidate produces a
structured reason (strategy and cooldown blocks reported separately).

Status is now policy-aware: update-available means an update the
policy would take, while a newer version held back by policy reports
'newer-available (blocked)' with the reason β€” and passes verify, since
the locked version is exactly what the policy wants. Update gains
--only to limit the run to named entries.

Co-Authored-By: Claude Fable 5 <[email protected]>

* feat(version): file managers β€” in-place workflow refs, marker comments, template rendering

Phase E of the Version Tracker: a file-manager registry
(pkg/version/managers) keeps project files in sync with the lock, with
pure Plan() output driven by shared Apply/Check drivers.

Three managers ship:
- github-actions: scans workflow 'uses:' lines and rewrites refs from
  the lock, matching entries by owner/repo (subdirectory actions and
  reusable workflow paths included; local ./ and docker:// refs never
  match). Pinned entries render the round-trippable convention
  'uses: owner/repo@<commit-sha> # <version>'. Line-based rewriting β€”
  never a YAML round-trip β€” so formatting and comments survive.
- marker: the Renovate regex-manager equivalent. A comment annotation
  '<comment> atmos:version <name> [match=<regex>]' marks a line
  (trailing) or the next line (standalone) for in-place rewriting,
  with comment delimiters detected across languages (#, //, ;, --,
  <!--, /*). Pinned entries replace digest tokens.
- template: *.tmpl sources render to a sibling file with the .version
  context; covers comment-hostile formats like JSON.

version.files rules in atmos.yaml declare which paths each manager
maintains (defaults: workflows + templates). New verb
'atmos version track apply' (alias: sync) rewrites everything in one
command; --check fails listing stale paths for CI, and verify now
also fails when managed files drift from the lock.

Co-Authored-By: Claude Fable 5 <[email protected]>

* feat(version): CRUD verbs for managed entries on the format-preserving YAML engine

Phase F of the Version Tracker: 'atmos version track add|set|remove|get'
manage version entries without hand-editing YAML. Edits go through the
pkg/yaml engine (yqlib) so comments, anchors, and formatting in
atmos.yaml survive, targeting the editable config resolved by the same
precedence as 'atmos config set'. Add infers the ecosystem from the
package coordinate (actions/* is github-actions, registry-hosted
images are oci, bare tool names are toolchain, owner/repo is github);
get shows the effective entry with its locked version.

Co-Authored-By: Claude Fable 5 <[email protected]>

* ci(version): demo example and end-to-end workflow for the Version Tracker

examples/demo-version-tracker exercises all three file managers
(github-actions uses: refs, marker-annotated Dockerfile, rendered
template) against a committed lock with concrete versions, so the
whole flow runs offline. The version-tracker.yaml workflow builds
atmos on every PR touching the feature and validates the lifecycle:
verify passes on the committed state, apply --check fails on injected
drift, apply repairs it byte-identically, and verify passes again.

Co-Authored-By: Claude Fable 5 <[email protected]>

* docs(version): Version Tracker docs, blog post, roadmap, and PRD v2 decisions

- New comprehensive command-group page for 'atmos version track'
  (replaces the tracks.mdx draft) covering all 13 verbs, the pinning
  workflow, and CI usage with apply --check + verify.
- managed-versions.mdx updated for v2: pin policy, update-vs-lock
  semantics, blocked status, the three file managers with the marker
  syntax and per-language comment delimiter table, version.files
  rules, provider insecure, CRUD editing, implemented datasources.
- !version function doc: always returns the version; template
  accessors emit the pinned form.
- Changelog post (slug: atmos-version-tracker) and a shipped roadmap
  milestone on the Vendoring & Resilience initiative (pr 2688).
- PRD retitled Atmos Version Tracker with an Implemented Decisions
  section recording the v2 architecture (resolver registry, pinning,
  policy engine, file managers, CRUD, updatecli import).

Co-Authored-By: Claude Fable 5 <[email protected]>

* Refine version tracker conventions

* Use dependencies for version tracker catalog

* fix(version): address tracker review feedback

* [autocommit] formatting fixes

* ci: harden macos k3s workflow

* Add version tracker coverage

* Fix version tracker workflow build step

* Document version tracker subcommands

* Add version tracker candidate filters

* Render `atmos version track list` as a dependency x track version matrix

Replaces the bare list of track names with a pivot table (one row per
dependency, one column per track) so versions can be compared across
tracks at a glance, reusing the existing pkg/list/format table/csv/json/yaml
renderer. Adds --show (desired|locked) and --max-columns flags, and fixes
TrackNames to include the implicit default track so it agrees with
EffectiveEntries.

Also includes:
- docs_generate: fix the default fallback template to read through the
  "config" gomplate datasource instead of bare fields, since
  ProcessTmplWithDatasourcesGomplate binds root "." to the outer Env
  wrapper, not the merged input data.
- pkg/hooks: fix a gocritic rangeValCopy lint finding blocking the
  --new-from-rev=origin/main pre-commit gate.

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* Update stale subcommand description for `version track list`

The track overview table still said "List configured version tracks."
after list.mdx was rewritten for the dependency x track matrix view.

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* Register the !version YAML tag in the pkg/function/tag catalog

The Version Tracker's !version YAML function was wired into
pkg/utils/yaml_utils.go (AtmosYamlFuncVersion) but never added to
pkg/function/tag, the canonical tag catalog used for validation and
"unsupported tag" error messages. This left fntag.AllYAML()/IsValidYAML
out of sync with pkg/utils, failing TestFntagPackage_ContainsAllSupportedYamlTags
and TestAllSupportedYamlTagsList in CI on all three platforms.

Adds the Version constant (and its pkg/function mirror, TagVersion) to
the catalog, and updates the enumerated tag lists in tag_test.go and
tags_test.go to match.

Co-Authored-By: Claude Sonnet 5 <[email protected]>

---------

Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
Co-authored-by: atmos-pro[bot] <173522224+atmos-pro[bot]@users.noreply.github.com>

* fix(version-tracker): default track update/lock/status/diff to a table

atmos version track update/lock/status/diff printed raw YAML by
default, unlike `version track list` which already defaults to a
human-readable, TTY-aware table. Give the four verbs the same
pkg/list/renderer-based table default (csv/tsv also supported),
keeping --format=yaml/json as an explicit opt-in for full-fidelity
output (e.g. digests). Update the affected docs and blog example to
match.

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* test: raise coverage on cmd/{stack,config,vendor}, pkg/yaml, pkg/list/renderer

Codecov flagged this branch's patch coverage at 76.34% (below the informational
80% target) with cmd/stack, cmd/config, and cmd/vendor as the main drag.
Closes the specific gaps it called out with unit tests, following each
package's existing test patterns (no production code changes):

- cmd/stack: 46.8% -> 85.7%
- cmd/config: 61.7% -> 87.2%
- cmd/vendor: 62.1% -> 86.3%
- pkg/yaml: 94.4% -> 96.0%
- pkg/list/renderer: 88.7% -> 92.7%
- pkg/vendoring/version: 94.3% (added direct tests for previously
  indirectly-covered FilterBySemverConstraint/FilterExcludedVersions branches)

Also includes a one-line CodeQL suppression comment in
pkg/provisioner/workdir/fs.go documenting a false-positive
go/weak-sensitive-data-hashing alert (content-checksum hashing, not password
hashing) dismissed on GitHub as alert #5252.

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* docs(blog): use verified CSV output in version tracker example

Replace the hand-aligned plain-text table with the actual, tested
--format=csv output (matching the pattern used in the CLI docs pages),
so the blog example is guaranteed accurate rather than a manually
typed approximation.

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* fix: Windows-safe relative-path test + CodeQL allocation-overflow finding

TestRelativePathForStackDisplay's "normal relative case" built synthetic
absolute paths from filepath.Separator alone (no drive letter), which
Go's Windows filepath.IsAbs does not recognize as absolute -- causing
relativePathForStackDisplay to hit its early-return branch instead of
computing a relative path. Anchor the fixture to t.TempDir() instead,
which is a real OS-native absolute path on every platform. Production
code was already correct; only the test fixture was platform-unsafe.

Also fixes a CodeQL go/allocation-size-overflow finding flagged as a
new high-severity alert on this PR: make(map[string]any, len(x)+1) in
internal/exec/utils.go. Map size hints are just capacity hints, so
dropping the +1 is a safe no-op fix.

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* fix: CI bootstrap self-hosting + flaky link check failures

The "Version Tracker E2E" job failed with "Unknown command build for
atmos" because .atmos.d/build.yaml's working_directory used the new
!repo-root YAML tag, which doesn't exist in the pinned CI bootstrap
binary (ATMOS_BOOTSTRAP_VERSION: 1.222.0 -- confirmed via `git show
v1.222.0:pkg/function/tag/tag.go`, no repo-root registration). Since
that bootstrap binary is what builds atmos from source in CI, it
couldn't parse the custom command using a tag newer than itself.

Move repo-root resolution into the shell layer instead (git rev-parse
--show-toplevel in scripts/build-atmos.sh and each subcommand's inline
step), so the bootstrap-critical "build" command has no dependency on
any atmos YAML feature newer than the pinned bootstrap version.
Verified atmos build/deps/version all still resolve to the repo root
correctly.

Also fixes "Check Markdown Links": a link to a real, valid GitHub
release page (v1.203.0, verified reachable via gh api and curl) hit a
transient 500 from GitHub's gateway in CI. Added a scoped exclusion to
lychee.toml matching the repo's existing pattern for known-flaky
external URLs.

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* fix(dev-commands): stop reusing !repo-root across .atmos.d files

The Version Tracker E2E CI job (and every other workflow that
bootstraps atmos via the `atmos build` custom command) was failing
with "Unknown command build for atmos": the stable v1.222.0 bootstrap
binary silently drops custom command registration when the `!repo-root`
YAML tag is used in more than one .atmos.d/*.yaml file (reproduced
locally: same-file reuse is fine, cross-file reuse is not). build.yaml
and dev.yaml both used it; switch dev.yaml's generate/notices and
generate/snapshots commands to `cd "$(git rev-parse --show-toplevel)"`
instead, leaving the tag's only use in build.yaml.

Verified end-to-end: `atmos build` registers and builds again, and the
full demo-version-tracker E2E flow (status/verify/apply --check/apply)
passes against the rebuilt binary.

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* fix: remove remaining !repo-root usage breaking CI bootstrap

The previous fix (5e53cb1) only removed !repo-root from
.atmos.d/build.yaml, but .atmos.d/dev.yaml also used it (in
"dev generate notices" and "dev generate snapshots"), which kept
breaking the Version Tracker E2E job's "atmos build" bootstrap step
with "Unknown command build for atmos".

Root-caused by downloading the actual pinned bootstrap binary
(v1.222.0) and bisecting .atmos.d/*.yaml against it: any file in
.atmos.d/ containing an unsupported YAML tag breaks the *entire*
custom-command merge, not just the offending file -- which is why
"build" vanished from the command list even though build.yaml itself
was already clean.

"notices" already had its repo root resolved internally by
scripts/generate-notice.sh, so working_directory was redundant there;
removed it. "snapshots" needed the cd moved into its inline shell step
via git rev-parse --show-toplevel, matching the pattern already used
in build.yaml/build-atmos.sh.

Verified by running the real v1.222.0 binary against the repo:
`atmos build` now succeeds end-to-end.

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* fix: address CodeRabbit review feedback on version track table output

Restrict --format help text to json/yaml for writeFormatted-only verbs
(show/get/add/set/remove/apply/verify) instead of advertising
table/csv/tsv, which those verbs don't actually support at runtime.
Tighten the update/lock/status/diff default-format test to assert
tab-delimited row shape (catching a JSON regression, not just YAML)
and add --format=tsv coverage. Fix docs wording that implied piped
table output silently becomes CSV.

Also fixes pre-existing lint issues (err113, gosec G115, revive
add-constant) in unrelated files that the repo-wide golangci-lint
pre-commit hook flags against origin/main, so this commit can land
cleanly.

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* chore: drop sentinel errors superseded by upstream merge

ErrInvalidFailureMode/ErrInvalidLogOrder became dead code once the
merge with origin/main adopted the --log-order feature's own
errUtils.ErrInvalidFlagValue-based fix for the same err113 lint
finding in cmd/terraform/options.go.

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* fix(ci): add a third artifact-download attempt for the k3s matrix job

actions/download-artifact doesn't retry ENOTFOUND/ETIMEDOUT (only HTTP
5xx/429), and the existing single manual retry wasn't always enough
for a sustained multi-minute network blip talking to the Actions
artifact API (observed on k3s-macos/helm). Add a third attempt with a
15s backoff between tries, matching the attempt/N retry convention
already used for `atmos test` below in the same job.

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* ci: centralize artifact-download retry into local composite actions

actions/download-artifact only retries HTTP 5xx/429, not connection-level
errors like ENOTFOUND/ETIMEDOUT, which have caused sustained multi-minute
outages on hosted runners (observed on k3s-macos/helm). Rather than
inlining a 3-attempt retry-with-backoff block in every job that needs it,
add two local composite actions:

- download-artifact-retry: generic retry wrapper, with optional
  run-id/github-token passthrough for cross-run downloads (verified safe
  against download-artifact's source: those inputs are no-ops for
  same-run downloads when github-token is empty).
- setup-atmos-install: atmos-specific "install a prebuilt artifact"
  action built on top of it β€” downloads the binary the `build` job
  already produced, sets the executable bit (skipped on Windows), and
  optionally adds the install directory to PATH. Counterpart to
  setup-atmos-build, which compiles from source instead. Derives the
  artifact name from `target` (build-artifacts-<target>) by default,
  with an optional `name` override for compatibility with non-standard
  artifact names.

Converts all 9 raw actions/download-artifact call sites across test.yml
and website-preview-deploy.yml to use these, collapsing what was often
2-3 steps per site into one and centralizing the retry hardening so
future improvements only need to change one file.

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* fix(ci): checkout before invoking local setup-atmos-install action

Local composite actions (uses: ./.github/actions/...) require the repo
to already be checked out -- unlike marketplace actions referenced by
SHA, which download independently. The floci, floci-go, and
container-step jobs called setup-atmos-install before their checkout
step, which worked when that step was the raw actions/download-artifact
marketplace action but broke once it became a local action:

  Can't find 'action.yml', 'action.yaml' or 'Dockerfile' under
  '.../.github/actions/setup-atmos-install'. Did you forget to run
  actions/checkout before running your local action?

Reorder checkout first in all three jobs, matching every other
converted call site.

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* fix: validate --format before empty-rows short-circuit in version track output

Address CodeRabbit full-review findings on PR #2698: writeRows silently
accepted an unsupported --format (e.g. toml) when zero rows matched
(e.g. an unmatched --group), instead of returning ErrUnsupportedFormat
like the non-empty path. Also fixes stale piped-vs-CSV wording in the
version tracker blog post to match the sibling command docs.

Co-Authored-By: Claude Sonnet 5 <[email protected]>

---------

Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
Co-authored-by: atmos-pro[bot] <173522224+atmos-pro[bot]@users.noreply.github.com>
Co-authored-by: Andriy Knysh <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

minor New features that do not break anything size/xxl stacked Stacked

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant