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

chore: simplify 'get repo' API implementation #20348

Merged
merged 2 commits into from
Oct 14, 2024

Conversation

crenshaw-dev
Copy link
Member

The repository Get endpoint currently normalizes, sanitizes, and augments the repo object with the connection status.

But that work is already done by the call to s.ListRepositories.

For normalization and sanitization, the duplication is a drift risk, but isn't otherwise a problem.

The extra connection status check shouldn't be a huge problem, because it's cached. But it'll duplicate the check when anyone clicks "refresh" in the repo list UI.

I've added unit tests to confirm that Get still gets the normalized, sanitized, and augmented repo object. I've confirmed that, if I remove those behaviors from the ListRepositories function, the tests fail (so we would catch a regression).

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
@crenshaw-dev crenshaw-dev requested a review from a team as a code owner October 11, 2024 18:56
Copy link

bunnyshell bot commented Oct 11, 2024

❌ Preview Environment deleted from Bunnyshell

Available commands (reply to this comment):

  • 🚀 /bns:deploy to deploy the environment

Copy link

codecov bot commented Oct 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Please upload report for BASE (master@d85a1de). Learn more about missing BASE report.
Report is 20 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##             master   #20348   +/-   ##
=========================================
  Coverage          ?   55.99%           
=========================================
  Files             ?      322           
  Lines             ?    44706           
  Branches          ?        0           
=========================================
  Hits              ?    25031           
  Misses            ?    17086           
  Partials          ?     2589           

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

Copy link
Member

@ishitasequeira ishitasequeira left a comment

Choose a reason for hiding this comment

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

LGTM!!

@ishitasequeira ishitasequeira merged commit 0cdbc3c into argoproj:master Oct 14, 2024
27 checks passed
austin5219 pushed a commit to austin5219/argo-cd that referenced this pull request Oct 16, 2024
* chore: simplify 'get repo' API implementation

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

* import order

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

---------

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
Signed-off-by: austin5219 <3936059+austin5219@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants