Skip to content
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

cli: add special table printer for stages #786

Merged
merged 1 commit into from
Sep 19, 2023

Conversation

krancour
Copy link
Member

@krancour krancour commented Sep 19, 2023

Before:

kargo get stages --project kargo-demo            
NAME   AGE
uat    121m
test   122m

After:

kargo get stages --project kargo-demo
NAME   CURRENT FREIGHT                            HEALTH    AGE
test   b73f9d1afaca87254b64e64e5439557e86dcba79   Healthy   123m
uat    b73f9d1afaca87254b64e64e5439557e86dcba79   Healthy   121m

We need this if we're to have a CLI-centric quickstart. See #721

Long-term, idk about using this package for printing tables. It was nothing but pain.

Signed-off-by: Kent <kent.rancourt@gmail.com>
@netlify
Copy link

netlify bot commented Sep 19, 2023

Deploy Preview for docs-kargo-akuity-io canceled.

Name Link
🔨 Latest commit 8a5b368
🔍 Latest deploy log https://app.netlify.com/sites/docs-kargo-akuity-io/deploys/6508f2e1861a180008602b6b

@codecov
Copy link

codecov bot commented Sep 19, 2023

Codecov Report

Patch and project coverage have no change.

Comparison is base (a37c51c) 46.62% compared to head (8a5b368) 46.62%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #786   +/-   ##
=======================================
  Coverage   46.62%   46.62%           
=======================================
  Files          97       97           
  Lines        6797     6797           
=======================================
  Hits         3169     3169           
  Misses       3476     3476           
  Partials      152      152           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@rbreeze rbreeze left a comment

Choose a reason for hiding this comment

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

LGTM, just a small comment

Rows: make([]metav1.TableRow, len(items)),
}
for i, item := range items {
// This func is only ever passed Stages
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this enforced somehow? If not, should we duplicate this comment at the start of the function?

Copy link
Member Author

Choose a reason for hiding this comment

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

Technically, nothing enforces it, but the function name should hopefully be a dead giveaway.

@krancour krancour merged commit 8ab482c into akuity:main Sep 19, 2023
@krancour krancour deleted the krancour/stage-table-printer branch September 19, 2023 01:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants