-
-
Notifications
You must be signed in to change notification settings - Fork 117
Add pager to atmos describe affected command #1236
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: feature/dev-3162-add-pager-to-atmos-describe-component-command
Are you sure you want to change the base?
Add pager to atmos describe affected command #1236
Conversation
Important Cloud Posse Engineering Team Review RequiredThis 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 |
Warning This PR exceeds the recommended limit of 1,000 lines.Large PRs are difficult to review and may be rejected due to their size. Please verify that this PR does not address multiple issues. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## feature/dev-3162-add-pager-to-atmos-describe-component-command #1236 +/- ##
===================================================================================================
+ Coverage 32.89% 48.38% +15.48%
===================================================================================================
Files 223 229 +6
Lines 23791 24602 +811
===================================================================================================
+ Hits 7827 11904 +4077
+ Misses 14798 11111 -3687
- Partials 1166 1587 +421
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…ommand' of https://github.com/cloudposse/atmos into feature/dev-3182-add-pager-to-atmos-describe-affected-command
…#1235) * updates * updates * updates * updates * updates * updates * updates * updates * updates * updates * updates * updates * updates * updates * updates * updates * updates * [autofix.ci] apply automated fixes * updates * updates * updates * updates * updates * updates * updates * updates * Apply suggestions from code review Co-authored-by: Erik Osterman (CEO @ Cloud Posse) <erik@cloudposse.com> * updates * updates * updates * Apply suggestions from code review Co-authored-by: Erik Osterman (CEO @ Cloud Posse) <erik@cloudposse.com> * updates * [autofix.ci] apply automated fixes * updates --------- Co-authored-by: autofix-ci[bot] <11482 8000 7586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: Erik Osterman (CEO @ Cloud Posse) <erik@cloudposse.com>
💥 This pull request now has conflicts. Could you fix it @samtholiya? 🙏 |
…pager-to-atmos-describe-affected-command
* docs generate * readme buildout using Gomplate 3.x with teml.Exec issue fixed * readme generationggomplate 3.11.8 work,s no terrafor yet * fix for windwos gomplate * gomodtidy * dependant acceptnace tests fix + draft test cases * Update internal/exec/docs_generate.go Co-authored-by: Erik Osterman (CEO @ Cloud Posse) <erik@cloudposse.com> * use go-getter to download files * atmos.yaml * Update cmd/docs_generate.go Co-authored-by: Erik Osterman (CEO @ Cloud Posse) <erik@cloudposse.com> * examples back * terrafrom test/mergo * moving fixtures to tests and reverting back the comments in template utils * test cases * initial version of documentation * mdx fixes * mdx layout fix * typo fix * defer removeTempDir move * Update tests/test-cases/docs-generate.yaml Co-authored-by: Erik Osterman (CEO @ Cloud Posse) <erik@cloudposse.com> * Update tests/test-cases/docs-generate.yaml Co-authored-by: Erik Osterman (CEO @ Cloud Posse) <erik@cloudposse.com> * Update tests/test-cases/docs-generate.yaml Co-authored-by: Erik Osterman (CEO @ Cloud Posse) <erik@cloudposse.com> * Update tests/test-cases/docs-generate.yaml Co-authored-by: Erik Osterman (CEO @ Cloud Posse) <erik@cloudposse.com> * Update tests/test-cases/docs-generate.yaml Co-authored-by: Erik Osterman (CEO @ Cloud Posse) <erik@cloudposse.com> * Update tests/test-cases/docs-generate.yaml Co-authored-by: Erik Osterman (CEO @ Cloud Posse) <erik@cloudposse.com> * Update tests/test-cases/docs-generate.yaml Co-authored-by: Erik Osterman (CEO @ Cloud Posse) <erik@cloudposse.com> * comments from pr * deleted README.md.gotmpl from the root * terraform test template * local atmos.yaml * Update pkg/schema/schema.go Co-authored-by: Erik Osterman (CEO @ Cloud Posse) <erik@cloudposse.com> * Update cmd/docs_generate.go Co-authored-by: Erik Osterman (CEO @ Cloud Posse) <erik@cloudposse.com> * Update internal/exec/template_utils.go Co-authored-by: Erik Osterman (CEO @ Cloud Posse) <erik@cloudposse.com> * Update internal/exec/file_utils.go Co-authored-by: Erik Osterman (CEO @ Cloud Posse) <erik@cloudposse.com> * Update internal/exec/template_utils.go Co-authored-by: Erik Osterman (CEO @ Cloud Posse) <erik@cloudposse.com> * Update internal/exec/file_utils.go Co-authored-by: Erik Osterman (CEO @ Cloud Posse) <erik@cloudposse.com> * changing func signatures * test cases * Tidy go.mod and go.sum * comments * Resolve merge conflicts in go.mod and go.sum * [autofix.ci] apply automated fixes * fix logging * intermediate results * [autofix.ci] apply automated fixes * Resolve merge conflicts in go.mod and go.sum * terrafrom docs and tests * docs generate test fix * initial linter feedback fix * Resolve merge conflicts in go.mod and go.sum * Resolve merge conflicts in go.mod and go.sum * default config * fixing test and linter * more linter * more test * tests coverage * [autofix.ci] apply automated fixes * more tests * more tests * docs update * unit test fix for win * [autofix.ci] apply automated fixes * Update internal/exec/template_utils_test.go Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * test update * Resolve merge conflicts in go.mod and go.sum * gogetter move to utils * Update internal/exec/docs_generate.go Co-authored-by: Erik Osterman (CEO @ Cloud Posse) <erik@cloudposse.com> * Update pkg/config/default.go Co-authored-by: Erik Osterman (CEO @ Cloud Posse) <erik@cloudposse.com> * Update pkg/config/load.go Co-authored-by: Erik Osterman (CEO @ Cloud Posse) <erik@cloudposse.com> * Update tests/fixtures/scenarios/docs-generate/atmos.yaml Co-authored-by: Erik Osterman (CEO @ Cloud Posse) <erik@cloudposse.com> * Update tests/fixtures/scenarios/docs-generate/readme/atmos.yaml Co-authored-by: Erik Osterman (CEO @ Cloud Posse) <erik@cloudposse.com> * Update tests/fixtures/scenarios/docs-generate/atmos.yaml Co-authored-by: Erik Osterman (CEO @ Cloud Posse) <erik@cloudposse.com> * adresses comments * linter * linter * snapshots and tests * Update internal/exec/template_utils.go Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * setting constants locally * tests * docs update with more detailed path info like it is done in !include * docs formatting updates * Update internal/exec/docs_generate.go Co-authored-by: Erik Osterman (CEO @ Cloud Posse) <erik@cloudposse.com> * Update internal/exec/docs_generate.go Co-authored-by: Erik Osterman (CEO @ Cloud Posse) <erik@cloudposse.com> * Update website/docs/cli/commands/docs/docs-generate.mdx Co-authored-by: Dan Miller <miller0daniel@gmail.com> * docs generate feedback implementation * linter * linter * docs update * err rename * docs update * moving docs section to top-level atmos config * tests update * add inline maps and tests for docs generation config * update docs --------- Co-authored-by: Erik Osterman (CEO @ Cloud Posse) <erik@cloudposse.com> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: Dan Miller <miller0daniel@gmail.com>
…ommand' of https://github.com/cloudposse/atmos into feature/dev-3182-add-pager-to-atmos-describe-affected-command
📝 Walkthrough## Walkthrough
This change introduces a terminal pager to several `describe` commands in the CLI, notably `describe affected`, `describe component`, and `describe config`. It adds a pager flag, updates configuration and environment variable support for paging, refactors command execution for modularity, and implements a Bubble Tea-based pager with syntax highlighting. Tests and documentation are updated accordingly.
## Changes
| File(s) / Path(s) | Change Summary |
|---------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `cmd/describe.go`, `cmd/describe_component.go`, `cmd/describe_config.go` | Added/updated `--pager` flag and refactored command execution to support paging and explicit flag parsing. |
| `cmd/describe_affected.go` | Refactored CLI argument parsing, added pager flag, and improved validation. |
| `internal/exec/describe_affected.go`, `internal/exec/describe_component.go`, `internal/exec/describe_config.go` | Refactored execution logic into new structs with pager integration, modularized output handling, added syntax highlighting, and improved TTY detection. |
| `internal/exec/file_utils.go`, `pkg/utils/highlight_utils.go`, `pkg/utils/json_utils.go`, `pkg/utils/yaml_utils.go` | Updated function signatures to accept config pointers and support syntax highlighting for paged output. |
| `pkg/pager/pager.go`, `pkg/pager/model.go`, `pkg/pager/mock_pager.go`, `pkg/pager/model_test.go` | Introduced Bubble Tea-based pager implementation, interface, and tests. |
| `pkg/schema/schema.go`, `pkg/schema/schema_test.go` | Changed pager config type to string, added `IsPagerEnabled()` method, and tested pager enablement logic. |
| `pkg/config/default.go`, `pkg/config/load.go` | Updated default pager config to string, added environment variable binding for pager. |
| `website/docs/cli/commands/describe/describe-component.mdx` | Documented new `--pager` flag and usage example.
6D47
|
| `go.mod` | Updated dependencies to support new pager and highlighting features. |
| `tests/cli_describe_component_test.go`, `tests/describe_test.go`, `internal/exec/describe_component_test.go`, `internal/exec/describe_config_test.go` | Added/updated tests for pager functionality, flag support, and output validation. |
| `tests/snapshots/…`, `tests/test-cases/demo-stacks.yaml` | Updated test snapshots and cases to reflect pager config changes and output. |
| Other files (`internal/exec/atlantis_generate_repo_config.go`, `internal/exec/describe_dependents.go`, etc.) | Updated print/output functions to accept config pointers for highlighting and paging. |
## Sequence Diagram(s)
```mermaid
sequenceDiagram
participant User
participant CLI
participant Config
participant Pager
participant Output
User->>CLI: Run describe affected/component/config
CLI->>Config: Load configuration
CLI->>CLI: Parse flags (including --pager)
CLI->>CLI: Execute describe logic (gather data)
CLI->>Output: Format output (YAML/JSON)
alt Pager enabled and TTY supports
CLI->>Pager: Display output with syntax highlighting
Pager->>User: Interactive paged view
else
CLI->>Output: Print or write output directly
Output->>User: Output to stdout or file
end Assessment against linked issues
Suggested reviewers
|
…ommand' of https://github.com/cloudposse/atmos into feature/dev-3182-add-pager-to-atmos-describe-affected-command
@coderabbitai please re-review |
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed:
Length of output: 27166 🏁 Script executed:
Length of output: 11572 🏁 Script executed:
Length of output: 2856 🏁 Script executed:
Length of output: 3784 @samtholiya I've re-reviewed your PR, and it looks good! The implementation of the pager feature for the Key points from my review:
Overall, this is a nice quality-of-life improvement for users when working with large outputs from the |
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed:
Length of output: 67176 @samtholiya I've completed a re-review of your PR! The PR is now in a mergeable state and I can see several commits addressing previous feedback. Looking at your recent commits, you've:
The PR looks good overall - you've successfully implemented a terminal pager for the "describe affected" command and related commands, which will significantly improve the user experience when viewing large outputs. The implementation uses Bubble Tea framework appropriately for an interactive terminal experience, and you've provided good test coverage for the new functionality. Some notable strengths:
The PR is now mergeable, and the implementation meets the requirements of adding pager functionality to improve usability for viewing command output content. ( •ᴗ•)⚲ |
70871f0
to
215f607
Compare
what
why
references
Summary by CodeRabbit
--pager
flag to CLI commands to enable or disable paged output.--pager
flag usage and examples.