Skip to content

fix: treat missing Atmos config in BASE as empty baseline in atmos describe affected#2296

Merged
aknysh merged 4 commits intomainfrom
copilot/improve-error-message-atmos
Apr 13, 2026
Merged

fix: treat missing Atmos config in BASE as empty baseline in atmos describe affected#2296
aknysh merged 4 commits intomainfrom
copilot/improve-error-message-atmos

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 7, 2026

atmos describe affected fatally errors with failed to find import on greenfield branches (or when the base ref predates Atmos adoption) because ErrFailedToFindImport from BASE stack processing was propagated as a hard failure. The correct behavior is to treat an unconfigured BASE as an empty baseline — everything in HEAD is new, therefore everything is affected.

Changes

  • internal/exec/describe_affected_utils.goexecuteDescribeAffected now handles ErrFailedToFindImport alongside ErrNoStackManifestsFound in both BASE processing paths:

    • FindAllStackConfigsInPathsForStack returning ErrFailedToFindImport (stacks directory absent in BASE) → sets remoteStackConfigFilesAbsolutePaths = []string{}
    • ExecuteDescribeStacks returning ErrFailedToFindImport (imports unresolvable in BASE) → sets remoteStacks = map[string]any{}

    Both cases emit a WARN log with actionable context:

    WARN No Atmos stack manifests found in BASE; treating BASE as empty (all HEAD components will be reported as affected)
         hint="This is expected for greenfield branches or when the base branch does not yet use Atmos"
    
  • tests/describe_affected_greenfield_test.go — Integration test that initializes a bare-minimum git repo (single commit, no Atmos config) as the BASE and asserts all known HEAD components (component-1, component-2 in prod/nonprod) appear in the affected output without error.

Copilot AI linked an issue Apr 7, 2026 that may be closed by this pull request
@mergify mergify bot added triage Needs triage wip Work in Progress: Not ready for final review or merge labels Apr 7, 2026
Copilot AI and others added 2 commits April 7, 2026 15:58
…escribe affected

Agent-Logs-Url: https://github.com/cloudposse/atmos/sessions/247337de-2a29-4144-917f-2eb321659700

Co-authored-by: osterman <52489+osterman@users.noreply.github.com>
…nd add specific component assertions in test

Agent-Logs-Url: https://github.com/cloudposse/atmos/sessions/247337de-2a29-4144-917f-2eb321659700

Co-authored-by: osterman <52489+osterman@users.noreply.github.com>
Copilot AI changed the title [WIP] Improve error message for atmos describe affected fix: treat missing Atmos config in BASE as empty baseline in atmos describe affected Apr 7, 2026
Copilot AI requested a review from osterman April 7, 2026 16:03
@mergify mergify bot removed the wip Work in Progress: Not ready for final review or merge label Apr 7, 2026
@osterman osterman added the patch A minor, backward compatible change label Apr 7, 2026
@github-actions github-actions bot added the size/m Medium size PR label Apr 7, 2026
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 7, 2026

Dependency Review

✅ No vulnerabilities or license issues found.

Snapshot Warnings

⚠️: No snapshots were found for the head SHA 52c225d.
Ensure that dependencies are being submitted on PR branches and consider enabling retry-on-snapshot-warnings. See the documentation for more information and troubleshooting advice.

Scanned Files

None

@osterman osterman removed the triage Needs triage label Apr 7, 2026
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 7, 2026

Codecov Report

❌ Patch coverage is 38.46154% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 77.25%. Comparing base (12c72e9) to head (52c225d).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
internal/exec/describe_affected_utils.go 38.46% 5 Missing and 3 partials ⚠️
Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #2296   +/-   ##
=======================================
  Coverage   77.24%   77.25%           
=======================================
  Files        1074     1074           
  Lines      101900   101910   +10     
=======================================
+ Hits        78716    78730   +14     
+ Misses      18846    18837    -9     
- Partials     4338     4343    +5     
Flag Coverage Δ
unittests 77.25% <38.46%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
internal/exec/describe_affected_utils.go 77.57% <38.46%> (+2.09%) ⬆️

... and 6 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@osterman osterman marked this pull request as ready for review April 13, 2026 17:16
@osterman osterman requested a review from a team as a code owner April 13, 2026 17:16
@atmos-pro
Copy link
Copy Markdown
Contributor

atmos-pro bot commented Apr 13, 2026

Tip

Atmos Pro  

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

@aknysh aknysh merged commit 29eefb7 into main Apr 13, 2026
58 checks passed
@atmos-pro
Copy link
Copy Markdown
Contributor

atmos-pro bot commented Apr 13, 2026

Note

Atmos Pro  

Waiting for your GitHub Actions workflow to upload affected stacks.
Learn More.

@aknysh aknysh deleted the copilot/improve-error-message-atmos branch April 13, 2026 23:07
@github-actions
Copy link
Copy Markdown

These changes were released in v1.216.0-rc.0.

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.

atmos describe affected on greenfield branch raises failed to find import

3 participants