Repository navigation
Allow workflow shell commands to be any (complex) shell commands - #277
Merged
Merged
Conversation
stoned
requested review from
FlorianS (florian0410) and
Joe Niland (joe-niland)
December 15, 2022 19:07
Erik Osterman (Cloud Posse) (osterman)
added a commit
that referenced
this pull request
Aug 19, 2026
Dependabot alert #277 (GHSA-hfg8-hc9c-6c3h, high): a crafted tar archive could write outside the extraction directory in github.com/moby/go-archive < v0.3.0. v0.2.0 -> v0.3.0 is a semver-minor bump, not blocked by .github/dependabot.yml's major-version-only ignore rule. Transitively pulls moby/sys/sequential v0.7.0 and moby/sys/user v0.4.1 via `go mod tidy`. Co-Authored-By: Claude Sonnet 5 <[email protected]>
Erik Osterman (Cloud Posse) (osterman)
added a commit
that referenced
this pull request
Aug 19, 2026
Remediates GHSA (Dependabot alert #277): a crafted tar archive could write outside the extraction directory. Indirect dependency only; also pulls in moby/sys/sequential v0.7.0 and moby/sys/user v0.4.1 via go mod tidy. Minor-version bump, within dependabot.yml policy. Co-Authored-By: Claude Sonnet 5 <[email protected]>
Erik Osterman (Cloud Posse) (osterman)
added a commit
that referenced
this pull request
Aug 19, 2026
Remediates Dependabot alert #277. Transitive dependency via testcontainers-go, pulled in by pkg/container. Minor version bump, within dependabot.yml's policy (only semver-major bumps are ignored). Co-Authored-By: Claude Sonnet 5 <[email protected]>
Erik Osterman (Cloud Posse) (osterman)
added a commit
that referenced
this pull request
Aug 19, 2026
Resolves GHSA-hfg8-hc9c-6c3h (Dependabot alert #277): a crafted tar archive could write outside the extraction directory in versions < 0.3.0. Pulled in transitively via testcontainers-go in pkg/container's test suite.
Erik Osterman (Cloud Posse) (osterman)
added a commit
that referenced
this pull request
Aug 19, 2026
…ing, digest auto-bumping Consolidates govulncheck and Semgrep into codeql.yml (both produce SARIF, same trigger shape as CodeQL/golangci-lint already there), adds TruffleHog for git-history secret scanning, adds a Trivy config scan of the Dockerfile alongside hadolint, adds secret scanning to the existing Trivy image scan in build.yml, wires up Dependabot's docker ecosystem to auto-bump the digest-pinned base images, and strips unnecessary setuid/setgid binaries from the Dockerfile (verified via local build + `find -perm /6000`, confirmed atmos still runs). Also includes the moby/go-archive dependency bump (fixes Dependabot alert #277 / GHSA-hfg8-hc9c-6c3h, a tar extraction path-traversal CVE), README.yaml/pre-commit/action.yml changes from a parallel session on this branch, and a pre-existing README.md EditorConfig indentation fix (unrelated list-item spacing in the Contributing section) required to get any commit past the repo-wide validate-editorconfig pre-commit hook. Co-Authored-By: Claude Sonnet 5 <[email protected]>
Michael Pursifull (arcaven)
pushed a commit
to arcaven/atmos
that referenced
this pull request
Aug 19, 2026
…oudposse#2942) * fix(ci): synthesize a fallback test-run row when per-run lines aren't captured ParseTestOutput's summary-line fallback (triggered when output buffering drops per-run "run ... pass/fail" lines) set Pass/Fail/Total but left Runs empty, so the CI summary's results table silently disappeared on an otherwise normal run -- only badges and the repro command still rendered. Synthesize one aggregate row so the table always renders. Co-Authored-By: Claude Sonnet 5 <[email protected]> * feat(container): share a per-stack network across containers, emulators, and run steps components.container had no automatic networking -- ExecuteUp and ExecuteRun never populated container Networks, so every plain container landed on the default bridge with no inter-container DNS. The emulator component type already solved this for itself (Manager.attachSharedNetwork). Generalize that mechanism into pkg/container (StackNetworkName/Alias, AttachSharedNetwork, and the moved current-container-network detection) so components.container, emulator components, and stack-scoped workflow `type: container, action: run` steps all join one shared per-stack network and resolve each other by a `<stack>-<name>` DNS alias, with no configuration required -- similar to the default network `docker compose` creates for a project. Also broadens the emulator's job-container endpoint detection to any containerized run, not just GITHUB_ACTIONS, fixing `connection refused` when reproducing a socket-mounted job container locally. Co-Authored-By: Claude Sonnet 5 <[email protected]> * docs(changelog): announce shared per-stack container networking Add the blog post and roadmap entry required for a minor-labeled release: containers, emulators, and workflow run steps now resolve each other by a <stack>-<component> DNS alias with zero configuration. Also fixes a pre-existing editorconfig indentation issue in git-server-emulator.md that was blocking commits. Co-Authored-By: Claude Sonnet 5 <[email protected]> * docs(roadmap): link PR cloudposse#2942 to the shared-networking milestone Co-Authored-By: Claude Sonnet 5 <[email protected]> * fix(container): defer to an explicit --network override in run_args AttachSharedNetwork's --network flag was injected unconditionally, so a workflow `type: container, action: run` step already using run_args: [--network=host] (or any other explicit --network) would start failing outright once it also got the shared-network attachment -- Docker/Podman reject combining a network mode like host/none with an additional --network. New HasExplicitNetworkOverride guards this: an explicit --network in run_args always wins and the shared network is skipped for that step. Co-Authored-By: Claude Sonnet 5 <[email protected]> * fix(cmd): address CodeRabbit findings on PR cloudposse#2942 - container: PreferCurrentContainerNetwork now honors an explicit ATMOS_EMULATOR_USE_CURRENT_CONTAINER_NETWORK=true override directly instead of still gating it through ProcessRunsInContainer's heuristic. - container: sanitizeNetworkToken appends a stable hash suffix whenever it substitutes a character, so stack names like "deploy/prod" and "deploy-prod" no longer collide onto the same network/alias. - container: lifecycle.go's upWithRuntime documents and logs (Debug) when it reuses an existing container whose desired config now has network attachments, since reconciling an already-running container's live network membership is out of scope here. - runner/step: wrap the container run step's stack-resolution error with a new ErrContainerStepResolveStack sentinel. - docs: fix stale bare gitserver URLs in git-server-emulator.md (the real address is a K8s Service FQDN), clarify the <stack>-<component> vs <stack>-<step-name> alias distinction across docs/roadmap, and correct the Docker Compose teardown comparison in components/container.mdx. Co-Authored-By: Claude Sonnet 5 <[email protected]> * fix(container): include component/stack in reused-network log hint logReusedNetworkMismatch told operators to run `atmos container down` without identifying which container to target. Include config.Component and config.Stack so the logged remediation command is copy-pasteable. Co-Authored-By: Claude Sonnet 5 <[email protected]> * test: close Codecov patch-coverage gaps on PR cloudposse#2942 Adds behavioral coverage for previously-uncovered branches added earlier in this PR: CurrentContainerNetwork's hostname-failure and Inspect-failure/nil fallbacks, AttachSharedNetwork's current-container-network preference path, logReusedNetworkMismatch's remediation-hint content, the container run step's stack-resolution error propagation, and defaultProcessRunsInContainer's cgroup-marker branches. Introduces a small currentHostname (os.Hostname) test seam to make the hostname-failure branch exercisable. Co-Authored-By: Claude Sonnet 5 <[email protected]> * fix(container): stub marker-file check instead of skipping on containerized CI hosts TestDefaultProcessRunsInContainer used t.Skip when the test host itself had /.dockerenv or /run/.containerenv, silently skipping all cgroup-marker subtests on containerized CI runners. Add a markerFileExists seam (mirroring readProcFile) so the marker-file short-circuit is stubbable, letting the cgroup subtests run deterministically everywhere, plus a new subtest covering the marker-file-present short-circuit itself. * test: cover defaultMarkerFileExists directly on PR cloudposse#2942 The markerFileExists test seam let every other test stub out the real os.Stat-backed implementation, leaving it with zero direct coverage. Assert it reports true/false for existing/missing paths. Co-Authored-By: Claude Sonnet 5 <[email protected]> * fix(cmd): address CodeRabbit findings on PR cloudposse#2942 - container: HasExplicitNetworkOverride now also detects Podman/Docker's --net alias for --network (both --net value and --net=value forms), so run_args: [--net=host] is correctly recognized as an explicit override and no longer gets a conflicting shared-network attachment injected alongside it. - container: firstReachableNetwork now excludes Docker's default "bridge" network, not just "", "host", and "none". The default bridge doesn't support --network-alias/embedded DNS, so picking it as the "current container network" would make AttachSharedNetwork report success while cross-container name resolution silently never worked. - docs: fix the shared-network blog example to use the container port (80) instead of the host-published port (8080) for peer-to-peer traffic, and soften the roadmap entry's claim from unconditional name resolution to best-effort/distinct-names, consistent with the existing fix-log's documented limitations. Co-Authored-By: Claude Sonnet 5 <[email protected]> * fix(security): resolve CodeQL allocation-size-overflow in mergeEnvSlices CodeQL flagged make(map[string]string, len(base)+len(overlay)) and make([]string, 0, len(base)+len(overlay)) in pkg/workflow/container.go (alerts #5326-#5329). Size hints to len(base) alone, matching the single-len() capacity-hint idiom used elsewhere in this repo. * fix(security): bump github.com/moby/go-archive to v0.3.0 Resolves GHSA-hfg8-hc9c-6c3h (Dependabot alert cloudposse#277): a crafted tar archive could write outside the extraction directory in versions < 0.3.0. Pulled in transitively via testcontainers-go in pkg/container's test suite. --------- Co-authored-by: Claude Sonnet 5 <[email protected]>
Michael Pursifull (arcaven)
pushed a commit
to arcaven/atmos
that referenced
this pull request
Aug 19, 2026
…oudposse#2923) * docs(tutorials): add guide for centralizing developer cloud access via Atmos Developers today distribute AWS SSO access as ad hoc [profile] blocks in Slack/wikis, which drift stale and don't scale to multi-cloud orgs. This tutorial shows how to centralize an org's auth: config in one private repo, import it into every project via a pinned `import:`, and get zero-setup access for AWS, Azure, and GCP with no manual credential distribution. Co-Authored-By: Claude Sonnet 5 <[email protected]> * docs(tutorials): address CodeRabbit review on centralized-auth-config - Clarify that atmos auth shell scopes credential env vars to the child shell rather than revoking the underlying credential files on exit. - Note that private central-repo imports require GitHub auth (gh auth login or a configured token) before "no other setup required" applies. - Distinguish branch-tracking (immediate) from pinned-tag (next ref bump) central-repo updates instead of implying both propagate automatically. Co-Authored-By: Claude Sonnet 5 <[email protected]> * fix(docs): correct token-resolution and identity-selector claims in centralized-auth-config tutorial A field test found the tutorial's central "gh auth login is enough" claim is false for its own git:: import syntax (only ATMOS_PRO_GITHUB_TOKEN / ATMOS_GITHUB_TOKEN / GITHUB_TOKEN are actually checked, verified against pkg/downloader/custom_git_detector.go), compounded by a completely silent import-failure mode (log.Debug + continue, exit 0, per pkg/config/imports.go). Also fixes a misleading "interactive selector" claim that doesn't hold given the tutorial's own default:true example, and documents that this import form has no cache and re-clones on every command. See docs/fixes/2026-08-11-centralized-auth-config-tutorial-corrections.md for the full field-test findings and validation. Co-Authored-By: Claude Sonnet 5 <[email protected]> * fix(ci): correct editorconfig indentation in fix-log numbered list The pre-commit "Validate EditorConfig" hook and the "Validation (affected)" CI job both failed on docs/fixes/2026-08-11-centralized-auth-config-tutorial-corrections.md: its numbered-list continuation lines used 3-space indentation (aligned under "1. "), which isn't a multiple of the repo's indent_size=2 for Markdown. Re-indented to 4 spaces. Verified locally with the exact command the hook runs: atmos validate --affected --exclude 'tests/fixtures/**' --exclude '**/*.go' --format rich. Co-Authored-By: Claude Sonnet 5 <[email protected]> * docs(tutorials): address second CodeRabbit review round on centralized-auth-config - Clarify the Tabs intro: import syntax/workflow are identical across clouds, but the import path and providers:/identities: block must match the selected cloud (aws/, azure/, gcp/) — the prior wording could read as "reuse the AWS import for any tab." - Add ATMOS_PRO_GITHUB_TOKEN to the Troubleshooting auth-error check, matching its highest-priority position in the token chain documented in step 3. Co-Authored-By: Claude Sonnet 5 <[email protected]> * fix(auth,config): gh CLI token fallback, visible import failures, import caching Three real bugs found while field-testing the centralized-auth-config tutorial (see docs/fixes/2026-08-11-centralized-auth-config-tutorial-corrections.md): - pkg/downloader/custom_git_detector.go: CustomGitDetector.resolveToken never fell back to `gh auth token` for git:: clone imports, unlike the sibling pkg/github.GetGitHubToken() path (used for plain HTTPS/API fetches). A developer authenticated only via `gh auth login` got an unauthenticated clone against private repos. Added the same CLI fallback as the last resort tier, reusing pkg/github's existing ATMOS_GITHUB_CLI/commander machinery via a newly exported GetGitHubTokenFromCLI() and a SetCommanderForTesting() test seam. - pkg/config/imports.go: a failed `import:` entry (typo'd ref, unreachable host, unauthenticated private repo) was logged at Debug and swallowed, so atmos continued silently with an empty/partial config and exit 0 - indistinguishable from "nothing configured". Elevated the two resolve/merge-failure log points to Warn, which is visible at the default log level, without changing the existing non-fatal-by-design behavior (verified TestMergeFiles_ImportMergeErrorIsNonFatal still passes; it covers a different, untouched swallow point). - pkg/stack/imports/remote.go: root atmos.yaml `import:` entries using `git::...//subpath?ref=...` never cached - every atmos command re-cloned. The caching mechanism already existed for stack-manifest imports via the top-level `imports.ttl` atmos.yaml setting (AtmosConfiguration.Imports.TTL); RemoteImporter.Resolve just never read it, hardcoding an empty ttl. One-line fix: read r.atmosConfig.Imports.TTL instead. Default (unset) behavior is unchanged; setting `imports: { ttl: ... }` now also caches root-level imports, using the same mechanism, cache directory, and semantics as stack imports. All three verified live against a real git-repo fixture (see prior field-test conversation) in addition to new/extended unit tests. Co-Authored-By: Claude Sonnet 5 <[email protected]> * docs(blog,roadmap): announce remote-import auth fallback and caching (PR cloudposse#2923) Blog post covering the three fixes: gh CLI token fallback for private git:: imports, visible warnings on failed imports, and TTL caching for root atmos.yaml imports. Links a new milestone into the auth initiative's roadmap (progress stays 94% — 33/35 shipped, unchanged by rounding). Co-Authored-By: Claude Sonnet 5 <[email protected]> * docs(tutorials): apply reviewer-suggested edits to centralized-auth-config Sharpen the task-runner framing paragraph and reword "Rotating" to "Updating" for the role-name bullet, per Erik's inline GitHub suggestions. Co-Authored-By: Claude Sonnet 5 <[email protected]> * fix(auth,config): gh CLI token fallback, visible import failures, import caching Third CodeRabbit review round on PR cloudposse#2923's code fixes found one real security bug and two doc-accuracy issues: - pkg/config/imports.go: the new Warn-level "failed to resolve import" log passed the raw importPath, which can embed credentials (git::https://user:token@...). Now sanitized via a newly exported config.SanitizeImport, matching the merge logs' existing treatment. While fixing this, found and fixed the same unsanitized-credentials pattern in pkg/config/adapters/local_adapter.go's own Debug log (a second, related leak CodeRabbit didn't flag but the new regression test caught). Added TestProcessImports_FailedImportLogSanitized to cover both. - website/docs/cli/configuration/imports.mdx, website/blog/2026-08-11-remote-import-github-auth-and-caching.mdx, website/src/data/roadmap.js: scoped all "imports.ttl caches root imports" claims to git:: imports with a subdirectory specifically - RemoteImporter.Resolve only threads ttl through that path; plain remote URLs and git imports without a subdirectory use a separate, non-expiring cache untouched by this setting. - docs/fixes/2026-08-11-centralized-auth-config-tutorial-corrections.md: restructured to clearly separate pre-fix findings (1, 2, 4 - now fixed in code) from the doc-only finding (3) and from final behavior, instead of reading as if the bugs were still present. - website/docs/tutorials/centralized-auth-config.mdx: reverted the "gh auth login alone isn't enough" framing added during the docs-only pass now that the code fix makes gh auth login sufficient again, and updated the "no cache" note now that imports.ttl covers this import form. Co-Authored-By: Claude Sonnet 5 <[email protected]> * test(config): cover production LocalAdapter in credential-sanitization regression test Fourth CodeRabbit review round on PR cloudposse#2923: - pkg/config/adapters/adapters_test.go: the earlier regression test (TestProcessImports_FailedImportLogSanitized) only exercised the test-only mock adapter setupTestAdapters() installs, not the actual production pkg/config/adapters.LocalAdapter - a regression in the real fix could pass that test. Added TestLocalAdapter_ResolveFailureLogSanitized, which calls LocalAdapter{}.Resolve directly. Verified it actually catches the regression by temporarily reverting the SanitizeImport call in local_adapter.go, confirming the test fails, then restoring the fix. - docs/fixes/2026-08-11-centralized-auth-config-tutorial-corrections.md: the Validation section implied the gh-auth-token CLI fallback (finding 1) was verified live via the git::file:// fixture repo - that fixture only exercises import resolution, not the GitHub token path. Split into two accurate statements: findings 2/4 verified live via the fixture; finding 1 verified via mocked-executor unit tests and code inspection. Co-Authored-By: Claude Sonnet 5 <[email protected]> * docs(blog): rewrite remote-import post in ASD-STE100 style Rewrote in Simplified Technical English (short sentences, active voice, no contractions, no dashes, no e.g./i.e.) per Erik's request. Also corrected the "GitHub CLI auth already worked" claim: verified that stack-manifest imports and atmos.yaml imports share the exact same CustomGitDetector code path, so neither had the gh CLI fallback before this PR's fix - what already had it is a different path (pkg/github.GetGitHubToken, used for toolchain installs and PR artifact downloads). Framed the post around that verified fact instead. Co-Authored-By: Claude Sonnet 5 <[email protected]> * fix(imports): unify TTL caching across all remote import forms imports.ttl only governed git:: imports that use a subdirectory (resolveGitSubdir/ensureSourceDir). Plain remote URLs and git:: imports without a subdirectory went through a separate path (RemoteImporter.Download, backed by pkg/cache.FileCache) that cached content forever with no expiry, and never read imports.ttl. pkg/cache.FileCache is shared well beyond remote imports (auth credential caching, container runtime discovery, Helm repo cache, provisioner lockfiles, HTTP proxy store), so its core Get/Set/ GetOrFetch semantics were left untouched to avoid risk to those other consumers. Instead, Download() now tracks freshness the same way ensureSourceDir does for the git-subdir path - a JSON sidecar with an UpdatedAt timestamp - but stored as a second FileCache entry local to this package, not a filesystem-level change. Default (ttl unset) behavior is unchanged for both import forms. Only setting imports.ttl changes anything, and it now changes both uniformly: git:: subdirectory imports get reused across invocations instead of always re-cloning, and plain URL imports expire after ttl instead of being cached forever. Updated the docs/blog/roadmap claims that scoped this setting to git:: subdirectory imports only, and added a new fix-log record documenting this as a follow-on to PR cloudposse#2923's original caching fix. Co-Authored-By: Claude Sonnet 5 <[email protected]> * docs(tutorials): apply self-review edits to centralized-auth-config Tighten wording per PR review suggestions and call out the new-hire onboarding pain point ad hoc AWS profiles create. * test(coverage): raise patch coverage on the import-caching/auth-fallback fixes Codecov's patch check was failing at 84.61% (target 85%). Added tests for the specific lines/branches it flagged as uncovered: - pkg/config/imports.go: mergeResolvedImports' merge-failure Warn log path (previously log.Trace) - feeds it malformed YAML alongside a valid file, asserts the failure logs with a sanitized import path and that the valid file still merges afterward. - pkg/github/token.go: SetCommanderForTesting's own contract - asserts it swaps the package-level commander in, that GetGitHubTokenFromCLI observes the swap, and that restore() puts the exact original back. - pkg/stack/imports/remote.go: downloadCacheFresh's two defensive branches - an empty ttl is never treated as fresh even with stored metadata present, and corrupt/unparsable metadata degrades to "not fresh" rather than erroring. One line intentionally left uncovered: writeDownloadMeta's json.Marshal error branch. sourceMetadata is just a string and a time.Time; Marshal cannot fail on it without fabricating an unrealistic type, so this is unreachable defensive code, not a real gap. Verified: all three previously-flagged coverage lines now show covered in a fresh profile: `atmos fix coverage origin/main`; full test suite for all four touched packages passes; the authoritative `./custom-gcl run --new-from-rev=origin/main` lint gate reports 0 issues. Co-Authored-By: Claude Sonnet 5 <[email protected]> * [autocommit] formatting fixes * fix(ci): pin deterministic license URLs for go-licenses subpath drift go-licenses non-deterministically drops the vN subpath segment from the GitHub blob URL for a handful of major-version-suffixed modules (evanphx/json-patch/v5, googleapis/gax-go/v2, blang/semver/v4, aws-sdk-go-v2/internal/endpoints/v2), depending on the environment's module cache state. This reproduced consistently in CI (Linux) while resolving correctly locally, causing the Review Dependency Licenses gate to report a spurious NOTICE diff unrelated to any dependency change on this branch. Extends the existing REPO_OVERRIDES table (same pattern already used for cloud.google.com/go and gopkg.in modules) so these four resolve to a deterministic, version-pinned URL in every environment. Co-Authored-By: Claude Sonnet 5 <[email protected]> * fix(ci): correct NOTICE URLs reverted by autocommit bot's environment The atmos-pro[bot] autocommit ran on the same CI (Linux) environment that non-deterministically resolves these four vN-suffixed modules without their subpath segment, so its "formatting fix" reintroduced the exact broken URLs the prior commit's REPO_OVERRIDES addition targets. Regenerating with the fixed script restores the correct, deterministic URLs. Co-Authored-By: Claude Sonnet 5 <[email protected]> * fix(toolchain): retry version-prefix fallback after transient download failures The toolchain installer's version-prefix fallback (try the alternate 'v' prefix when a release asset isn't found) only triggered on a clean HTTP 404. In CI, opentofu/[email protected] installs were failing consistently: Atmos requests the release tag without its 'v' prefix (the aqua registry entry for opentofu doesn't set version_prefix, and Atmos intentionally doesn't default it — see the comment in versionStringsForTool), and under concurrent CI load GitHub served 503/timeout for that wrong URL instead of a fast 404, so the fallback never got a chance to try the correct `v1.12.2` URL. Tags the retry-exhausted error path with the existing ErrDownloadRetryable sentinel and broadens the fallback trigger to include it alongside a clean 404, so a wrong-prefix URL that happens to surface as a transient 5xx/timeout still recovers. Unrelated to this PR's own changes — found while diagnosing repeated, non-transient CI failures across several unrelated jobs that all install opentofu via the toolchain. Co-Authored-By: Claude Sonnet 5 <[email protected]> * fix(blog): correct self-contradictory problem framing in remote-import post The opening claimed centralizing config via a remote import "causes three problems, no matter which tool a team uses" — an absolute claim that contradicted the post's own premise that many teams already do this successfully. The three items listed were actually Atmos-specific gaps (matching the accurate "## The Problem" section further down), not universal defects of the pattern itself. Rewrote the intro to establish the real precedent (Mergify and Dependabot already support extending config from a shared repo; general-purpose tools otherwise need a cumbersome git submodule or subtree) and correctly scope the three gaps to Atmos's own remote-import resolution, which is what this PR fixes. Co-Authored-By: Claude Sonnet 5 <[email protected]> * fix(coderabbit): address CodeRabbit round on PR cloudposse#2923 - pkg/github/token.go: rename the perf.Track metric label to match the now-exported GetGitHubTokenFromCLI function name. - pkg/toolchain/installer/download_test.go: assert the primary URL is actually retried downloadRetryMaxAttempts times before the version-prefix fallback engages, so a regression that falls back after the first 503 would fail the test. - pkg/config/import_test.go: capture logs at WarnLevel (not DebugLevel) in both silent-failure regression tests, so a regression from log.Warn back to log.Debug would fail them instead of passing silently. - pkg/downloader/token_injection_test.go: convert the three CLI-fallback precedence cases to a table-driven test. - docs/fixes/2026-08-11-centralized-auth-config-tutorial-corrections.md: correct the finding-4 and Stage-2 cache-scope statements, which described the pre-follow-up-fix state (git:: subdirectory imports only) and were left stale after the same PR's later fix unified TTL caching across all remote import forms. Co-Authored-By: Claude Sonnet 5 <[email protected]> * fix(security): remediate 4 CodeQL go/allocation-size-overflow alerts mergeEnvSlices sized both a map and a slice using len(base)+len(overlay) as the capacity hint, which CodeQL flags as a potential integer overflow (alerts #5326-#5329). Follows the established fix from 0e32451: use a single len() as the capacity hint rather than summing two, since it's only a pre-allocation hint and Go grows the map/slice automatically as needed. Co-Authored-By: Claude Sonnet 5 <[email protected]> * fix(coderabbit): correct stale silent-failure and cache-mechanism claims - website/docs/tutorials/centralized-auth-config.mdx: the troubleshooting section still said a failed import was silent and required ATMOS_LOGS_LEVEL=Debug to see. That was pre-fix behavior; imports.go now logs the failure at Warn (default level). Updated to say the warning shows up without setting anything. - website/blog/2026-08-11-remote-import-github-auth-and-caching.mdx: the caching bullet claimed imports.ttl "reuses the same caching mechanism and cache directory as stack configuration imports." The two remote-import forms actually track freshness differently under the hood (a marker file in the cloned directory for git:: subdirectory imports, a cache entry for plain URLs / git:: without a subdirectory) — only the ttl policy is shared, not the mechanism. Reworded to describe the shared policy without overclaiming a shared mechanism. Co-Authored-By: Claude Sonnet 5 <[email protected]> * fix(security): bump github.com/moby/go-archive to v0.3.0 Remediates Dependabot alert cloudposse#277. Transitive dependency via testcontainers-go, pulled in by pkg/container. Minor version bump, within dependabot.yml's policy (only semver-major bumps are ignored). Co-Authored-By: Claude Sonnet 5 <[email protected]> --------- Co-authored-by: Claude Sonnet 5 <[email protected]> Co-authored-by: atmos-pro[bot] <173522224+atmos-pro[bot]@users.noreply.github.com>
Michael Pursifull (arcaven)
pushed a commit
to arcaven/atmos
that referenced
this pull request
Aug 19, 2026
… schema rejected (cloudposse#2953) * fix(schemas): accept documented backend types and other fields the manifest schema silently rejected Fixes cloudposse#2919: the stack-manifest JSON Schema hardcoded an 8-value backend_type enum, silently rejecting consul/cos/http/kubernetes/oss/pg even though they're documented as supported. A field test over the fix found the same bug class elsewhere (overrides.hooks/generate/secrets/auth/retry/required_*, component- level retry, required_version/required_providers, source.ttl, container_runtime.provider: auto), one field the schema was too permissive for (workflow_step.output.mode: raw), a root-schema oneOf bug that made workflows: and vars:/settings: mutually exclusive, and a silent (non-erroring) backend_type/backend key-mismatch bug. All fixed together, with regression tests at both the schema-unit and CLI level. Co-Authored-By: Claude Sonnet 5 <[email protected]> * fix(ci): exclude flaky LSP-spec and AWS STS link-check hosts CI's Check Markdown Links job failed on two connection resets: microsoft.github.io/language-server-protocol and the AWS STS GetFederationToken API reference. Both return 200 outside CI; excluded per the repo's existing precedent for CI-runner connection flakiness. Co-Authored-By: Claude Sonnet 5 <[email protected]> * fix(schemas): address CodeRabbit review feedback on PR cloudposse#2953 - Extract checkTerraformBackendTypeMatch helper to keep processTerraformBackend within the 60-line function limit. - Add "" to workflow_step.output.mode's schema enum (Go's validateParallelOutput already accepted it as equivalent to unset). - Isolate the "rejects unrecognized backend key" test case so it fails only for the backend key, not the backend_type enum. - Drop the redundant "website" schema-copy entry from this PR's new test tables (byte-identical to "embedded" by design, so it never caught drift; correct the fix-log's copy count to match). - Fix an MD018 markdownlint violation in the fix-log (issue reference starting a line). Co-Authored-By: Claude Sonnet 5 <[email protected]> * fix(security): bump github.com/moby/go-archive to v0.3.0 Remediates GHSA (Dependabot alert cloudposse#277): a crafted tar archive could write outside the extraction directory. Indirect dependency only; also pulls in moby/sys/sequential v0.7.0 and moby/sys/user v0.4.1 via go mod tidy. Minor-version bump, within dependabot.yml policy. Co-Authored-By: Claude Sonnet 5 <[email protected]> * fix(schemas): fix backend_type/backend mismatch in plan-diff fixture The plan-diff CLI test fixture declared backend_type: local but had an s3 backend block, which this PR's new backend_type/backend key-mismatch check now correctly rejects instead of silently falling back to an empty backend. Also sharpens the fix-log's follow-up notes and documents the CI-generated (not checked-in) website schema path per CodeRabbit review feedback on PR cloudposse#2953. Co-Authored-By: Claude Sonnet 5 <[email protected]> * docs(stacks): document the HTTP backend Adds an HTTP Backend section to the backend-config partial, folded in from @MacherelR's PR cloudposse#2920 (which this PR supersedes with a broader fix covering http plus 5 other missing backend types across all 3 schema copies). Credits the original contribution rather than losing it when superseding the PR. Co-Authored-By: Claude Sonnet 5 <[email protected]> * docs(stacks): expand HTTP backend credential persistence warning CodeRabbit flagged that the warning only mentioned backend.tf.json, but the same plaintext credentials also persist in .terraform/terraform.tfstate and saved plan files. Recommend TF_HTTP_USERNAME/TF_HTTP_PASSWORD env vars instead of embedding credentials in the backend config. Co-Authored-By: Claude Sonnet 5 <[email protected]> --------- Co-authored-by: Claude Sonnet 5 <[email protected]>
Michael Pursifull (arcaven)
pushed a commit
to arcaven/atmos
that referenced
this pull request
Aug 19, 2026
…dup (cloudposse#2955) * refactor(lint): replace bash lint orchestration with go-native Mage tooling Ports the bash staleness-check/build orchestration for custom-gcl, lintroller, and gomodcheck (in .atmos.d/lint.yaml and scripts/run-custom-golangci-lint.sh) to Go targets in magefiles/, invoked via `go tool mage` (Go 1.24+ tool directive). Fixes latent POSIX-only staleness checks (find -newer) that silently never worked on Windows, and replaces a hand-rolled cached-binary staleness check for gomodcheck with a simpler `go run` (the pre-commit hook already did this, unifying both call sites for the first time). The never-build-custom-gcl-in-a-pre-commit-hook invariant (previously fixed after a worktree corruption incident) is preserved exactly. Co-Authored-By: Claude Sonnet 5 <[email protected]> * fix(security): remediate CodeQL allocation-size-overflow alerts Replace make(T, len(base)+len(overlay)) capacity hints with max(len(base), len(overlay)) in mergeEnvSlices to avoid the summed-len overflow pattern CodeQL flags (go/allocation-size-overflow, alerts #5326-#5329). max() of two independently-safe lengths carries no overflow risk, unlike their sum. Also fixes pre-existing EditorConfig indentation (3-space list continuations under numbered items, want multiples of 2) in tools/lintroller/README.md that was blocking this commit's affected-file validation hook. Co-Authored-By: Claude Sonnet 5 <[email protected]> * fix(mage): address CodeRabbit findings on the Mage lint migration Fixes 4 review threads on PR cloudposse#2955: lintrollerIsStale ignored go.mod/go.sum changes, CustomGCL built golangci-lint in the caller's cwd instead of the repo root, Precommit only checked binary existence (not staleness), and mageRepoRoot's HasPrefix match could stop at tools/lintroller's own go.mod instead of walking to the real root. Adds unit test coverage for magefiles/ (previously invisible to `go test ./...` under the mage build tag) and a standalone CI job + Codecov wiring so it's no longer untested. Co-Authored-By: Claude Sonnet 5 <[email protected]> * fix(deps): bump moby/go-archive to v0.3.0 for path-traversal fix Dependabot alert cloudposse#277 (GHSA-hfg8-hc9c-6c3h, high): a crafted tar archive could write outside the extraction directory in github.com/moby/go-archive < v0.3.0. v0.2.0 -> v0.3.0 is a semver-minor bump, not blocked by .github/dependabot.yml's major-version-only ignore rule. Transitively pulls moby/sys/sequential v0.7.0 and moby/sys/user v0.4.1 via `go mod tidy`. Co-Authored-By: Claude Sonnet 5 <[email protected]> * perf(lint): switch import formatter from goimports to gci goimports takes ~95-108s for a full-repo custom-gcl fmt pass; gci with explicit import-section ordering (standard/default/cloudposse-prefix) does the same pass in ~5-7s, a ~15-20x speedup, benchmarked directly against this repo. gci is a stock golangci-lint v2 formatter, so no .custom-gcl.yml plugin change is needed. Updates the two doc references (CLAUDE.md, lint-fix/test-coverage-fix agents) that named goimports as the enforced formatter. Co-Authored-By: Claude Sonnet 5 <[email protected]> * fix(docs): correct pre-existing EditorConfig indentation in agent guardrails .claude/agents/lint-fix.md and .claude/agents/test-coverage-fix.md used a 3-space continuation indent under numbered-list items, violating this repo's .editorconfig (markdown indent_size: 2, left-padding must be a multiple of 2). Pre-existing on origin/main, but only surfaced once these files were touched by the goimports->gci commit, since `atmos validate --affected` validates whole files once they enter the affected set rather than just changed lines. CI's "Run pre-commit hooks" job on PR cloudposse#2955 caught this (Validate EditorConfig failed with the same 11 findings reproduced locally). Also adds the fix-log record for the goimports->gci swap. Co-Authored-By: Claude Sonnet 5 <[email protected]> * test(magefiles): close patch coverage gaps flagged by Codecov on PR cloudposse#2955 Codecov reported this PR's patch coverage at 80.80% (48 lines missing) across magefiles/mage_lint_changed.go (0%), mage_lint_lintroller.go (65.85%), mage_lint_customgcl.go (78.57%), mage_lint_golangci_run.go (86.45%), magefile.go (85.71%), mage_lint_precommit.go (84.61%), and mage_lint_gomodcheck.go (90.00%) — below CLAUDE.md's mandatory >85%. Adds tests exercising real failure-propagation and build-orchestration paths (repo-root resolution errors, staleness-check errors via ENOTDIR, an end-to-end go-build-and-run against a trivial stand-in program, go list parse failures, gomodcheck's success path) rather than padding coverage. Remaining gaps are left uncovered with stated reasons: Windows-only branches (unreachable on this CI runner), and a few genuinely impractical-to-reproduce OS-level races/failures (fd close errors, TOCTOU on directory walks). Local coverage on the touched functions is now at or near 100% for every function Codecov flagged; magefiles/acceptance.go is untouched (not part of this branch's diff vs origin/main, correctly excluded from Codecov's patch view). Co-Authored-By: Claude Sonnet 5 <[email protected]> * fix(ci): restore Go build cache in test.yml, correct the security rationale All 7 actions/setup-go steps in .github/workflows/test.yml had cache: false, two with a comment claiming this avoided "PR-controlled keys" poisoning the cache across PRs or into main. That rationale doesn't hold: GitHub Actions already isolates this. A pull_request run gets read/write access only to its own branch's cache scope, read-only access to the default branch's cache, and cannot restore caches from sibling PRs; only push/ workflow_dispatch/schedule/etc. can write to the default branch's cache scope at all - pull_request and merge_group both get read-only access to it. There's no cross-PR or PR->main poisoning path for this to guard against. The one real, historically-documented incident (PR cloudposse#2713, 2026-07-13) was a cold-cache Windows build blowing through its then-30-minute timeout during the post-job cache-save step, not a poisoning attack - fixed at the time by bumping the timeout to 45 minutes (still in place today). cache: false was introduced separately and later (2026-08-02, commit 9343caf, a large squashed refactor(store) PR whose own commit message never mentions caching), with no documented rationale beyond the now-corrected comment. Restores cache: true explicitly (not just the implicit default) on all 7 steps so there's a concrete anchor for the corrected explanatory comment, kept once on the build job's step rather than duplicated 7x. Co-Authored-By: Claude Sonnet 5 <[email protected]> --------- Co-authored-by: Claude Sonnet 5 <[email protected]> Co-authored-by: Andriy Knysh <[email protected]>
Jorrit Elfferich (jorrite)
pushed a commit
to jorrite/atmos
that referenced
this pull request
Aug 31, 2026
…ng (cloudposse#2958) * chore(ci): harden supply-chain security posture across CI/CD Enables OpenSSF Scorecard and Semgrep SAST scanning, rolls out step-security/harden-runner egress monitoring (audit mode) to every GitHub-hosted workflow job, closes a Token-Permissions gap on nine workflows that had no explicit permissions block, digest-pins the Dockerfile's base image, and adds cosign signing + SBOM generation + provenance attestation + Trivy scanning for both the release binaries and the published Docker image. - .github/workflows/scorecard.yml: new, weekly + push-to-main OpenSSF Scorecard analysis, SARIF uploaded to code scanning, badge added to README.md. - .github/workflows/semgrep.yml: new, `semgrep ci` SAST scan via a digest-pinned container, SARIF uploaded to code scanning. - step-security/harden-runner added as the first step of every job running on a GitHub-hosted runner (~30 workflow files); deliberately excluded from jobs using the RunsOn self-hosted runner service. - permissions: blocks added to claude.yml, changelog-check.yml, link-check.yml, nightlybuilds.yml, pre-commit.yml, setup-go-cache-warmup.yml, validate-agent-skills.yml, validate-codeowners.yml, and vhs.yaml, which previously inherited the repo's broad default token permissions. - Dockerfile: debian:trixie-slim pinned by digest. - build.yml `docker` job: provenance:true, cosign keyless image signing, SBOM generation + attestation, non-blocking Trivy scan with SARIF upload. - build.yml: new `sign-and-attest-release` job that cosign-signs every published release asset, generates a source-tree SBOM, and attests build provenance for the release — implemented as a downstream job reading already-published release assets rather than touching .goreleaser.yml, since the actual GoReleaser run lives in an external cloudposse/.github reusable workflow this repo doesn't control. Co-Authored-By: Claude Sonnet 5 <[email protected]> * chore(ci): round 3 supply-chain hardening — govulncheck, secret scanning, digest auto-bumping Consolidates govulncheck and Semgrep into codeql.yml (both produce SARIF, same trigger shape as CodeQL/golangci-lint already there), adds TruffleHog for git-history secret scanning, adds a Trivy config scan of the Dockerfile alongside hadolint, adds secret scanning to the existing Trivy image scan in build.yml, wires up Dependabot's docker ecosystem to auto-bump the digest-pinned base images, and strips unnecessary setuid/setgid binaries from the Dockerfile (verified via local build + `find -perm /6000`, confirmed atmos still runs). Also includes the moby/go-archive dependency bump (fixes Dependabot alert cloudposse#277 / GHSA-hfg8-hc9c-6c3h, a tar extraction path-traversal CVE), README.yaml/pre-commit/action.yml changes from a parallel session on this branch, and a pre-existing README.md EditorConfig indentation fix (unrelated list-item spacing in the Contributing section) required to get any commit past the repo-wide validate-editorconfig pre-commit hook. Co-Authored-By: Claude Sonnet 5 <[email protected]> * [autocommit] formatting fixes * chore(ci): add documented-exception mechanism to SHA-pin drift check Some upstream orgs (e.g. aquasecurity) block the GitHub API calls verify-sha-pinning needs to resolve a tag, most commonly via an org-level IP allow list. That's an access failure, not drift, but the two look identical to CI unless someone says so explicitly. unverifiable.json is that explicit, maintainer-reviewed record — the only mechanism that downgrades a resolution failure to a warning instead of a hard CI failure. Also fixes a stray leading-space list-indentation nit in README.md. Co-Authored-By: Claude Sonnet 5 <[email protected]> * fix(ci): address CodeRabbit findings on supply-chain hardening PR - codeql.yml: add merge_group ref/sha overrides to the govulncheck and semgrep SARIF uploads, matching the existing analyze/lint-golangci pattern, so those uploads don't 404 against the merge queue's ephemeral ref. - build.yml: skip already-generated .sig/.pem/SBOM files in the cosign signing loop so a rerun of the release job doesn't sign stale artifacts or produce a signature that no longer matches the regenerated SBOM. - vhs.yaml: split the single vhs job into an untrusted render job (contents: read) and a new trusted commit job (contents: write) that consumes its artifact — a PR-controlled .tape file no longer executes in the same job that holds a push token. - changelog-check.yml: drop the redundant pull-requests: write; every write in this workflow goes through issue-comment endpoints, so issues: write alone is sufficient. Co-Authored-By: Claude Sonnet 5 <[email protected]> * [autocommit] formatting fixes * [autocommit] formatting fixes * chore: exclude machine-generated root README.md from EditorConfig validation README.md is generated by cloudposse/build-harness (`make readme` from README.yaml), so its formatting isn't ours to enforce. Uses the existing --exclude mechanism (exact repo-relative match, unlike .editorconfig's implicit **/ glob prefix) rather than an .editorconfig section, so this never touches .editorconfig itself — editing .editorconfig at all makes `atmos validate --affected` fall back to a full-repo scan (cmd/validate_affected.go's affectedEditorConfigFiles), which would have surfaced hundreds of unrelated pre-existing violations across the repo. Co-Authored-By: Claude Sonnet 5 <[email protected]> * feat(ci): sign release binaries and build packages via native GoReleaser Atmos already runs GoReleaser, but invisibly: three layers deep inside cloudposse/.github's external shared-go-auto-release.yml chain. This repo's own build.yml never touched GoReleaser at all — its sign-and-attest-release job instead re-downloaded whatever that external chain already published and signed the downloaded copy. Anything able to tamper with a just-published release asset in that window would get a valid-looking signature over tampered bytes. - .goreleaser.yml: add native sboms: (syft) and signs: (cosign, keyless/OIDC) blocks, plus an nfpms: block that builds real .deb/.rpm/.apk packages and attaches them to the release directly (verified locally against every linux arch in the build matrix). - build.yml: replace sign-and-attest-release's download-then-sign flow with a real `goreleaser release --clean` run at the checked-out release tag — signing/SBOM now describes what this job actually built, not a re-fetched copy. GitHub-native attestation steps carry over, now pointed at the local dist/ output instead of re-downloaded files. A CloudSmith push step for the new packages is added commented-out: the real org/repo/distro names and an API key are unknown from this repo today, left for a follow-up PR. Full migration plan (Docker, Homebrew, nightly/feature-release rewiring, decommissioning the external chain) in the new PRD. Co-Authored-By: Claude Sonnet 5 <[email protected]> * fix(ci): address CodeRabbit findings on SHA-pin drift check and vhs commit job Closes a self-approval gap where a PR could tamper with its own drift check (verify-sha-pinning now loads its verifier and unverifiable.json from the PR's base revision, not the PR-controlled merge ref), tightens the documented-exception downgrade to the specific access-block (403) condition it was written for, validates unverifiable.json entries, keeps unverifiable warnings visible in PR comments instead of letting a resolved failure silently flip to an unqualified pass, and fixes vhs.yaml's commit job checking out a detached HEAD that git-auto-commit-action couldn't push from. Co-Authored-By: Claude Sonnet 5 <[email protected]> * [autocommit] formatting fixes * docs(prd): fix overstated atomicity and movable nightly tag in GoReleaser PRD Addresses two CodeRabbit findings on docs/prd/native-goreleaser-release-pipeline.md: describe the release pipeline as a retryable build stage plus independent, individually-retryable publishers rather than one atomic run, and require nightly builds to use a unique immutable SHA-bearing tag instead of a movable one, since a moved tag undermines the signature over a signed release. Co-Authored-By: Claude Sonnet 5 <[email protected]> * fix: bump go.mod to 1.26.6 to patch 9 reachable stdlib CVEs go.mod pinned go 1.26.4, and CI/release builds provision their Go toolchain from go-version-file: go.mod — so released atmos binaries were being compiled against a standard library with 9 govulncheck-reachable CVEs (crypto/tls, net/http, net/url, html/template, encoding/xml, encoding/asn1, os), all fixed upstream by go1.26.5/go1.26.6. Confirmed via govulncheck: 9 reachable vulnerabilities before this bump, 0 after. Co-Authored-By: Claude Sonnet 5 <[email protected]> * refactor(ci): rename SHA-pin unverifiable.json to allowlist.json (gitleaks-style) Aligns the SHA-pin drift check's exception-file vocabulary with how gitleaks names its allowlist mechanism: unverifiable.json -> allowlist.json, the "reason" field -> "description", and the matching input/output/variable names across action.yml, README.md, test.mjs, and verify-sha-pinning.yml. Pure rename, no behavior change; all 39 test.mjs cases still pass. Co-Authored-By: Claude Sonnet 5 <[email protected]> * fix(ci): cap govulncheck memory to avoid OOM kill on standard runner The govulncheck job's whole-program SSA call-graph analysis over this repo's large, dependency-heavy module peaks high enough in memory to get OOM-killed by the standard 16GB runner, surfacing as an unexplained SIGTERM (exit 143) partway through with no findings ever produced. Set GOMEMLIMIT=12GiB so the Go runtime GCs earlier instead of letting the heap grow unchecked. GOFLAGS=-p=1 was tried first and rejected: it barely reduced peak memory (govulncheck's SSA construction parallelizes via goroutines internally, which -p doesn't govern) while nearly tripling run time. Co-Authored-By: Claude Sonnet 5 <[email protected]> * fix(ci): drop base-branch trust boundary from SHA-pin allowlist Checking out the verifier + allowlist.json from the PR's base commit meant a PR could never see its own allowlist edits take effect on itself, only on runs after it merged — a self-referential dead end no PR could resolve for itself. That's not how gitleaks/git-secrets work either: they read their allowlist config from the diff being scanned, and rely on required review before merge to catch a self-serving entry, not on hiding the policy behind a stale base-branch copy. main already requires 1 approval, a code-owner review, and dismisses stale approvals on new pushes, so a reviewer always sees the real diff (including allowlist.json changes) before merge — that's the actual protection here too. Read the verifier and allowlist.json from the PR's own head like everything else this action scans. Co-Authored-By: Claude Sonnet 5 <[email protected]> * test(fuzz): add native Go fuzz tests for OpenSSF Scorecard Fuzzing check Zero func FuzzXxx functions existed anywhere in the repo, so the check scored 0. Adds targeted fuzz tests around parsing-heavy, untrusted-input paths (YAML unmarshal, stack merge, template parsing, CLI arg parsing), seeded from each target's existing table-driven test cases. Co-Authored-By: Claude Sonnet 5 <[email protected]> * fix(ci): tighten GITHUB_TOKEN permissions for OpenSSF Scorecard Token-Permissions check Adds a least-privilege {contents: read} top-level default to codeql.yml, clear-cache.yml, pr-size-labeler.yml, and vhs.yaml, which previously only scoped permissions per-job with no workflow-level fallback. Tightens build.yml and feature-release.yml, whose top-level blocks granted broad write scopes (attestations/contents/packages/pull-requests/issues) inherited in full by jobs that call reusable workflows in cloudposse/.github with secrets: inherit. Verified against those reusable workflows' own declared permissions before capping: build.yml's release job now matches shared-release-branches.yml's request exactly (id-token/contents/pull-requests, dropping unused attestations/packages); build.yml's homebrew job drops to {contents: read} since it authenticates via GH_BOT_TOKEN, not GITHUB_TOKEN; feature-release.yml's release job drops to {} since shared-go-auto-release.yml itself declares permissions: {} and does all release-writing via a separate GitHub App token. Drops the unused actions: write from autofix.yml — the workflow's real logic now lives entirely in Atmos Pro; its one remaining step just echoes a placeholder. Co-Authored-By: Claude Sonnet 5 <[email protected]> * fix(ci): address CodeRabbit findings on PR cloudposse#2958 - verify-sha-pinning: only downgrade a listed repo's resolution failure when the 403 isn't a rate-limit response (checked via the x-ratelimit-remaining header, not error message text), so a token budget exhaustion can't silently hide behind another repo's allowlist entry; clarify the allowlist-file description to match - vhs.yaml: persist checkout credentials in the commit job so git-auto-commit-action can actually push - native-goreleaser-release-pipeline.md: relabel the TOCTOU description as pre-change behavior now that build.yml rebuilds locally before signing, and add a language to the unlabeled fenced block - template_utils_fuzz_test.go: exercise a non-default Templates.Settings.Delimiters config in both fuzz targets Co-Authored-By: Claude Sonnet 5 <[email protected]> * fix(templates): honor configured delimiters in IsGolangTemplate IsGolangTemplate always parsed with Go's default "{{"/"}}" delimiters, ignoring atmosConfig.Templates.Settings.Delimiters entirely. A project configured with custom delimiters (e.g. "[[ ]]") would have a templated import string misclassified as plain text here, so stack_processor_utils.go's missing-import check would treat a legitimate templated import as a genuinely missing one and fail with ErrStackImportNotFound instead of deferring to later template resolution. Extracted the delimiter-resolution/validation logic ProcessTmplWithDatasources already had into a shared resolveTemplateDelimiters helper, and use it in IsGolangTemplate too so both honor the same configured delimiters (falling back to the default when atmosConfig is nil or none are configured). Wraps the existing (previously unused) errUtils.ErrInvalidTemplateSettings sentinel instead of a bare dynamic error, per this repo's static-error convention. Extended FuzzIsGolangTemplate with pinned expected results for known inputs under both delimiter configs, so it asserts real detection correctness (not just absence of panics) — verified against 86,948 fuzz executions with no failures. Addresses CodeRabbit finding on PR cloudposse#2958 (cloudposse#2958 (comment)). Co-Authored-By: Claude Sonnet 5 <[email protected]> * fix(templates): terminate fuzz test comments with periods Addresses CodeRabbit finding on PR cloudposse#2958 (cloudposse#2958 (comment)). Co-Authored-By: Claude Sonnet 5 <[email protected]> * fix(install): retry transient network failures in install.sh Add shared curl retry flags (--retry 3 --retry-delay 2 --retry-all-errors) to every curl call in the CloudSmith and binary-download install paths, so a transient network blip (connection reset, timeout) during install doesn't fail the whole install. --retry-all-errors is needed because plain --retry only retries a narrower default set of conditions that doesn't cover every transient failure (e.g. curl error 35, "Recv failure: Connection was reset"). Co-Authored-By: Claude Sonnet 5 <[email protected]> * fix(install): tolerate old curl and avoid piping retried curl into bash/awk Addresses two CodeRabbit findings on the install.sh retry-flags change: - --retry-all-errors requires curl 7.71.0+ (June 2020); older curl builds reject it as an unknown option, hard-failing every curl call in the script. Probe support directly (curl --retry-all-errors --version) rather than parsing curl's version string, and degrade to curl's narrower default retry set when unsupported instead of failing outright. Also added a shared require_curl check, used before every curl-dependent path (including install_via_cloudsmith, which previously had none). - Piping curl output directly into `bash` (cloudsmith setup script) or `awk` (checksum lookup) is unsafe under --retry-all-errors: curl can't rewind a shell pipe the way it can rewind a file via -o, so a mid-transfer retry could hand the consumer truncated-then-repeated (corrupted) data. Both call sites now download to a temp file first, then operate on the completed file. Verified: shellcheck clean, and both the binary-download and cloudsmith setup-script download paths tested against the real endpoints. Addresses CodeRabbit findings on PR cloudposse#2958 (cloudposse#2958 (comment), cloudposse#2958 (comment)). Co-Authored-By: Claude Sonnet 5 <[email protected]> * fix(install): clean up temp files on every exit path in install.sh rm -f previously only ran after curl, maybe_sudo, and awk succeeded, so a failed download, setup-script execution, or interruption could leave the temp file behind. Register cleanup via an EXIT trap right after each mktemp, and disable it after the normal explicit cleanup to avoid a redundant duplicate removal. Verified: a failure injected mid-download (broken proxy) confirms the tracked temp file is removed via the trap; the success path remains leftover-free as before. Addresses CodeRabbit finding on PR cloudposse#2958 (cloudposse#2958 (comment)). Co-Authored-By: Claude Sonnet 5 <[email protected]> * fix(tests): surface captured command output on a file_exists check failure Investigating a Windows-only acceptance-test failure (TestCLICommands/ atmos_vendor_pull: 9 expected files missing after `atmos vendor pull`, reproduced identically across two separate CI runs) required manually re-fetching the raw CI log via the GitHub API, since the test's own failure output only listed which files were missing -- never what the command itself printed. The exit code matched expectations (0), so the existing verifyExitCode failure path (which already dumps stdout/stderr) never fired. Extract that dump into a shared dumpCapturedOutput helper and call it from verifyFileExists's failure path too, so a silent-partial-failure case (e.g. a vendor source failing while the overall command still reports success) shows the command's actual output directly in the test failure, instead of requiring a manual log re-fetch to diagnose next time. Root cause of the underlying Windows failure is still open -- not reproducible locally (macOS): a manual repro here hit a *different*, legitimate issue (OCI pull falling back to anonymous auth when no GHCR username is configured, pkg/oci/auth.go:44-50), but CI's GITHUB_ACTOR should already satisfy that via the existing github_username env binding (pkg/config/load.go:741), so it likely isn't the Windows trigger. Filed as a known gap, not blocking on it. Co-Authored-By: Claude Sonnet 5 <[email protected]> * fix(tests): clean stale vendor.lock.yaml before atmos_vendor_pull on Windows TestCLICommands/atmos_vendor_pull reproduced identically across three separate Windows CI runs: 9 of 16 expected files consistently missing (github/stargazers, test-components, myapp1), exit code 0, no error -- a silent partial failure. tests/cli_test.go's new dumpCapturedOutput (prior commit) finally surfaced the actual command output: only 2 of 5 declared vendor sources were even attempted ("Vendored components (success: 2)"), with no "Vendor lock drift" line at all for the other 3 -- meaning install.FilterPending's lockfile.IsMaterialized check found existing, matching lock entries for them and silently skipped re-fetching, via install.go's `if check.Materialized { ... continue }` path (debug-only log, no warning). Traced the full pipeline (source resolution, tag/component filtering, import merging, lock-path resolution) looking for how a lock entry could predate this test's very first run against a workdir that's not sandboxed (runs directly against the tracked git checkout, not a per-test copy) -- every function checked out as pure, platform-independent logic. Whatever leaves the stale vendor.lock.yaml behind before this specific test runs, the sibling atmos_vendor_pull_oci test case (same workdir, same file) already carries `clean: true` for exactly this reason; atmos_vendor_pull itself was missing it. cleanDirectory only removes untracked files (confirmed via cleanDirectory's git-status-based implementation), so this can't touch the tracked vendor.yaml/vendor2.yaml manifests it depends on. Co-Authored-By: Claude Sonnet 5 <[email protected]> * chore(tests): add temporary diagnostics for the Windows silent vendor-pull bug TestCLICommands/atmos_vendor_pull now correctly attempts all 5 declared sources (the clean:true fix in the prior commit), but 3 of them (github/stargazers, test-components, myapp1) still report success on Windows CI while their files never land on disk -- and this is NOT reproducible locally on macOS even with a clean slate and correct GITHUB_ACTOR, ruling out the lock-file logic already fixed. The remaining bug is genuinely Windows-only, somewhere in the fetch-to-tempdir or copy-to-target step. Add logVendorDiagDir (pkg/vendoring/install/atmos.go), gated behind ATMOS_VENDOR_DEBUG_DIAG so it only fires for the one test case currently reproducing this (wired via env: in vendor-test.yaml), logging a full file listing of the fetched tempdir right after fetchToTempDir and of the final target right after copyToTargetWithPatterns. This will show directly whether the failure is in fetch (tempdir already missing files) or in the copy-to-target step (tempdir has them, target doesn't) on the next Windows CI run, without needing direct Windows access to add instrumentation. Verified locally: correctly silent with the env var unset (0 matches across a full vendor pull), and produces the expected before/after listing for every package with it set. TEMPORARY: remove logVendorDiagDir, its two call sites, and the env: block in vendor-test.yaml once the Windows-only failure is root-caused. Co-Authored-By: Claude Sonnet 5 <[email protected]> * chore(tests): extend Windows vendor-pull diagnostics into the lock-prune path The first diagnostic round (prior commit) proved the copy step itself works correctly on Windows: after-fetch and after-copy both showed every expected file present, for every package -- yet the test's own file_exists check still reported those same files missing afterward. That rules out the fetch/copy steps and points at something between "files verified on disk" and "command returns" -- specifically lockfile.Record, which runs immediately after the diagnostic's last checkpoint and (via Replace -> pruneStaleArtifactFiles) deletes any previously-lock-owned file the new receipt no longer claims. Add a third logVendorDiagDir checkpoint after lockfile.Record returns, plus two targeted log lines in lockfile.go: Replace logs the computed artifact ID, whether a previous receipt existed for it, and that previous receipt's own target/name (a mismatch there would mean two different packages are colliding on the same lock ID); pruneStaleArtifactFiles logs every path it actually removes. Together these will show directly whether pruning is what's deleting these files on Windows, and if so, which artifact's entry it's incorrectly matching against. Same ATMOS_VENDOR_DEBUG_DIAG gate and forbidigo nolint justification as the prior commit's logVendorDiagDir. Verified: go build, go vet, and the full pkg/vendoring/... suite all pass unchanged. TEMPORARY: remove all of this (both files, plus vendor-test.yaml's env: block) once the Windows-only failure is root-caused. Co-Authored-By: Claude Sonnet 5 <[email protected]> * fix(tests): surface captured command output on a file_exists check failure Second diagnostic round (pkg/vendoring's own instrumentation, prior commit) proved the files exist on disk at every checkpoint through the end of install() -- fetch, copy, and after lockfile.Record all show the correct files present for every package, and zero VENDOR_DIAG_PRUNE lines fired. That rules out the entire vendoring pipeline inside atmos.exe: whatever's deleting these files (or making them invisible) happens after the process exits, in or around the test harness's own file_exists check. Add logMissingFileDiag, called from verifyFileExists's failure path: logs the test harness process's own os.Getwd(), the resolved absolute path being checked, and (since the file is already confirmed absent) the parent directory's actual entries -- pinning down whether this is a CWD mismatch between the harness and the subprocess it ran, a race with something else touching the same directory, or the file genuinely never landing where the harness expects to find it. Verified: go build, go vet, and TestCLICommands/atmos_vendor_pull all pass unchanged (skips locally on the same known token-scope precondition as before). TEMPORARY: remove logMissingFileDiag and its call site once root-caused, alongside the rest of this investigation's instrumentation (see prior two commits). Co-Authored-By: Claude Sonnet 5 <[email protected]> * fix(tests): isolate telemetry-disclosure cache in 4 tests missing it TestTelemetryDisclosureMessage, ...Shown, ...HideForCI, and ...HideIfTelemetryDisabled all call cfg.LoadCache()/SaveCache() directly against the real, global per-user XDG cache file (GetCacheFilePath() is not test-isolated by default) instead of the isolateTelemetryCache(t) helper this same file already established for exactly this reason -- its doc comment documents the prior Windows CI failure class this causes (concurrently-running package test binaries stepping on the same shared cache.yaml). The other four tests that call disclosureMessage() via PrintTelemetryDisclosure (TestPrintTelemetryDisclosure and its three siblings) already use it; these four were the gap. Observed as TestTelemetryDisclosureMessage failing on Windows CI: its second disclosureMessage() call returned the notice text again instead of empty, meaning the first call's TelemetryDisclosureShown=true write never stuck from this test's own perspective -- consistent with another concurrently-running test's write to the same shared cache file clobbering it in between. Verified: go build, go vet, and the full pkg/telemetry/... suite pass. Co-Authored-By: Claude Sonnet 5 <[email protected]> * fix(tests): redact secrets from diagnostic output, remove root-caused vendor diagnostics dumpCapturedOutput dumped raw child-process stdout/stderr into the test log unredacted; since child processes under test inherit GITHUB_TOKEN, a command that prints its own environment could leak it into CI logs. Routes captured output through pkg/io's existing secret masker and caps it to 8KB before logging. The Windows-only silent vendor-pull failure this diagnostic instrumentation (logVendorDiagDir, VENDOR_DIAG_REPLACE/PRUNE logging, logMissingFileDiag, ATMOS_VENDOR_DEBUG_DIAG) was added to investigate is confirmed fixed -- Acceptance Tests (windows, shard 1/10) has passed consistently since. Remove it now rather than patch its own error-swallowing (CodeRabbit flagged logVendorDiagDir's WalkDir callback for discarding errors), since the code was already marked temporary and pending removal. Co-Authored-By: Claude Sonnet 5 <[email protected]> * fix(tests): keep diagnostic truncation within its own cap, add unit tests redactAndCapDiagOutput sliced to maxDiagOutputLen and then appended the "...[truncated]" suffix, so truncated output could exceed the configured cap by the suffix's length. Reserve the suffix's length before slicing, and back up to the nearest rune boundary so a multibyte character straddling the cut point isn't split into invalid UTF-8. Adds a table-driven TestRedactAndCapDiagOutput covering empty input, output below/above the cap, registered-secret masking, and multibyte truncation. Co-Authored-By: Claude Sonnet 5 <[email protected]> * fix(ci): pin mutable scanner image refs to immutable digests TruffleHog's action defaults to ghcr.io/trufflesecurity/trufflehog:latest internally (its own docker run step appends :${VERSION}, which defaults to "latest") even though the action wrapper itself is SHA-pinned -- pin image+ version to the digest matching the action's already-pinned v3.97.0 release. Same class of gap in the Gitleaks pre-commit hook: rev was a movable tag (v8.30.1) rather than the commit it resolves to. Co-Authored-By: Claude Sonnet 5 <[email protected]> * fix(release): fix nfpm prerelease package filenames containing tildes ConventionalFileName renders a prerelease version's hyphen as a tilde (Debian version-ordering convention, e.g. 1.227.0~test.9) for nightly and feature-release builds. GitHub rewrites tildes to dots in uploaded asset filenames, which no longer matches the SHA256SUMS entry generated from the pre-upload filename. Verified locally with `goreleaser release --clean` against a real prerelease tag (v1.227.0-test.9): the tilde appeared in both .deb and .rpm filenames as predicted. The initially-tried `{{ .ConventionalFileName | replace "~" "-" }}` (piping into GoReleaser's replace, which is strings.ReplaceAll(s, old, new)) actually broke rendering entirely --pipe form appends .ConventionalFileName as the *last* arg, landing it in the `new` position instead of `s`, collapsing every package filename to a bare "~". Calling `replace .ConventionalFileName "~" "-"` directly (not piped) produces the correct filename and matches the checksums file exactly. Co-Authored-By: Claude Sonnet 5 <[email protected]> * fix(ci): grant id-token: write for cosign OIDC signing in goreleaser jobs feature-release.yml and test.yml's release job call cloudposse/.github's shared-go-auto-release.yml, whose goreleaser job runs `goreleaser release` against .goreleaser.yml's signs:/sboms: blocks -- cosign sign-blob needs keyless OIDC, which reads the runner's token-minting endpoint gated purely by the job's own id-token permission, independent of the separately-scoped GitHub App token used for git/API operations elsewhere in that same job. feature-release.yml previously granted permissions: {} on the reasoning that the App token covers all release-writing -- true for the GitHub Release itself, but not for cosign's OIDC flow, which needs id-token: write regardless. test.yml's release job had no override at all, inheriting the workflow-level read-only default. Note: the reusable workflow itself (cloudposse/.github) still needs its own job-level id-token: write on the goreleaser job to actually receive what these callers now grant -- a caller's permissions are a ceiling, not a request; the callee must still ask. That fix, plus provisioning syft/cosign binaries in that job (neither installed today), lives in a separate PR against cloudposse/.github, not this repo. Co-Authored-By: Claude Sonnet 5 <[email protected]> * fix(templates): honor configured delimiters in ProcessTmpl and merged stack settings ProcessTmpl accepted atmosConfig but never applied it to the template parser's delimiters, always using Go's hardcoded "{{"/"}}" -- a project configured with templates.settings.delimiters (e.g. "[[ ]]") would have those expressions emitted as plain text everywhere ProcessTmpl is used (name templates, import paths, vendor sources, hooks, and more). Mirrors the same class of bug already fixed for IsGolangTemplate. ProcessTmplWithDatasources separately read atmosConfig.Templates.Settings. Delimiters directly instead of the merged templateSettings, so a stack manifest's delimiter override was silently ignored. Fixing this naively (switching straight to templateSettings.Delimiters) turned out to regress the common case instead: merge.Merge encodes both sides of the merge through mapstructure first, so an unset stack-level Delimiters (nil) becomes an explicit "delimiters: []" key that wins the merge over a populated CLI-level value -- same root cause as the Env field's existing mapstructure:"-" workaround a few lines up in the same function. Caught by running the existing custom-delimiter test suite before committing (one test regressed); fixed by falling back to the CLI-level config when the merged value comes back empty. Co-Authored-By: Claude Sonnet 5 <[email protected]> * fix(tests): mask the full git basic-auth credential, not just the raw token The test harness's GIT_CONFIG_VALUE_1 embeds base64("x-access-token:"+GITHUB_TOKEN) to authenticate git non-interactively. pkg/io's masker auto-registers plain GITHUB_TOKEN and base64(GITHUB_TOKEN), but prepending "x-access-token:" changes the base64 encoding to a different byte sequence the existing registration doesn't cover -- a failing command that printed this env var would have leaked a recoverable token into CI logs despite redactAndCapDiagOutput's masking. Register the composite credential string directly so its encoded forms are covered too. Co-Authored-By: Claude Sonnet 5 <[email protected]> * docs(prd): update goreleaser publisher example to current, non-deprecated APIs brews (deprecated since v2.10 in favor of homebrew_casks) and dockers/ docker_manifests (deprecated since v2.18, consolidated into dockers_v2) would have guided implementation toward APIs already deprecated by the time this PRD gets built. Also fixes docker_signs' artifacts selector: "manifests" targets the legacy dockers/docker_manifests pipeline, which would leave dockers_v2-built images unsigned -- dockers_v2 images need the "" (default) selector instead. Verified each replacement's schema and deprecation status against goreleaser.com's docs and deprecation notices. Co-Authored-By: Claude Sonnet 5 <[email protected]> * fix(templates): revert ProcessTmpl delimiter change, correct ProcessTmplWithDatasources instead CI (Acceptance Tests, linux/macos) caught a real regression from the previous commit's ProcessTmpl fix: TestYAMLFunctionsWithCustomDelimiters started failing with "Could not find the component `component-1` in the stack `test`". Root cause: ProcessTmpl's 30+ call sites are a mix of two different things -- actual stack-manifest content (which should honor templates.settings.delimiters) and Atmos-internal meta-templates like Stacks.NameTemplate/ClusterNameTemplate/terraform workspace templates, which are always written in plain "{{ }}" by convention regardless of the project's configured content delimiters. Applying configured delimiters uniformly broke name-template resolution: with custom delimiters configured, `stacks.name_template: "{{.vars.stage}}"` stopped evaluating entirely (no longer matched the custom pair), so the stack resolved to the literal name "{{.vars.stage}}" instead of "test", and every component lookup against that stack failed. Reverted ProcessTmpl to its original behavior (always Go's default "{{"/"}}") and removed its now-invalid regression test. The primary stack-content templating pipeline is ProcessTmplWithDatasources, not ProcessTmpl -- confirmed by this same test still passing after the revert, since its var-template resolution goes through ProcessTmplWithDatasources. Also simplified and hardened ProcessTmplWithDatasources's delimiter resolution per a follow-up CodeRabbit finding: read settingsSection.Templates.Settings.Delimiters directly (nil means "stack didn't set it, defer to CLI config"; non-nil including explicitly empty means "stack decides") instead of inferring intent from the post-merge map, which can't distinguish "unset" from "explicitly delimiters: []" once both round-trip through mapstructure. Added a regression test loading `delimiters: []` through real YAML unmarshaling to confirm it resets to Go's default delimiters rather than falling back to CLI config. Co-Authored-By: Claude Sonnet 5 <[email protected]> * docs(prd): document that Docker image SBOMs need a separate syft step GoReleaser's sboms: block cannot catalog Docker images at all ("Container images generated by GoReleaser are not available to be cataloged by the SBOM tool", per GoReleaser's own docs) -- its artifacts field only supports archive/binary/package/installer/source/any. The proposed workflow retired build.yml's docker job (which produces an image SBOM via cloudposse/github-action-docker-build-push's sbom: true) without replacing that capability. Documented as an explicit syft step against the pushed digest, called out in the workflow step list, the sboms: block's own comment, the Docker implementation phase, and the parity matrix, rather than implying dockers_v2:+sboms: together give full coverage automatically. Co-Authored-By: Claude Sonnet 5 <[email protected]> * fix(templates): carry delimiter changes across evaluation passes effectiveDelimiters was re-derived from settingsSection (a fixed, pre-loop value) on every pass instead of carrying a prior pass's own rendered delimiters forward, so a two-pass manifest that introduced new delimiters on pass 1 (via its own rendered settings.templates.settings.delimiters section) would leave templates written in that new syntax unrendered on pass 2 -- the loop kept re-resolving back to the original config. Initialize effectiveDelimiters once before the loop, then only overwrite it when a pass's own rendered output explicitly declares a delimiters key (checked via map key presence, not by trusting the lossy merge.Merge/ mapstructure round-trip templateSettings.Delimiters goes through). Added a two-pass regression test: pass 1 resolves a template with the default delimiters while also declaring `delimiters: ["<<", ">>"]`, pass 2 must then resolve a `<< ... >>` expression pass 1 left untouched. Also fixes a docs/prd wording gap: the pipeline description said everything above the Cloudsmith push step was one GoReleaser invocation, which after a previous commit's fix now includes the separate syft step in between -- scoped the "one invocation" wording to just the goreleaser-action step. Co-Authored-By: Claude Sonnet 5 <[email protected]> * docs(prd): scope "one GoReleaser invocation" wording to the goreleaser-action step The pipeline description said everything above the Cloudsmith push step was one GoReleaser invocation, which after a previous commit's fix now includes the separate syft step in between -- scoped the "one invocation" wording to just the goreleaser-action step, keeping syft described as an independent post-publish step. Co-Authored-By: Claude Sonnet 5 <[email protected]> * fix(templates): reject malformed mid-loop delimiter values instead of silently coercing convertRawDelimitersToStringSlice silently dropped non-string elements instead of failing, so `delimiters: ["<<", 1, ">>"]` could become the valid-looking 2-item pair ["<<", ">>"], and `delimiters: [1, 2]` could become an empty slice that resolveTemplateDelimiters' empty-means-default fallback would then silently accept as "not configured." In practice, the mapstructure.Decode call a few lines below already fails hard on non-string elements against the same raw map (same mechanism that already made this reachable-but-redundant for two of CodeRabbit's example inputs) -- but it surfaces mapstructure's raw internal decode error instead of the ErrInvalidTemplateSettings message resolveTemplateDelimiters gives for the same class of problem. Moved delimiter validation before that Decode call (mirroring env's existing "extract before mapstructure touches it" pattern a few lines up) so a malformed delimiters value fails with the same, clearer sentinel error instead of leaking mapstructure's internals or being silently miscoerced. Added a table-driven unit test for convertRawDelimitersToStringSlice covering valid/empty/malformed inputs, plus an integration-level regression test confirming ProcessTmplWithDatasources itself now errors with ErrInvalidTemplateSettings on a malformed mid-loop delimiters value. Co-Authored-By: Claude Sonnet 5 <[email protected]> --------- Co-authored-by: Claude Sonnet 5 <[email protected]> Co-authored-by: atmos-pro[bot] <173522224+atmos-pro[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
what
shellcould be any shell command (or script).why
references