Skip to content

feat(list): add matrix output format to list instances command - #2322

Merged
Andriy Knysh (aknysh) merged 9 commits into
mainfrom
feat/list-instances-matrix
Apr 14, 2026
Merged

Andriy Knysh (aknysh) merged 9 commits into
mainfrom
feat/list-instances-matrix

Conversation

@johncblandii

@johncblandii John C. Bland II (johncblandii) commented Apr 13, 2026 •

Copy link
Copy Markdown
Contributor

what

  • Add --format=matrix support to atmos list instances, producing GitHub Actions-compatible matrix JSON identical to atmos describe affected --format=matrix
  • Add --output-file flag for writing results in key=value format (for $GITHUB_OUTPUT)
  • Extract shared matrix types and output logic into pkg/matrix/ for DRY reuse across both describe affected and list instances

why

  • CI/CD pipelines need matrix output from list instances to drive parallel GitHub Actions jobs, just like describe affected already supports
  • Sharing the matrix output logic between commands avoids duplication and ensures consistent output format
  • The --output-file flag enables direct integration with GitHub Actions $GITHUB_OUTPUT without shell redirection

references

  • Output format matches atmos describe affected --format=matrix exactly:
    {"include":[{"stack":"...","component":"...","component_path":"...","component_type":"..."}]}
  • When using --output-file, writes matrix=<json> and affected_count=<N> lines

Summary by CodeRabbit

  • New Features

    • Added --format=matrix to emit GitHub Actions–compatible matrix JSON
    • Added --output-file / -o to write matrix results as key=value (for $GITHUB_OUTPUT); only supported with --format=matrix
    • Matrix entries include stack, component, component_path, and component_type
    • --format=matrix disallows --upload and triggers CI-friendly output behavior
  • Tests

    • Added coverage for matrix format, output-file flag, and file/stdout writing
  • Documentation

    • Added docs, blog post, and roadmap entry for matrix support

Add --format=matrix and --output-file support to `atmos list instances`,
producing GitHub Actions-compatible matrix JSON identical to
`atmos describe affected --format=matrix`. Extract shared matrix types
and output logic into pkg/matrix/ for DRY reuse across both commands.
Copilot AI review requested due to automatic review settings April 13, 2026 19:01
@atmos-pro

atmos-pro Bot commented Apr 13, 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.

@github-actions

github-actions Bot commented Apr 13, 2026 •

Copy link
Copy Markdown

Dependency Review

✅ No vulnerabilities or license issues found.

Snapshot Warnings

⚠️: No snapshots were found for the head SHA 99d535f.
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

@johncblandii John C. Bland II (johncblandii) added the minor New features that do not break anything label Apr 13, 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.

Copilot AI 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.

Pull request overview

Adds a shared GitHub Actions matrix output implementation and wires it into atmos list instances, aligning behavior with the existing describe affected --format=matrix flow and enabling $GITHUB_OUTPUT-style file output.

Changes:

  • Introduces pkg/matrix with shared matrix types plus JSON and key=value output writing.
  • Adds --format=matrix and --output-file plumbing to atmos list instances.
  • Refactors describe affected matrix output to use the shared pkg/matrix implementation and updates/relocates related tests.

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
pkg/matrix/matrix.go New shared matrix types + marshal/write helpers.
pkg/matrix/matrix_test.go Unit tests for matrix marshaling and output writing.
pkg/list/list_instances.go Adds matrix-format execution path and output-file support.
pkg/list/list_instances_coverage_test.go Coverage tests for list-instances matrix mode and output-file writing.
pkg/list/format/formatter.go Adds matrix to format constants/validation.
pkg/list/format/formatter_test.go Updates validation tests to include matrix.
pkg/list/extract/matrix.go New helper to extract stack/component entries into matrix entries.
pkg/list/extract/matrix_test.go Tests for stacksMap → matrix entry extraction.
internal/exec/describe_affected.go Switches matrix output to pkg/matrix and converts to []matrix.Entry.
internal/exec/describe_affected_test.go Updates affected→matrix conversion tests and removes duplicated matrix output tests.
cmd/list/instances.go Adds --output-file flag wiring and passes through to pkg/list options.
cmd/list/instances_test.go Extends options tests and checks output-file flag registration.
cmd/list/flag_wrappers.go Extends shared --format valid values and adds --output-file wrapper.
cmd/list/stacks.go Trailing newline change only.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread pkg/matrix/matrix.go Outdated
Comment thread pkg/list/format/formatter.go
Comment thread cmd/list/flag_wrappers.go
Comment thread cmd/list/flag_wrappers.go Outdated
Comment thread pkg/matrix/matrix_test.go Outdated
Comment thread pkg/matrix/matrix.go
@coderabbitai

coderabbitai Bot commented Apr 13, 2026 •

Copy link
Copy Markdown
Contributor

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

Adds a GitHub Actions matrix output mode to atmos list instances (--format=matrix) plus an --output-file/-o flag; centralizes matrix JSON generation in pkg/matrix; deterministic matrix entry extraction from stacks; and control-flow changes to emit/write matrix output instead of the renderer pipeline.

Changes

Cohort / File(s) Summary
CLI Flags & Options
cmd/list/flag_wrappers.go, cmd/list/instances.go, cmd/list/instances_test.go
--format/-f description and allowlist include matrix; added --output-file/-o (env ATMOS_LIST_OUTPUT_FILE); InstancesOptions gains OutputFile; tests updated for flag registration and defaults.
List Execution / Matrix Flow
pkg/list/list_instances.go, pkg/list/list_instances_coverage_test.go
InstancesCommandOptions adds OutputFile; ExecuteListInstancesCmd short-circuits for --format=matrix, rejects --upload, calls executeMatrixFormat which builds entries and writes via matrix.WriteOutput; tests cover matrix mode and invalid flag combos.
Matrix Extraction
pkg/list/extract/matrix.go, pkg/list/extract/matrix_test.go
New StacksMatrixEntries produces deterministic []matrix.Entry from stacks map with helpers for ordering and safe field extraction; tests cover ordering, missing fields, and nil handling.
Centralized Matrix Module
pkg/matrix/matrix.go, pkg/matrix/matrix_test.go
New Entry/Output types, Marshal(entries) produces compact {"include":[...]} JSON, and WriteOutput(entries, outputFile) writes to stdout or appends matrix=<json> + count=<n> to a file; tests validate marshal, file/stdout output, and error paths.
Describe Affected Refactor
internal/exec/describe_affected.go, internal/exec/describe_affected_test.go
Removed in-file matrix structs/IO; describeAffectedExec.view now converts to []matrix.Entry and uses matrix.WriteOutput; tests updated and legacy write-output tests removed; adds validation rejecting --output-file with non-matrix formats.
Format Validation
pkg/list/format/formatter.go, pkg/list/format/formatter_test.go
Added FormatMatrix constant; ValidateFormat treats matrix (and tree) as CLI-only formats excluded from renderer-valid list; tests updated to expect errors for tree/matrix.
Docs & Roadmap
website/docs/cli/commands/list/list-instances.mdx, website/blog/2026-04-13-list-instances-matrix.mdx, website/src/data/roadmap.js
Docs and blog post added for --format=matrix and --output-file with workflow example; roadmap updated with shipped milestone entry.

Sequence Diagram(s)

sequenceDiagram
    participant User as User
    participant CLI as CLI Parser
    participant List as ExecuteListInstancesCmd
    participant Describe as ExecuteDescribeStacks
    participant Extract as extract.StacksMatrixEntries
    participant Matrix as pkg/matrix.WriteOutput
    participant File as File/Stdout

    User->>CLI: atmos list instances --format=matrix --output-file=out.txt
    CLI->>List: run with opts(format=matrix, outputFile=out.txt)
    List->>Describe: ExecuteDescribeStacks()
    Describe-->>List: stacksMap
    List->>Extract: StacksMatrixEntries(stacksMap)
    Extract-->>List: []matrix.Entry
    List->>Matrix: WriteOutput(entries, outputFile)
    alt outputFile set
        Matrix->>File: append "matrix=<json>\ncount=<n>\n"
        File-->>Matrix: written
    else
        Matrix->>File: write JSON to stdout
        File-->>Matrix: written
    end
    Matrix-->>List: result
    List-->>User: exit
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Suggested reviewers

  • osterman
🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 74.36% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly describes the main change: adding matrix output format to the list instances command, which is the core feature across all modified files.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/list-instances-matrix

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 and usage tips.

@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)
pkg/matrix/matrix.go (2)

57-59: Consider handling the write error.

The error from data.Writeln is discarded. If stdout write fails, the caller won't know.

Suggested fix
 	// Write to stdout.
-	_ = data.Writeln(string(matrixJSON))
-	return nil
+	if err := data.Writeln(string(matrixJSON)); err != nil {
+		return fmt.Errorf("failed to write matrix output: %w", err)
+	}
+	return nil
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@pkg/matrix/matrix.go` around lines 57 - 59, The call to
data.Writeln(string(matrixJSON)) ignores its error; update the code in the
function that writes matrixJSON (the data.Writeln call) to capture the returned
error, and if non-nil return it (or wrap it with context, e.g.,
fmt.Errorf("writing matrix JSON to stdout: %w", err)) instead of discarding it
so the caller can detect stdout write failures.

66-81: Close error should be checked for write operations.

When writing to files, Close() can return errors indicating data wasn't flushed. Using defer alone discards this.

Suggested fix
 func writeToFile(matrixJSON []byte, count int, outputFile string) error {
 	defer perf.Track(nil, "matrix.writeToFile")()

 	f, err := os.OpenFile(outputFile, os.O_APPEND|os.O_CREATE|os.O_WRONLY, defaultFilePermissions)
 	if err != nil {
 		return fmt.Errorf("failed to open output file %s: %w", outputFile, err)
 	}
-	defer f.Close()

 	// Write matrix=<json> format.
 	if _, err := fmt.Fprintf(f, "matrix=%s\n", string(matrixJSON)); err != nil {
+		_ = f.Close()
 		return fmt.Errorf("failed to write to output file %s: %w", outputFile, err)
 	}
 	// Also write count for convenience.
 	if _, err := fmt.Fprintf(f, "affected_count=%d\n", count); err != nil {
+		_ = f.Close()
 		return fmt.Errorf("failed to write count to output file %s: %w", outputFile, err)
 	}
 	log.Debug("Wrote matrix output to file", "file", outputFile, "count", count)
-	return nil
+	return f.Close()
 }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@pkg/matrix/matrix.go` around lines 66 - 81, The deferred f.Close() call
currently ignores Close errors; change the function that opens outputFile (the
scope with f, matrixJSON, count) to use a named error return (e.g., err error)
and replace defer f.Close() with a defer that captures the Close error: defer
func() { if cerr := f.Close(); cerr != nil && err == nil { err =
fmt.Errorf("failed to close output file %s: %w", outputFile, cerr) } }(), so any
flush/close failure is returned (and preserves earlier write errors if present)
after the fmt.Fprintf calls that write "matrix=" and "affected_count=" to f.
Ensure you reference the file handle f, outputFile and the named err return when
implementing this change.
pkg/list/extract/matrix.go (1)

82-140: Consider extracting shared iteration logic.

StacksMatrixEntries and StacksMatrixEntriesForComponent share ~80% of their code. A helper could reduce duplication:

func iterateStacks(stacksMap map[string]any, componentFilter string, fn func(stackName, componentName, componentType string, componentData map[string]any))

This is optional - the current code is readable and works correctly.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@pkg/list/extract/matrix.go` around lines 82 - 140, Extract the shared
stack/component iteration into a helper (e.g., iterateStacks) so both
StacksMatrixEntries and StacksMatrixEntriesForComponent reuse it: implement
iterateStacks(stacksMap map[string]any, componentFilter string, fn
func(stackName, componentName, componentType string, componentData
map[string]any)) that performs the sorted stackName loop, type/component lookups
(using getComponentTypes), and invokes fn for each matching component; then
replace the duplicated loops in StacksMatrixEntries and
StacksMatrixEntriesForComponent with calls to iterateStacks and move
matrix.Entry construction and component_info/component_path extraction into the
per-item callback to populate entries.
cmd/list/flag_wrappers.go (1)

42-43: Comment mentions wrong command.

The comment says "Used by: stacks" but per the PR context, this flag is used by the instances command with --format=matrix.

📝 Suggested fix
 // WithOutputFileFlag adds output file flag for writing results in key=value format (for $GITHUB_OUTPUT).
-// Used by: stacks (with --format=matrix).
+// Used by: instances (with --format=matrix).
 func WithOutputFileFlag(options *[]flags.Option) {
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@cmd/list/flag_wrappers.go` around lines 42 - 43, Update the comment on
WithOutputFileFlag in flag_wrappers.go to reference the correct command: change
"Used by: stacks (with --format=matrix)" to "Used by: instances (with
--format=matrix)" so the documentation matches actual usage of the
WithOutputFileFlag helper.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@cmd/list/flag_wrappers.go`:
- Around line 42-43: Update the comment on WithOutputFileFlag in
flag_wrappers.go to reference the correct command: change "Used by: stacks (with
--format=matrix)" to "Used by: instances (with --format=matrix)" so the
documentation matches actual usage of the WithOutputFileFlag helper.

In `@pkg/list/extract/matrix.go`:
- Around line 82-140: Extract the shared stack/component iteration into a helper
(e.g., iterateStacks) so both StacksMatrixEntries and
StacksMatrixEntriesForComponent reuse it: implement iterateStacks(stacksMap
map[string]any, componentFilter string, fn func(stackName, componentName,
componentType string, componentData map[string]any)) that performs the sorted
stackName loop, type/component lookups (using getComponentTypes), and invokes fn
for each matching component; then replace the duplicated loops in
StacksMatrixEntries and StacksMatrixEntriesForComponent with calls to
iterateStacks and move matrix.Entry construction and
component_info/component_path extraction into the per-item callback to populate
entries.

In `@pkg/matrix/matrix.go`:
- Around line 57-59: The call to data.Writeln(string(matrixJSON)) ignores its
error; update the code in the function that writes matrixJSON (the data.Writeln
call) to capture the returned error, and if non-nil return it (or wrap it with
context, e.g., fmt.Errorf("writing matrix JSON to stdout: %w", err)) instead of
discarding it so the caller can detect stdout write failures.
- Around line 66-81: The deferred f.Close() call currently ignores Close errors;
change the function that opens outputFile (the scope with f, matrixJSON, count)
to use a named error return (e.g., err error) and replace defer f.Close() with a
defer that captures the Close error: defer func() { if cerr := f.Close(); cerr
!= nil && err == nil { err = fmt.Errorf("failed to close output file %s: %w",
outputFile, cerr) } }(), so any flush/close failure is returned (and preserves
earlier write errors if present) after the fmt.Fprintf calls that write
"matrix=" and "affected_count=" to f. Ensure you reference the file handle f,
outputFile and the named err return when implementing this change.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 1a810297-b713-422f-bc8f-9ec54a929faf

📥 Commits

Reviewing files that changed from the base of the PR and between 12c72e9 and b38455d.

📒 Files selected for processing (14)
  • cmd/list/flag_wrappers.go
  • cmd/list/instances.go
  • cmd/list/instances_test.go
  • cmd/list/stacks.go
  • internal/exec/describe_affected.go
  • internal/exec/describe_affected_test.go
  • pkg/list/extract/matrix.go
  • pkg/list/extract/matrix_test.go
  • pkg/list/format/formatter.go
  • pkg/list/format/formatter_test.go
  • pkg/list/list_instances.go
  • pkg/list/list_instances_coverage_test.go
  • pkg/matrix/matrix.go
  • pkg/matrix/matrix_test.go

coderabbitai[bot]
coderabbitai Bot previously approved these changes Apr 13, 2026
…atrix output

Fix PR review comments: propagate data.Writeln error in WriteOutput,
normalize nil entries to empty slice in Marshal, rename env var to
ATMOS_LIST_OUTPUT_FILE, scope ValidateFormat to renderer-compatible
formats only (tree/matrix are special-cased by commands).

Add CI auto-detection: when ci.enabled is true and no --output-file is
provided, automatically write matrix output to $GITHUB_OUTPUT.

@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 the current code and only fix it if needed.

Inline comments:
In `@pkg/list/list_instances.go`:
- Around line 415-421: Add a guard that returns an explicit invalid-flag error
when --output-file is provided for non-matrix formats: inside the same branch
that handles the matrix format check (using formatFlag and format.FormatMatrix,
near the executeMatrixFormat(&atmosConfig, opts) call), detect if an outputFile/
output-file flag is set and formatFlag != string(format.FormatMatrix) and return
fmt.Errorf("%w: --output-file is only supported with --format=matrix",
errUtils.ErrInvalidFlag); this prevents silently ignoring --output-file for
other formats.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

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

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: e68fdd00-c3a8-483f-934f-86082279a5c3

📥 Commits

Reviewing files that changed from the base of the PR and between d4a0bab and 1ebfff9.

📒 Files selected for processing (6)
  • cmd/list/flag_wrappers.go
  • pkg/list/format/formatter.go
  • pkg/list/format/formatter_test.go
  • pkg/list/list_instances.go
  • pkg/matrix/matrix.go
  • pkg/matrix/matrix_test.go
✅ Files skipped from review due to trivial changes (1)
  • pkg/matrix/matrix.go
🚧 Files skipped from review as they are similar to previous changes (4)
  • pkg/list/format/formatter.go
  • cmd/list/flag_wrappers.go
  • pkg/matrix/matrix_test.go
  • pkg/list/format/formatter_test.go

Comment thread pkg/list/list_instances.go
Add guard in both list instances and describe affected to return an
explicit ErrInvalidFlag when --output-file is provided with a format
other than matrix. Previously the flag was silently ignored.
@github-actions github-actions Bot added size/l Large size PR and removed size/m Medium size PR labels Apr 13, 2026
coderabbitai[bot]
coderabbitai Bot previously approved these changes Apr 13, 2026
@codecov

codecov Bot commented Apr 13, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 83.89831% with 19 lines in your changes missing coverage. Please review.
✅ Project coverage is 77.27%. Comparing base (29eefb7) to head (99d535f).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
pkg/matrix/matrix.go 73.33% 4 Missing and 4 partials ⚠️
pkg/list/list_instances.go 70.58% 3 Missing and 2 partials ⚠️
pkg/list/extract/matrix.go 91.83% 2 Missing and 2 partials ⚠️
cmd/list/instances.go 33.33% 2 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2322      +/-   ##
==========================================
+ Coverage   77.23%   77.27%   +0.04%     
==========================================
  Files        1074     1076       +2     
  Lines      101910   101999      +89     
==========================================
+ Hits        78707    78824     +117     
+ Misses      18860    18828      -32     
- Partials     4343     4347       +4     
Flag Coverage Δ
unittests 77.27% <83.89%> (+0.04%) ⬆️

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

Files with missing lines Coverage Δ
cmd/list/flag_wrappers.go 100.00% <100.00%> (ø)
internal/exec/describe_affected.go 78.83% <100.00%> (+0.90%) ⬆️
pkg/list/format/formatter.go 100.00% <100.00%> (ø)
cmd/list/instances.go 17.85% <33.33%> (+0.57%) ⬆️
pkg/list/extract/matrix.go 91.83% <91.83%> (ø)
pkg/list/list_instances.go 80.00% <70.58%> (-0.58%) ⬇️
pkg/matrix/matrix.go 73.33% <73.33%> (ø)

... and 4 files with indirect coverage changes

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

- Drop unused StacksMatrixEntriesForComponent and its tests
- Rename output key from affected_count to count (shared across describe affected and list instances)
- Document --format=matrix and --output-file on the list instances page
- Refactor StacksMatrixEntries into smaller helpers to reduce cognitive complexity

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

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

🧹 Nitpick comments (1)
internal/exec/describe_affected_test.go (1)

1604-1607: Assert full entries in the multi-item case.

This only proves ordering of two strings. A regression that drops or corrupts ComponentPath / ComponentType for later items would still pass, so it would be better to compare the first and last matrix.Entry values directly. As per coding guidelines, "For slice-result tests, assert element contents, not just length. require.Len alone allows regressions that drop or corrupt contents. Assert at least the first and last element by value."

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@internal/exec/describe_affected_test.go` around lines 1604 - 1607, The test
currently only asserts length and two individual string fields; instead assert
the full first and last matrix.Entry values to prevent silent regressions—locate
where convertAffectedToMatrix is called (entries :=
convertAffectedToMatrix(affected)) and replace the weak checks with equality
assertions that compare entries[0] and entries[len(entries)-1] against expected
matrix.Entry instances (including Stack, Component, ComponentPath/ComponentType
and any other fields) so the test verifies element contents, not just ordering
or length.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@pkg/matrix/matrix.go`:
- Around line 51-63: Replace the ad-hoc dynamic errors returned from
Marshal(entries), writeToFile(...), and data.Writeln(...) with wrapped errors
that use the repository sentinel errors defined in errors/errors.go: capture
each underlying error (err) and return fmt.Errorf("<context>: %w",
errors.ErrSomething) where ErrSomething is the appropriate sentinel (e.g.,
ErrMarshal, ErrWriteFile, ErrWriteStdout — pick the exact names from
errors/errors.go) and wrap the original err using %w so callers can errors.Is;
if multiple failures must be combined use errors.Join to attach both the
sentinel and the original error; apply the same wrapping pattern to the later
branch (lines 71–84) as well.

In `@website/docs/cli/commands/list/list-instances.mdx`:
- Line 201: The sentence overstates behavior: update the docs for list-instances
(referencing `ci.enabled`, `--output-file`) to indicate that automatic writing
to `$GITHUB_OUTPUT` only occurs when a GitHub Actions output path is available
(e.g., `GITHUB_OUTPUT` env var present); tighten wording to say "When
`ci.enabled` is true in `atmos.yaml` and a GitHub Actions output path is
available (e.g., `GITHUB_OUTPUT` is set) and `--output-file` is not provided,
output is written to `$GITHUB_OUTPUT`; otherwise output falls back to stdout."
Ensure the doc mentions both cases and keeps CLI and website docs consistent.

---

Nitpick comments:
In `@internal/exec/describe_affected_test.go`:
- Around line 1604-1607: The test currently only asserts length and two
individual string fields; instead assert the full first and last matrix.Entry
values to prevent silent regressions—locate where convertAffectedToMatrix is
called (entries := convertAffectedToMatrix(affected)) and replace the weak
checks with equality assertions that compare entries[0] and
entries[len(entries)-1] against expected matrix.Entry instances (including
Stack, Component, ComponentPath/ComponentType and any other fields) so the test
verifies element contents, not just ordering or length.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

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

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 07f9d455-3f33-4da0-895c-4ef199c73bad

📥 Commits

Reviewing files that changed from the base of the PR and between e3f9ab9 and cbbe09d.

📒 Files selected for processing (8)
  • internal/exec/describe_affected_test.go
  • pkg/list/extract/matrix.go
  • pkg/list/extract/matrix_test.go
  • pkg/list/list_instances_coverage_test.go
  • pkg/matrix/matrix.go
  • pkg/matrix/matrix_test.go
  • website/blog/2026-04-13-list-instances-matrix.mdx
  • website/docs/cli/commands/list/list-instances.mdx
✅ Files skipped from review due to trivial changes (1)
  • pkg/matrix/matrix_test.go
🚧 Files skipped from review as they are similar to previous changes (1)
  • pkg/list/list_instances_coverage_test.go

Comment thread pkg/matrix/matrix.go
Comment thread website/docs/cli/commands/list/list-instances.mdx Outdated
…sertions

- Wrap pkg/matrix errors with static sentinels (ErrFailedToMarshalPayload, ErrWriteOutput, ErrOpenFile, ErrWriteFile) for errors.Is() matching
- Assert full matrix.Entry values in multi-item convertAffectedToMatrix test
- Clarify docs: auto-redirect to GITHUB_OUTPUT requires both ci.enabled and GITHUB_OUTPUT env var

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot added size/l Large size PR and removed size/m Medium size PR labels Apr 14, 2026
@aknysh
Andriy Knysh (aknysh) merged commit d7c0b43 into main Apr 14, 2026
59 checks passed
@aknysh
Andriy Knysh (aknysh) deleted the feat/list-instances-matrix branch April 14, 2026 00:52
@atmos-pro

atmos-pro Bot commented Apr 14, 2026

Copy link
Copy Markdown
Contributor

Note

Atmos Pro  

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

@github-actions

Copy link
Copy Markdown

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

Erik Osterman (Cloud Posse) (osterman) added a commit that referenced this pull request Aug 3, 2026
These nine carried `authors: [atmos]`, the generic team byline the changelog
skill says to avoid. Attribution follows the pull request that implemented the
feature, not the commit that added or later renamed the post file.

That distinction mattered. Five of the nine appear in `git log --diff-filter=A`
as added by #2753, a chronology-correction pass that renamed post files to match
their publication dates. Following renames instead points at the real work:

  list-components-fix                    #1949  osterman
  chdir-config-isolation                 #1941  osterman
  introducing-atmos-lsp                  #2030  aknysh
  introducing-atmos-ai                   #2030  aknysh
  ci-comments-env-var                    #2300  osterman
  list-instances-matrix                  #2322  johncblandii
  terraform-all-dependency-order-wired-up #2486  thejrose1984
  dotenv-include-support                 #1930  osterman
  toolchain-proxies                      #1687  osterman

Each byline is the GitHub pull request author rather than the git commit author,
because squash merges attribute the commit to whoever merged it.

#2300 needed a judgment call. It was authored by `app/copilot-swe-agent`, a bot.
The byline goes to osterman, who is the assignee and the human who drove the
change. A bot is not a contributor byline, and the person who merged it (aknysh)
did not do the work either.

johncblandii and thejrose1984 were missing from `authors.yml` and are added here,
which the changelog skill requires in the same change that references them.
thejrose1984 publishes no display name on GitHub, so the login stands in rather
than inventing one.

Verified: all 263 posts now resolve to a real `authors.yml` entry, no post
carries the generic byline, and the site builds with no author warnings.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

This branch was successfully deployed

1 active deployment
preview — 99d535f3 Deployed Apr 14, 2026 by github-actions[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

minor New features that do not break anything size/l Large size PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants