Commit ffa7f0a
Add list affected command with spinner UI improvements (#1874)
* feat: Add list affected command with improved spinner UI and fix false positives
- Implement new `atmos list affected` command to compare components between branches
- Fix false positive affected components when using `-C` flag by computing relative paths from git root
- Clear component config cache between branch comparisons to prevent contamination
- Generalize spinner implementation from internal/exec to pkg/ui/spinner for reusability
- Add FormatSuccess/FormatError to properly render markdown in toast messages
- Add git worktree operations for isolated branch comparisons
- Include documentation for false positive fix and new list affected command
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
* test: Increase test coverage for list affected command
Add comprehensive tests for multiple packages to improve coverage:
- pkg/list/list_affected_test.go: Tests for column parsing, ref selection,
filter/sorter building, and format-specific column handling
- pkg/git/worktree_test.go: Tests for worktree creation, removal, and
parent directory resolution
- pkg/ui/spinner/spinner_test.go: Tests for dynamic and manual spinner
models including Init, Update, and View methods
- cmd/list/affected_test.go: Tests for CLI command structure, flag
registration, and options handling
- internal/exec/describe_affected_utils_test.go: Tests for error paths
and excludeLocked functionality
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix: Address CodeRabbit review comments
- Add test case for excludeLocked=true to verify locked components are
excluded (fix structure: locked goes in metadata, not settings.metadata)
- Fix godot linter violations: add periods to comments on lines 521/527
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* test: Add more tests to improve coverage on affected lines
- Add TestGetBasePathToUse to validate_component_test.go to cover
getBasePathToUse function (9 lines covered)
- Add comprehensive spinner tests for edge cases including:
- TestSpinner_IsTTY for isTTY state verification
- TestSpinner_AlreadyStopped for nil program safety
- TestSpinnerModels_IgnoreNonQuitKeys for ignored key handling
- TestSpinnerModelStyle for spinner initialization
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix: Address CodeRabbit review comments
- Fix excludeLocked test to use metadata.locked consistently (matches
actual fixture usage in tests/fixtures/scenarios/)
- Rename tests variable to testCases in worktree_test.go to avoid
shadowing the imported tests package
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* test: Add edge case tests for list affected coverage
Add additional edge case tests to improve test coverage:
- pkg/list/list_affected_test.go:
- TestBuildAffectedFilters_EdgeCases (multiple colons, spaces, special chars)
- TestBuildAffectedSorters_EdgeCases (descending, multiple columns, empty)
- TestParseAffectedColumnsFlag_EdgeCases (complex templates, unicode)
- TestSelectRemoteRef_Precedence (SHA/ref precedence)
- TestSetRefNames_Combinations (RepoPath override)
- TestAffectedCommandOptions struct validation
- cmd/list/affected_test.go:
- TestAffectedOptions_FullOptions (all fields populated)
- TestAffectedCommandSubcommand (command config)
- TestAffectedFlagDefaults (default values)
- TestAffectedFlagShorthands (shorthand configs)
- TestAffectedCommandLong (descriptions)
These tests increase overall coverage for the list affected command.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* address comments, add tests
* [autofix.ci] apply automated fixes
* fix: Add perf tracking to executeListAffectedCmd
Add performance tracking to executeListAffectedCmd function
per coding guidelines, addressing CodeRabbit review feedback.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* address comments, add tests
---------
Co-authored-by: Claude Haiku 4.5 <noreply@anthropic.com>
Co-authored-by: Andriy Knysh <aknysh@users.noreply.github.com>
Co-authored-by: aknysh <andriy.knysh@gmail.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>1 parent aafe982 commit ffa7f0a
File tree
38 files changed
+5281
-294
lines changed- cmd/list
- docs/fixes
- errors
- internal/exec
- pkg
- git
- list
- extract
- renderer
- ui
- spinner
- tests/snapshots
- website
- blog
- docs/cli/commands/list
38 files changed
+5281
-294
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
0 commit comments