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

refactor(cli): don't load config twice for commands that use a client #1350

Merged
merged 4 commits into from
Jan 9, 2024

Conversation

krancour
Copy link
Member

@krancour krancour commented Jan 3, 2024

Ever since #1179, we've been loading CLI config up front since it may contain a user's preference for a default project.

I noticed today that commands requiring a client for interacting with the Kargo API server continue to reload the configuration just-in-time.

This change passed the config that is loaded up front to the "constructors" for each of the CLI's sub-commands so configuration is now only ever loaded once per invocation of the CLI.

Signed-off-by: Kent Rancourt <kent.rancourt@gmail.com>
@krancour krancour added this to the v0.4.0 milestone Jan 3, 2024
@krancour krancour self-assigned this Jan 3, 2024
@krancour krancour requested a review from a team as a code owner January 3, 2024 05:48
Copy link

netlify bot commented Jan 3, 2024

Deploy Preview for docs-kargo-akuity-io ready!

Name Link
🔨 Latest commit 28cf834
🔍 Latest deploy log https://app.netlify.com/sites/docs-kargo-akuity-io/deploys/659d9387e6a71d00081ad56a
😎 Deploy Preview https://deploy-preview-1350.kargo.akuity.io
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

codecov bot commented Jan 3, 2024

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (237b90b) 45.40% compared to head (2a7fae5) 45.36%.

❗ Current head 2a7fae5 differs from pull request most recent head 28cf834. Consider uploading reports for the commit 28cf834 to get more accurate results

Files Patch % Lines
internal/cli/client/client.go 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1350      +/-   ##
==========================================
- Coverage   45.40%   45.36%   -0.04%     
==========================================
  Files         136      136              
  Lines       11717    11726       +9     
==========================================
  Hits         5320     5320              
- Misses       6206     6215       +9     
  Partials      191      191              

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

Signed-off-by: Kent Rancourt <kent.rancourt@gmail.com>
@krancour krancour enabled auto-merge January 9, 2024 16:32
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!

Signed-off-by: Kent Rancourt <kent.rancourt@gmail.com>
@krancour krancour added this pull request to the merge queue Jan 9, 2024
Merged via the queue into akuity:main with commit 700ab3c Jan 9, 2024
13 checks passed
@krancour krancour deleted the krancour/cli branch January 9, 2024 18:56
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