atmos icon indicating copy to clipboard operation
atmos copied to clipboard

Add pager to atmos describe dependents command

Open samtholiya opened this issue 8 months ago โ€ข 2 comments

what

  • pager for describe dependents image

why

  • helps devops view the dependents better in case of huge dependents list / content

references

Summary by CodeRabbit

  • New Features

    • Added support for filtering "describe dependents" command output using a new --query flag.
    • Output format validation now enforces "json" or "yaml" formats, with "json" as the default.
  • Bug Fixes

    • Improved error handling and argument validation for the "describe dependents" command.
  • Refactor

    • Restructured the "describe dependents" command for greater modularity and testability.
  • Tests

    • Introduced comprehensive unit tests for the "describe dependents" command and its execution logic.

samtholiya avatar Jun 11 '25 20:06 samtholiya

Codecov Report

Attention: Patch coverage is 81.25000% with 15 lines in your changes missing coverage. Please review.

Project coverage is 51.87%. Comparing base (a702f6e) to head (14689a0). Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
cmd/describe_dependents.go 62.50% 10 Missing and 5 partials :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1295      +/-   ##
==========================================
+ Coverage   51.56%   51.87%   +0.30%     
==========================================
  Files         244      245       +1     
  Lines       26423    26453      +30     
==========================================
+ Hits        13625    13722      +97     
+ Misses      11125    11050      -75     
- Partials     1673     1681       +8     
Flag Coverage ฮ”
unittests 51.87% <81.25%> (+0.30%) :arrow_up:

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

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

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

codecov[bot] avatar Jun 11 '25 21:06 codecov[bot]

๐Ÿ“ Walkthrough

"""

Walkthrough

The "describe dependents" command was refactored for modularity and testability. Execution logic is now handled by an interface-driven executor, with dependencies injected for easier testing. A new query flag was added for JMESPath filtering. Paging support and improved flag validation were implemented. Comprehensive unit tests and mocks were introduced.

Changes

File(s) Change Summary
cmd/describe_dependents.go Refactored command to use dependency injection; added query flag; improved argument/flag handling.
cmd/describe_dependents_test.go Added unit tests for command execution and flag parsing.
internal/exec/describe_dependents.go Refactored execution logic into interface; added paging, query support, and modular output handling.
internal/exec/describe_dependents_test.go Added unit tests for executor covering queries, errors, formats, and paging.
internal/exec/mock_describe_dependents.go Added GoMock-generated mock for executor interface.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant CLI
    participant Cmd as describeDependentsCmd
    participant Executor as DescribeDependentsExec
    participant Pager
    participant Output

    User->>CLI: Run "describe dependents COMPONENT [flags]"
    CLI->>Cmd: Parse args, validate config, set flags
    Cmd->>Executor: Execute(props)
    Executor->>Executor: Fetch dependents
    Executor->>Executor: (Optional) Apply query filter
    Executor->>Pager: If output large, use pager
    Pager->>Output: Display results
    Executor->>Cmd: Return status
    Cmd->>CLI: Exit

Assessment against linked issues

Objective Addressed Explanation
Add pager to atmos describe dependents Command (DEV-3431) โœ…

Suggested reviewers

  • osterman
  • aknysh """

๐Ÿ“œ Recent review details

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

๐Ÿ“ฅ Commits

Reviewing files that changed from the base of the PR and between fb4ec5fcfa590c05e72ffa6ae26a1f9bb5a7c359 and 14689a0964025dea2e03540d08f89340c85478c4.

๐Ÿ“’ Files selected for processing (1)
  • cmd/describe_dependents.go (2 hunks)
๐Ÿšง Files skipped from review as they are similar to previous changes (1)
  • cmd/describe_dependents.go
โฐ Context from checks skipped due to timeout of 90000ms (6)
  • GitHub Check: Build (windows-latest, windows)
  • GitHub Check: Build (macos-latest, macos)
  • GitHub Check: Build (ubuntu-latest, linux)
  • GitHub Check: Lint (golangci)
  • GitHub Check: Analyze (go)
  • GitHub Check: Summary
โœจ Finishing Touches
  • [ ] ๐Ÿ“ Generate Docstrings
๐Ÿงช Generate Unit Tests
  • [ ] Create PR with Unit Tests
  • [ ] Post Copyable Unit Tests in Comment
  • [ ] Commit Unit Tests in branch feature/dev-3431-add-pager-to-atmos-describe-dependents-command

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
๐Ÿชง Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai auto-generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary or @auto-summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai or @auto-title anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

coderabbitai[bot] avatar Jun 18 '25 21:06 coderabbitai[bot]

These changes were released in v1.182.0.

github-actions[bot] avatar Jul 01 '25 03:07 github-actions[bot]