Skip to content

Conversation

samtholiya
Copy link
Collaborator

@samtholiya samtholiya commented May 15, 2025

what

  • Updated describe affected with pager

image

why

  • Makes easier for users to view the content

references

Summary by CodeRabbit

  • Refactor

    • Improved modularity and maintainability of the "describe affected" command, including more robust CLI argument parsing and error handling for conflicting flags.
    • Separated argument parsing from execution logic, enhancing testability and code clarity.
    • Refactored syntax highlighting utilities for clearer lexer and formatter selection with terminal presence caching.
  • Bug Fixes

    • Corrected a YAML configuration to reference the intended Terraform output variable.
    • Updated test snapshots and test cases for accurate YAML formatting and pager settings.
  • Tests

    • Added and updated unit tests for CLI argument parsing, command execution, and syntax highlighting, including new mock implementations for better test coverage.
  • Style

    • Improved code readability and structure in syntax highlighting utilities.

samtholiya and others added 30 commits April 14, 2025 23:21
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
autofix-ci bot and others added 2 commits May 29, 2025 20:12
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
coderabbitai[bot]
coderabbitai bot previously approved these changes May 29, 2025
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f33f89c and 6e7aff0.

📒 Files selected for processing (1)
  • cmd/describe_affected_test.go (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
cmd/describe_affected_test.go (4)
Learnt from: samtholiya
PR: cloudposse/atmos#1255
File: cmd/describe_affected_test.go:15-15
Timestamp: 2025-05-23T19:51:47.091Z
Learning: In the atmos codebase, t.Chdir() is a valid method call on *testing.T objects and works correctly for changing directories in tests. This is implemented through custom testing framework extensions and is used consistently throughout the test suite.
Learnt from: samtholiya
PR: cloudposse/atmos#1255
File: cmd/describe_affected_test.go:15-15
Timestamp: 2025-05-23T19:51:47.091Z
Learning: In the atmos codebase, t.Chdir() is a valid method that can be called on *testing.T objects. This functionality is implemented through custom testing framework extensions and is used consistently throughout the test suite for changing working directories during tests.
Learnt from: samtholiya
PR: cloudposse/atmos#1255
File: cmd/describe_affected_test.go:15-15
Timestamp: 2025-05-23T19:51:47.091Z
Learning: The atmos codebase has a custom extension to *testing.T that provides a Chdir method, allowing test functions to call t.Chdir() to change working directories during tests. This is used consistently across test files in the codebase.
Learnt from: samtholiya
PR: cloudposse/atmos#1255
File: cmd/describe_affected_test.go:15-15
Timestamp: 2025-05-23T19:51:47.091Z
Learning: In the atmos codebase, t.Chdir() is a valid method call on *testing.T objects and works correctly for changing directories in tests.
🪛 golangci-lint (1.64.8)
cmd/describe_affected_test.go

[warning] 111-111: if tt.expectedPanic has complex nested blocks (complexity: 4)

(nestif)

⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: Build (windows-latest, windows)
  • GitHub Check: Summary
🔇 Additional comments (3)
cmd/describe_affected_test.go (3)

14-24: Solid integration test setup.

The test properly mocks the execution interface and verifies the command flow. Good use of dependency injection through the factory function.


26-80: Well-structured table-driven tests with good coverage.

The test cases cover the main scenarios including flag combinations, upload behavior, and default values. The test structure is clean and maintainable.


122-131: Clean test execution and assertions.

Good pattern of setting up the args struct and using testify assertions for clear test output.

coderabbitai[bot]
coderabbitai bot previously approved these changes May 29, 2025
Benbentwo
Benbentwo previously approved these changes May 30, 2025
@samtholiya samtholiya dismissed stale reviews from Benbentwo and coderabbitai[bot] via d1244ca May 31, 2025 10:58
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants