Skip to content

Support explicit CI git checkout and bundle Docker CLI - #2812

Merged
Andriy Knysh (aknysh) merged 36 commits into
mainfrom
osterman/support-ci-git-clone
Jul 31, 2026
Merged

Andriy Knysh (aknysh) merged 36 commits into
mainfrom
osterman/support-ci-git-clone

Conversation

@osterman

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

Copy link
Copy Markdown
Member

what

  • Add clone-local --ci and ATMOS_CI controls for no-argument CI checkout, including explicit opt-out behavior.
  • Replace hand-rolled argv/flag parsing in cmd/root.go for CI git-clone bootstrap detection with Cobra-identity + the existing cmd/git flag-handler infrastructure (resolveCICloneMode), removing ~140 lines of bespoke parsing.
  • Fix atmos git clone's no-arg CI checkout to resolve the branch from the CI provider's parsed short name instead of the raw ref, which previously failed real branch/PR checkouts.
  • Fix a Windows CI acceptance-test flake: a telemetry test was deleting the shared Atmos cache root mid-suite, which since feat(ci): GitHub Actions build cache (atmos ci cache) #2579 also holds the toolchain install tree.
  • Add Docker CLI support to the official Atmos image and update CI, command, and modernization guidance.
  • Cover selector precedence, bootstrap gating, and invalid environment input.

why

  • Enables checkout bootstrap before repository configuration is available while preserving explicit control.
  • Keeps CI bootstrap detection consistent with the repo's flag-handler architecture instead of a parallel hand-rolled path.
  • The raw-ref checkout bug meant the documented CI checkout replacement for actions/checkout (docs/prd/git-ops.md) never actually worked for a real branch or PR.
  • The shared-cache-root deletion was causing multi-week Windows CI flakiness unrelated to this PR's own diff, blocking merge.
  • Removes the need for Docker installation steps in Atmos container jobs.

references

  • N/A

Summary by CodeRabbit

  • New Features

    • Added --ci support for atmos git clone, configurable with ATMOS_CI.
    • No-argument cloning can now automatically use the current CI checkout.
    • Explicit CLI settings take precedence over environment configuration.
  • Bug Fixes

    • Fixed CI checkout failures caused by using full ref paths instead of branch names.
    • Improved handling of invalid CI configuration values.
  • Documentation

    • Updated Git clone, GitHub Actions, and CI setup guidance.
    • Added notes covering Docker support and CI bootstrap behavior.

@atmos-pro

atmos-pro Bot commented Jul 27, 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.

@github-actions github-actions Bot added the size/m Medium size PR label Jul 27, 2026
@github-actions

Copy link
Copy Markdown

Dependency Review

✅ No vulnerabilities or license issues found.

Scanned Files

None

@mergify

mergify Bot commented Jul 27, 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.

@mergify mergify Bot added the needs-cloudposse Needs Cloud Posse assistance label Jul 27, 2026
@osterman Erik Osterman (Cloud Posse) (osterman) added the minor New features that do not break anything label Jul 27, 2026
@github-actions

Copy link
Copy Markdown

Warning

Release Documentation Required

This PR is labeled minor or major and requires documentation updates:

  • Changelog entry - Add a blog post in website/blog/YYYY-MM-DD-feature-name.mdx
  • Roadmap update - Update website/src/data/roadmap.js with the new milestone

Alternatively: If this change doesn't require release documentation, remove the minor or major label.

@github-actions

Copy link
Copy Markdown

Resource Changes Found for bucket in test

Atmos CI

create

Plan: 4 to add, 0 to change, 0 to destroy.
To reproduce this locally, run:

atmos terraform plan bucket -s test

Create

+ aws_s3_bucket.checkov_target
+ aws_s3_bucket.this
+ aws_s3_bucket.trivy_target
+ aws_s3_bucket_public_access_block.trivy_target
Terraform Plan Summary
  # aws_s3_bucket.checkov_target will be created
  + resource "aws_s3_bucket" "checkov_target" {
      + acceleration_status         = (known after apply)
      + acl                         = (known after apply)
      + arn                         = (known after apply)
      + bucket                      = "atmos-native-ci-e2e-checkov-test"
      + bucket_domain_name          = (known after apply)
      + bucket_prefix               = (known after apply)
      + bucket_regional_domain_name = (known after apply)
      + force_destroy               = false
      + hosted_zone_id              = (known after apply)
      + id                          = (known after apply)
      + object_lock_enabled         = (known after apply)
      + policy                      = (known after apply)
      + region                      = (known after apply)
      + request_payer               = (known after apply)
      + tags_all                    = (known after apply)
      + website_domain              = (known after apply)
      + website_endpoint            = (known after apply)

      + cors_rule (known after apply)

      + grant (known after apply)

      + lifecycle_rule (known after apply)

      + logging (known after apply)

      + object_lock_configuration (known after apply)

      + replication_configuration (known after apply)

      + server_side_encryption_configuration (known after apply)

      + versioning (known after apply)

      + website (known after apply)
    }

  # aws_s3_bucket.this will be created
  + resource "aws_s3_bucket" "this" {
      + acceleration_status         = (known after apply)
      + acl                         = (known after apply)
      + arn                         = (known after apply)
      + bucket                      = "atmos-native-ci-e2e-test"
      + bucket_domain_name          = (known after apply)
      + bucket_prefix               = (known after apply)
      + bucket_regional_domain_name = (known after apply)
      + force_destroy               = false
      + hosted_zone_id              = (known after apply)
      + id                          = (known after apply)
      + object_lock_enabled         = (known after apply)
      + policy                      = (known after apply)
      + region                      = (known after apply)
      + request_payer               = (known after apply)
      + tags                        = {
          + "AtmosFixture" = "native-ci-e2e"
          + "Stage"        = "test"
        }
      + tags_all                    = {
          + "AtmosFixture" = "native-ci-e2e"
          + "Stage"        = "test"
        }
      + website_domain              = (known after apply)
      + website_endpoint            = (known after apply)

      + cors_rule (known after apply)

      + grant (known after apply)

      + lifecycle_rule (known after apply)

      + logging (known after apply)

      + object_lock_configuration (known after apply)

      + replication_configuration (known after apply)

      + server_side_encryption_configuration (known after apply)

      + versioning (known after apply)

      + website (known after apply)
    }

  # aws_s3_bucket.trivy_target will be created
  + resource "aws_s3_bucket" "trivy_target" {
      + acceleration_status         = (known after apply)
      + acl                         = (known after apply)
      + arn                         = (known after apply)
      + bucket                      = "atmos-native-ci-e2e-trivy-test"
      + bucket_domain_name          = (known after apply)
      + bucket_prefix               = (known after apply)
      + bucket_regional_domain_name = (known after apply)
      + force_destroy               = false
      + hosted_zone_id              = (known after apply)
      + id                          = (known after apply)
      + object_lock_enabled         = (known after apply)
      + policy                      = (known after apply)
      + region                      = (known after apply)
      + request_payer               = (known after apply)
      + tags_all                    = (known after apply)
      + website_domain              = (known after apply)
      + website_endpoint            = (known after apply)

      + cors_rule (known after apply)

      + grant (known after apply)

      + lifecycle_rule (known after apply)

      + logging (known after apply)

      + object_lock_configuration (known after apply)

      + replication_configuration (known after apply)

      + server_side_encryption_configuration (known after apply)

      + versioning (known after apply)

      + website (known after apply)
    }

  # aws_s3_bucket_public_access_block.trivy_target will be created
  + resource "aws_s3_bucket_public_access_block" "trivy_target" {
      + block_public_acls       = true
      + block_public_policy     = true
      + bucket                  = (known after apply)
      + id                      = (known after apply)
      + ignore_public_acls      = true
      + restrict_public_buckets = true
    }

Plan: 4 to add, 0 to change, 0 to destroy.

Changes to Outputs:
  + bucket_name = "atmos-native-ci-e2e-test"

@coderabbitai

coderabbitai Bot commented Jul 27, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The PR adds explicit CI-mode selection to atmos git clone, gates no-argument CI bootstrap behavior, fixes checkout branch handling, updates Docker-based CI setup, and isolates toolchain and Packer test behavior.

Changes

CI-aware git clone

Layer / File(s) Summary
Clone CI mode resolution
cmd/git/flags.go, cmd/git/clone.go, cmd/git/orchestration_test.go, cmd/git/flags_test.go
Adds --ci and ATMOS_CI, resolves their precedence, validates values, and passes the resulting mode through no-argument clone handling.
CI bootstrap gating
cmd/git/bootstrap.go, cmd/root.go, cmd/root_test.go, cmd/git/bootstrap_test.go
Restricts bootstrap to the native no-argument clone invocation and applies CI configuration during config initialization.
Checkout branch handling and documentation
cmd/git/clone.go, cmd/git/provider_stub_test.go, website/docs/cli/commands/git/git-clone.mdx, docs/prd/git-ops.md, docs/fixes/2026-07-30-git-clone-ci-checkout-branch-ref-bug.md
Uses the provider’s short branch name for checkout and documents CI selectors, bootstrap constraints, and validation details.

Containerized CI infrastructure

Layer / File(s) Summary
Docker-enabled CI execution
Dockerfile, cmd/docker_and_action_regression_test.go, .github/workflows/test.yml, website/docs/integrations/github-actions/setup-atmos.mdx
Installs and verifies docker.io, configures a Docker Hub mirror, and documents runner socket usage.
Pre-commit validation bootstrap
.github/workflows/pre-commit.yml, .pre-commit-config.yaml
Sets a released Atmos bootstrap version, installs it in CI, and adds affected-file validation.
Modernization and link-check guidance
agent-skills/skills/atmos-modernization/SKILL.md, lychee.toml, docs/fixes/2026-07-30-lychee-docs-docker-com-connection-reset.md
Updates Docker and concurrency guidance and excludes docs.docker.com from Lychee checks.

Test isolation and regression handling

Layer / File(s) Summary
Toolchain test isolation
pkg/toolchain/install_test.go, pkg/toolchain/list_test.go
Uses per-test toolchain install paths and restores the complete Atmos configuration after tests.
Packer test detection
cmd/packer_build_test.go, docs/fixes/2026-07-30-packer-build-test-manifest-flake.md
Recognizes Failed loading manifest as Packer execution output and documents the Windows CI capture case.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant CloneParser
  participant RootBootstrap
  participant CIProvider
  participant Git
  User->>CloneParser: Run atmos git clone with no positional arguments
  CloneParser->>RootBootstrap: Resolve --ci or ATMOS_CI
  RootBootstrap->>CIProvider: Detect CI context
  CIProvider-->>RootBootstrap: Return Ref and short Branch
  RootBootstrap->>Git: Clone current repository with --branch Branch
Loading

Possibly related PRs

Suggested reviewers: aknysh

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 55.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely summarizes the two primary changes: explicit CI git checkout support and bundling the Docker CLI.
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 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch osterman/support-ci-git-clone

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.

🧹 Nitpick comments (4)
Dockerfile (1)

22-22: 🔒 Security & Privacy | 🔵 Trivial | ⚡ Quick win

Consider docker-cli instead of docker.io — only the CLI is needed here.

The stated goal (per this PR's SKILL.md/docs changes) is Docker CLI support so Atmos container jobs can talk to the runner-provided Docker daemon/socket — not run a bundled daemon. Debian's docker.io package ships the full daemon + client and its own description warns it "starts the daemon immediately and adds iptables rules for container networking," recommending docker-cli for just the client binary. docker-cli is available in Debian trixie (same source package) and avoids that daemon/iptables surface plus the extra dependency weight (containerd, runc, etc.) pulled in unnecessarily by docker.io.

♻️ Proposed fix
-    apt-get -y install  --no-install-recommends curl git ca-certificates docker.io python3; \
+    apt-get -y install --no-install-recommends curl git ca-certificates docker-cli python3; \
🤖 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 `@Dockerfile` at line 22, Replace the docker.io dependency in the Dockerfile
apt-get install command with docker-cli, keeping curl, git, ca-certificates, and
python3 unchanged so the image provides only Docker client support without
installing the daemon and its related dependencies.
cmd/root.go (2)

1674-1692: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Bootstrap-time --ci arg scan only recognizes two exact literal forms.

gitCloneBootstrapCIMode matches only "--ci", "--ci=true", "--ci=false" literally, while resolveCICloneMode in cmd/git/clone.go parses the actual flag value with strconv.ParseBool (accepting 0/1/FALSE/False/etc.). A user passing --ci=0 to opt out before repo config is loaded won't have that recognized here, and the pre-Cobra bootstrap gate could still initialize the CI-config bypass path inconsistently with the later, authoritative resolution in clone.go.

♻️ Proposed fix — parse the value instead of literal-matching
 	for _, arg := range cloneArgs[2:] {
-		switch arg {
-		case "--ci":
-			return ciCloneBootstrapEnabled
-		case "--ci=true":
-			return ciCloneBootstrapEnabled
-		case "--ci=false":
-			return ciCloneBootstrapDisabled
+		if arg == "--ci" {
+			return ciCloneBootstrapEnabled
+		}
+		if value, ok := strings.CutPrefix(arg, "--ci="); ok {
+			if enabled, err := strconv.ParseBool(value); err == nil {
+				return ciCloneBootstrapModeFromBool(enabled)
+			}
 		}
 	}

Since this touches how a CLI flag value is parsed at bootstrap time (before Cobra/pflag runs), please confirm the intended contract for accepted --ci= value spellings matches resolveCICloneMode's strconv.ParseBool semantics.

🤖 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/root.go` around lines 1674 - 1692, Update gitCloneBootstrapCIMode to
parse --ci= values using the same strconv.ParseBool semantics as
resolveCICloneMode, accepting all equivalent boolean spellings such as 0, 1,
FALSE, and False. Preserve the existing handling for bare --ci, return the
corresponding enabled or disabled mode for successfully parsed values, and fall
back to the environment-derived mode for invalid or absent values.

1674-1692: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Magic string "--ci" duplicates flagCI with no compile-time link.

cmd/git/flags.go defines flagCI = "ci" as the source of truth for this flag's name, but cmd/root.go re-hardcodes "--ci"/"--ci=true"/"--ci=false" as raw literals (and cmd/root_test.go does the same). If the flag is ever renamed in flags.go, this bootstrap-time scan — and its tests — would silently stop detecting it, with no compiler or test failure surfacing the drift.

🤖 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/root.go` around lines 1674 - 1692, Update gitCloneBootstrapCIMode to
build its --ci argument comparisons from the cmd/git flagCI constant instead of
hard-coded flag strings, covering bare, true, and false forms. Update the
related cmd/root_test.go cases to use the same flagCI-derived values so
production logic and tests remain linked to the flag’s source of truth.
cmd/git/clone.go (1)

123-147: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Inconsistent error construction for invalid --ci value.

Line 128 raises a plain fmt.Errorf(...) for the flag-parse failure, while the ATMOS_CI branch a few lines down correctly uses errUtils.Build(errUtils.ErrInvalidConfig)...Err() with hints and exit code. Since --ci is a bool flag, this ParseBool call can't actually fail in practice, but for consistency (and in case the flag type ever changes) it should follow the same static-error pattern as its sibling branch.

As per coding guidelines, "Wrap all errors with static errors from errors/errors.go; use errors.Join for multiple errors, %w for string context, the error builder for complex errors... Never use dynamic errors directly."

♻️ Proposed fix
 			enabled, err := strconv.ParseBool(flag.Value.String())
 			if err != nil {
-				return ciCloneModeAuto, fmt.Errorf("invalid --%s value %q: %w", flagCI, flag.Value.String(), err)
+				return ciCloneModeAuto, errUtils.Build(errUtils.ErrInvalidConfig).
+					WithExplanation(fmt.Sprintf("--%s must be a boolean value, got %q.", flagCI, flag.Value.String())).
+					WithExitCode(2).
+					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/git/clone.go` around lines 123 - 147, Update the invalid --ci parsing
branch in resolveCICloneMode to construct the error through
errUtils.Build(errUtils.ErrInvalidConfig), matching the ATMOS_CI validation
path. Preserve the flag value context, add the appropriate explanation and hint
for --ci, and retain exit code 2 instead of returning the direct fmt.Errorf.

Source: Coding guidelines

🤖 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.

Nitpick comments:
In `@cmd/git/clone.go`:
- Around line 123-147: Update the invalid --ci parsing branch in
resolveCICloneMode to construct the error through
errUtils.Build(errUtils.ErrInvalidConfig), matching the ATMOS_CI validation
path. Preserve the flag value context, add the appropriate explanation and hint
for --ci, and retain exit code 2 instead of returning the direct fmt.Errorf.

In `@cmd/root.go`:
- Around line 1674-1692: Update gitCloneBootstrapCIMode to parse --ci= values
using the same strconv.ParseBool semantics as resolveCICloneMode, accepting all
equivalent boolean spellings such as 0, 1, FALSE, and False. Preserve the
existing handling for bare --ci, return the corresponding enabled or disabled
mode for successfully parsed values, and fall back to the environment-derived
mode for invalid or absent values.
- Around line 1674-1692: Update gitCloneBootstrapCIMode to build its --ci
argument comparisons from the cmd/git flagCI constant instead of hard-coded flag
strings, covering bare, true, and false forms. Update the related
cmd/root_test.go cases to use the same flagCI-derived values so production logic
and tests remain linked to the flag’s source of truth.

In `@Dockerfile`:
- Line 22: Replace the docker.io dependency in the Dockerfile apt-get install
command with docker-cli, keeping curl, git, ca-certificates, and python3
unchanged so the image provides only Docker client support without installing
the daemon and its related dependencies.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 8a94369e-fb12-4cad-b996-918a39683437

📥 Commits

Reviewing files that changed from the base of the PR and between b0dcb79 and 9d14f46.

📒 Files selected for processing (10)
  • Dockerfile
  • agent-skills/skills/atmos-modernization/SKILL.md
  • cmd/git/clone.go
  • cmd/git/flags.go
  • cmd/git/flags_test.go
  • cmd/git/orchestration_test.go
  • cmd/root.go
  • cmd/root_test.go
  • website/docs/cli/commands/git/git-clone.mdx
  • website/docs/integrations/github-actions/setup-atmos.mdx

coderabbitai[bot]
coderabbitai Bot previously approved these changes Jul 27, 2026
@osterman Erik Osterman (Cloud Posse) (osterman) added patch A minor, backward compatible change and removed minor New features that do not break anything labels Jul 27, 2026
coderabbitai[bot]
coderabbitai Bot previously approved these changes Jul 27, 2026
coderabbitai[bot]
coderabbitai Bot previously approved these changes Jul 27, 2026

@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: 1

🧹 Nitpick comments (1)
cmd/root_test.go (1)

250-254: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Use cmd.NewTestKit(t) instead of a bespoke glob config snapshot.

NewTestKit already snapshots and restores package root state for command tests, so this helper is a redundant, hand-rolled layer on top of the existing isolation path.

🤖 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/root_test.go` around lines 250 - 254, Replace the bespoke atmosConfig
snapshot in saveRestoreAtmosConfig with cmd.NewTestKit(t), relying on its
built-in package root state isolation. Remove the manual original capture and
cleanup while preserving test setup behavior.

Source: Coding guidelines

🤖 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/root_test.go`:
- Around line 256-259: Make the Git clone bootstrap tests deterministic by
explicitly setting ATMOS_CI in the shared test helper or each affected test.
Ensure TestApplyCIGitCloneBootstrap_AllowsBootstrap pins ATMOS_CI to the value
that permits bootstrap, and apply the same explicit guard to the
NoCIProviderDetected case; use t.Setenv so the original environment is restored
automatically.

---

Nitpick comments:
In `@cmd/root_test.go`:
- Around line 250-254: Replace the bespoke atmosConfig snapshot in
saveRestoreAtmosConfig with cmd.NewTestKit(t), relying on its built-in package
root state isolation. Remove the manual original capture and cleanup while
preserving test setup behavior.
🪄 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 Plus

Run ID: 9eecff93-27c4-4198-9101-b62bae356ee4

📥 Commits

Reviewing files that changed from the base of the PR and between 2682303 and 1bd63df.

📒 Files selected for processing (4)
  • cmd/git/bootstrap.go
  • cmd/git/bootstrap_test.go
  • cmd/root.go
  • cmd/root_test.go

Comment thread cmd/root_test.go Resolved
Fix three CodeRabbit-flagged issues:

- pkg/toolchain/install_test.go, list_test.go: several tests set
  Toolchain.InstallPath to a per-test t.TempDir() (needed to keep real
  installs off the shared XDG toolchain cache) but only partially
  restored atmosConfig afterward, leaving InstallPath pointed at a
  directory that TempDir cleanup had already deleted. Save/restore the
  full prior atmosConfig instead of reconstructing a partial one.

- cmd/root_test.go: TestApplyCIGitCloneBootstrap_AllowsBootstrap and
  TestApplyCIGitCloneBootstrap_NoCIProviderDetected didn't pin
  ATMOS_CI, so an ambient ATMOS_CI=false in the developer/CI
  environment could make resolveCICloneMode resolve to "disabled" and
  fail the test non-deterministically. Pin ATMOS_CI explicitly,
  mirroring the existing guard in cmd/git/bootstrap_test.go.

- .github/workflows/test.yml: the Docker Hub mirror configuration step
  used jq's `unique` to append mirror.gcr.io to registry-mirrors, which
  sorts the array and can silently reorder any pre-existing mirrors
  (Docker tries mirrors in listed order). Only append when absent,
  preserving existing order.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
coderabbitai[bot]
coderabbitai Bot previously approved these changes Jul 30, 2026
Add a real (non-stubbed) native-ci job cloning a local fixture repo to
exercise the CI git-clone bootstrap path end-to-end, which immediately
surfaced a pre-existing bug: runCICheckout passed the raw ref (e.g.
refs/heads/main) as `git clone --branch`, which rejects full ref paths.
Use the CI context's already-parsed branch name instead, and document
the config-init tolerance mechanism in docs/prd/git-ops.md.

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

@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.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
cmd/git/clone.go (1)

123-129: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Use the canonical configuration error for invalid --ci.

Line 128 returns a raw fmt.Errorf, unlike invalid ATMOS_CI below. Return errUtils.ErrInvalidConfig with the same exit code and hint contract instead.

As per coding guidelines, “Wrap all errors with static errors from errors/errors.go” and “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 `@cmd/git/clone.go` around lines 123 - 129, Update resolveCICloneMode’s invalid
--ci parsing branch to return the canonical errUtils.ErrInvalidConfig error,
preserving the same exit code and hint contract used for invalid ATMOS_CI
values; do not return the dynamically formatted fmt.Errorf directly.

Source: Coding guidelines

🤖 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.

Outside diff comments:
In `@cmd/git/clone.go`:
- Around line 123-129: Update resolveCICloneMode’s invalid --ci parsing branch
to return the canonical errUtils.ErrInvalidConfig error, preserving the same
exit code and hint contract used for invalid ATMOS_CI values; do not return the
dynamically formatted fmt.Errorf directly.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 5dca25f3-6c1d-46fa-9262-f10dca6bce4e

📥 Commits

Reviewing files that changed from the base of the PR and between 1bd63df and 6fa52e2.

📒 Files selected for processing (11)
  • .github/workflows/native-ci.yml
  • .github/workflows/test.yml
  • cmd/git/clone.go
  • cmd/git/provider_stub_test.go
  • cmd/root_test.go
  • docs/fixes/2026-07-30-git-clone-ci-checkout-branch-ref-bug.md
  • docs/fixes/2026-07-30-lychee-docs-docker-com-connection-reset.md
  • docs/prd/git-ops.md
  • lychee.toml
  • pkg/toolchain/install_test.go
  • pkg/toolchain/list_test.go

coderabbitai[bot]
coderabbitai Bot previously approved these changes Jul 30, 2026
The synthetic fixture-repo redirection (overriding GITHUB_SERVER_URL/
GITHUB_REPOSITORY at the step level) worked in a local shell but not in
a real Actions run: GitHub Actions silently ignores GITHUB_-prefixed
env overrides, so the job actually cloned the real cloudposse/atmos
repo and failed a later assertion meant for the fixture. That's too
curve-fitted to the local repro to be a real test of native CI in CI,
and not fixable by adjusting the script further, so drop it rather than
keep a job that looks like coverage but silently tests the wrong thing.
The runCICheckout branch/ref fix itself is unaffected — it was found
and verified via a local (non-CI) reproduction and is covered by the
corrected unit test.

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

@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: 1

🤖 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 `@docs/fixes/2026-07-30-git-clone-ci-checkout-branch-ref-bug.md`:
- Line 31: Update the prose in the git clone CI checkout documentation so “a CI
provider reports (e.g.” becomes “a CI provider reports, e.g.”, adding the
missing comma without changing the surrounding text.
🪄 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 Plus

Run ID: 594517a5-afea-4004-b67e-ae6a82a8490a

📥 Commits

Reviewing files that changed from the base of the PR and between 6fa52e2 and 91e3572.

📒 Files selected for processing (1)
  • docs/fixes/2026-07-30-git-clone-ci-checkout-branch-ref-bug.md

coderabbitai[bot]
coderabbitai Bot previously approved these changes Jul 30, 2026
…it-clone

# Conflicts:
#	docs/fixes/2026-07-29-telemetry-test-deleting-shared-toolchain-cache.md
#	pkg/toolchain/install_test.go
#	pkg/toolchain/list_test.go
#	tests/preconditions.go
TestPackerBuildCmdWithDirectoryTemplate failed on Windows CI (job
91001781247) with "Failed loading manifest ... EOF" -- text packer's
own manifest post-processor produces, never Atmos. The packerRan
heuristic didn't recognize this specific string, so it fell through to
a real test failure even though packer clearly ran and failed for
environmental (credential) reasons, same as the test already tolerates
for other packer error shapes.

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

@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: 1

🧹 Nitpick comments (1)
cmd/packer_build_test.go (1)

82-92: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Centralize the shared Packer-output predicate.

Both tests duplicate the same heuristic and Windows explanation. Extracting this into a helper would prevent future marker updates from diverging between the two test paths.

Also applies to: 225-235

🤖 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/packer_build_test.go` around lines 82 - 92, The Packer-output heuristic
is duplicated across the tests and should be centralized. Extract the shared
predicate, including the Windows-output explanation and all markers such as
“amazon-ebs”, “Build”, “credential”, “Packer”, and “Failed loading manifest”,
into a helper, then replace both test paths with calls to that helper so future
marker changes remain synchronized.
🤖 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 `@docs/fixes/2026-07-30-packer-build-test-manifest-flake.md`:
- Around line 7-14: Revise the sentence describing the “Failed loading manifest”
error so it is grammatically complete and clearly attributes the error to
Packer’s text manifest post-processor rather than Atmos, while preserving the
existing context about the affected tests.

---

Nitpick comments:
In `@cmd/packer_build_test.go`:
- Around line 82-92: The Packer-output heuristic is duplicated across the tests
and should be centralized. Extract the shared predicate, including the
Windows-output explanation and all markers such as “amazon-ebs”, “Build”,
“credential”, “Packer”, and “Failed loading manifest”, into a helper, then
replace both test paths with calls to that helper so future marker changes
remain synchronized.
🪄 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 Plus

Run ID: e0d2d894-0be9-4cd5-b547-75895cf6f8c3

📥 Commits

Reviewing files that changed from the base of the PR and between bb2d6a3 and 258ecbf.

📒 Files selected for processing (2)
  • cmd/packer_build_test.go
  • docs/fixes/2026-07-30-packer-build-test-manifest-flake.md

@atmos-pro

atmos-pro Bot commented Jul 31, 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.

@github-actions

github-actions Bot commented Aug 1, 2026

Copy link
Copy Markdown

These changes were released in v1.225.0-rc.4.

This branch was successfully deployed

1 active and 1 inactive (outdated) deployments
preview — 258ecbf2 Deployed Jul 31, 2026 by github-actions[bot]
screengrabs — 87fa547f Deployed Jul 30, 2026 by osterman via build #836
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

patch A minor, backward compatible change size/m Medium size PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants