Skip to content

Conversation

@ppapapetrou76
Copy link
Contributor

@ppapapetrou76 ppapapetrou76 commented Dec 3, 2025

Checklist:

  • Either (a) I've created an enhancement proposal and discussed it with the community, (b) this is a bug fix, or (c) this does not need to be in the release notes.
  • The title of the PR states what changed and the related issues number (used for the release note).
  • The title of the PR conforms to the Title of the PR
  • I've included "Closes [ISSUE #]" or "Fixes [ISSUE #]" in the description to automatically close the associated issue.
  • I've updated both the CLI and UI to expose my feature, or I plan to submit a second PR with them.
  • Does this PR require documentation updates?
  • I've updated documentation as required by this PR.
  • I have signed off all my commits as required by DCO
  • I have written unit and/or e2e tests for my change. PRs without these are unlikely to be merged.
  • My build is green (troubleshooting builds).
  • My new feature complies with the feature status guidelines.
  • I have added a brief description of why this PR is necessary and/or what this PR solves.
  • Optional. My organization is added to USERS.md.
  • Optional. For bug fixes, I've indicated what older releases this fix should be cherry-picked into (this may or may not happen depending on risk/complexity).

closes #25378

Signed-off-by: Patroklos Papapetrou <[email protected]>
@ppapapetrou76 ppapapetrou76 requested a review from a team as a code owner December 3, 2025 13:41
@bunnyshell
Copy link

bunnyshell bot commented Dec 3, 2025

🔴 Preview Environment stopped on Bunnyshell

See: Environment Details | Pipeline Logs

Available commands (reply to this comment):

  • 🔵 /bns:start to start the environment
  • 🚀 /bns:deploy to redeploy the environment
  • /bns:delete to remove the environment

Signed-off-by: Patroklos Papapetrou <[email protected]>
Copy link
Member

@blakepettersson blakepettersson left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@codecov
Copy link

codecov bot commented Dec 4, 2025

Codecov Report

❌ Patch coverage is 95.86207% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 62.57%. Comparing base (7cdc0f9) to head (9ff85eb).

Files with missing lines Patch % Lines
reposerver/repository/repository.go 76.92% 3 Missing ⚠️
util/oci/client.go 76.92% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #25493      +/-   ##
==========================================
+ Coverage   62.45%   62.57%   +0.11%     
==========================================
  Files         351      352       +1     
  Lines       49490    49622     +132     
==========================================
+ Hits        30910    31049     +139     
+ Misses      15621    15616       -5     
+ Partials     2959     2957       -2     

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

Signed-off-by: Patroklos Papapetrou <[email protected]>
@ppapapetrou76 ppapapetrou76 requested review from a team as code owners December 4, 2025 16:41

// TestRepo verifies that the remote OCI repo can be connected to.
func (c *nativeOCIClient) TestRepo(ctx context.Context) (bool, error) {
defer c.OnTestRepo(c.repoURL)
Copy link
Member

@blakepettersson blakepettersson Dec 4, 2025

Choose a reason for hiding this comment

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

QQ: Do we need to first store this and then defer the execution of the function? like

Suggested change
defer c.OnTestRepo(c.repoURL)
f := c.OnTestRepo(c.repoURL)
defer f()

OnExtract, OnResolveRevision, OnDigestMetadata, OnGetTags, OnTestRepo seem to all return functions.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

correct :) addressed

Copy link
Member

Choose a reason for hiding this comment

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

There's one remaining issue - in https://github.com/argoproj/argo-cd/pull/25493/files#diff-6234b055bc4370846988146ad1e76d381f6004c001407b881d1450f6fba2748eR55-R61 when processMetricFunc gets called startTime gets initiated.

In order to correctly calculate the span (ObserveOCIRequestDuration) between the start of the method and the very end of the method, we need to first get the initial function (e.g c.OnTestRepo(c.repoURL)). The actual execution of the returned function needs to happen at the very end of the method call with a defer

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.

Add metrics for fetching/pulling OCI repos

2 participants