argo-cd icon indicating copy to clipboard operation
argo-cd copied to clipboard

chore(repo-server): unify semver resolution in new versions subpackage

Open PaulSonOfLars opened this issue 1 year ago • 3 comments

Unify semver resolution across helm/OCI/git into a single package, to ensure we don't end up with mismatched logic for different services

Follow up to #20096, as requested here. cc @blakepettersson

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 Toolchain Guide
  • [ ] 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).

PaulSonOfLars avatar Oct 03 '24 17:10 PaulSonOfLars

:exclamation: Preview Environment undeploy from Bunnyshell failed

See: Environment Details | Pipeline Logs

Available commands (reply to this comment):

  • :rocket: /bns:deploy to redeploy the environment
  • :x: /bns:delete to try again to remove the environment

bunnyshell[bot] avatar Oct 03 '24 17:10 bunnyshell[bot]

:x: Preview Environment deleted from Bunnyshell

Available commands (reply to this comment):

  • :rocket: /bns:deploy to deploy the environment

bunnyshell[bot] avatar Oct 03 '24 17:10 bunnyshell[bot]

I think you also need to run make mockgen

blakepettersson avatar Oct 04 '24 17:10 blakepettersson

@blakepettersson thanks for the review! I've reverted things back to entries and added in a private struct for the tags methods. Also fixed some tests which were failing due to new error messages. Let me know if you'd like me to poke at anything else!

PaulSonOfLars avatar Oct 18 '24 19:10 PaulSonOfLars

Codecov Report

:x: Patch coverage is 83.33333% with 14 lines in your changes missing coverage. Please review. :white_check_mark: Project coverage is 59.95%. Comparing base (92589de) to head (dbc5c35). :warning: Report is 480 commits behind head on master.

Files with missing lines Patch % Lines
util/helm/index.go 0.00% 6 Missing :warning:
reposerver/repository/repository.go 80.95% 3 Missing and 1 partial :warning:
util/versions/tags.go 92.10% 2 Missing and 1 partial :warning:
util/helm/client.go 88.88% 1 Missing :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #20216      +/-   ##
==========================================
+ Coverage   59.91%   59.95%   +0.03%     
==========================================
  Files         344      344              
  Lines       57715    57721       +6     
==========================================
+ Hits        34582    34605      +23     
+ Misses      20375    20344      -31     
- Partials     2758     2772      +14     

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

codecov[bot] avatar Oct 18 '24 20:10 codecov[bot]

Hey!

Is there any update on this? We have a pending bug that we would like fixed, but we are waiting on this PR :smile:

https://github.com/argoproj/argo-cd/pull/20862

Spazzy757 avatar Dec 09 '24 14:12 Spazzy757

Hey, how it is going? I really appreciate your work because i really need this feature. Hope you don't forgot about it.

gh0st3e avatar Dec 23 '24 16:12 gh0st3e

we need these feature as well

jose-arcatar avatar Jan 30 '25 20:01 jose-arcatar

Have merged in latest master to simplify merging, as well as updated the PR to fix the issues raised in #21818.

I believe this fix belongs here rather than in a separate PR, as while this error was raised against a Helm chart, it will also happen in git repos, making this a great time to unify the two and avoid the duplicate code.

PaulSonOfLars avatar Feb 13 '25 07:02 PaulSonOfLars

Hello guys. Could you please share the possible time when this PR can be merged?

We depend on the fix (which is in this PR) for this issue - https://github.com/argoproj/argo-cd/issues/21818 At the moment we are blocked. We cannot upgrade ArgoCD to 2.14 because of the issue, at the same time we cannot upgrade k8s to 1.31 because ArgoCD 2.13 is not supported in k8s 1.31. https://argo-cd.readthedocs.io/en/stable/operator-manual/installation/#tested-versions

Appreciate for your help. Thanks

jackalbsd avatar Feb 14 '25 13:02 jackalbsd

Also blocked on this feature. Is there an ETA?

Pacobart avatar Feb 27 '25 22:02 Pacobart

Not sure what the context of the http: server gave HTTP response to HTTPS client error might be; I'm guessing it's because I've removed the short-circuit in the helm version selection, in favour of checking the available tags, rather than blindly returning a version we don't know exists. Let me know if theres something to be done to fix the test, or if you'd like me to undo add back that shortcircuit.

PaulSonOfLars avatar Mar 07 '25 17:03 PaulSonOfLars

Feel like this PR should be merged?

josecsotomorales avatar Mar 21 '25 16:03 josecsotomorales

@PaulSonOfLars I would say let's re-add the short circuit for now and we can look into removing it at some other time.

blakepettersson avatar Mar 22 '25 12:03 blakepettersson

@PaulSonOfLars I would say let's re-add the short circuit for now and we can look into removing it at some other time.

@blakepettersson Sure. I've left a note explaining context for future users. MIght be of interest to before v3 comes out.

Not sure what the test failure is about now, looks like some codegen for a piece I haven't touched?

PaulSonOfLars avatar Mar 22 '25 14:03 PaulSonOfLars

Anyone know the status of this PR? Or are we waiting for 3.0?

ghost avatar Apr 09 '25 22:04 ghost

@crenshaw-dev @blakepettersson friendly nudge on the above.

This will help unify semver resolution across all providers (both git and helm), creating a more consistent and predictable approach, as well as resolve the issue #21818. In case the concern is breaking changes, I would hope that the push to v3 would be a good excuse to get this merged in and tested. What do you think?

PaulSonOfLars avatar Apr 19 '25 09:04 PaulSonOfLars

@PaulSonOfLars I'm all for it, I just don't have enough powers to merge it. Will ping some others to see if they can.

blakepettersson avatar Apr 21 '25 07:04 blakepettersson

Hi,

we've updated to 2.14 and have now hit this issue :-( We now have multiple kubernetes clusters with some apps not being installed with errors like " invalid revision '33.03.138'".... which is a REALLY big issue.

Please merge this and do a new release ASAP.

flaviomoringa avatar Apr 24 '25 13:04 flaviomoringa

@crenshaw-dev could you please help in merging this? We're are really stuck with errors like: Failed to load target state: failed to generate manifest for source 1 of 1: rpc error: code = Unknown desc = invalid revision '33.03.138': constraint Parser Error

Thanks

flaviomoringa avatar Apr 24 '25 13:04 flaviomoringa

I have also just come across this issue, and i can't deploy an important helm chart into argo because of it.

Failed to load target state: failed to generate manifest for source 2 of 2: rpc error: code = 
Unknown desc = invalid revision '4.0-*': improper constraint: 4.0.002

IanMoroney avatar May 02 '25 09:05 IanMoroney

Still waiting on this 🥲

ghost avatar May 02 '25 14:05 ghost

@PaulSonOfLars there's a failing unit test, otherwise we're good to go

blakepettersson avatar May 08 '25 06:05 blakepettersson

Thank you @agaudreault! <3 Got it @blakepettersson - fixed the test, should be good to go now.

Here's to hoping you can reenable the automerge! Edit: Aha, didn't refresh. Can see that you could :)

PaulSonOfLars avatar May 08 '25 06:05 PaulSonOfLars

@PaulSonOfLars now it's done, thanks a lot!

blakepettersson avatar May 08 '25 07:05 blakepettersson

Is this now available for v3? or until a next release?

jose-arcatar avatar May 08 '25 15:05 jose-arcatar

This was just merged so it's not in v3.0.0

rouke-broersma avatar May 08 '25 15:05 rouke-broersma

@blakepettersson Would it be possible to have this backported to 3.0? We currently cannot upgrade because we can't determine the impact to our customers, we would have to check that all their charts are compliant with the strict semantic versioning from before the fixes in this PR.

rouke-broersma avatar May 20 '25 09:05 rouke-broersma

@rouke-broersma this is a chore, not a fix. Is this fixing a problem in 3.0?

agaudreault avatar May 23 '25 18:05 agaudreault

@agaudreault yes this fixes #21818

rouke-broersma avatar May 23 '25 18:05 rouke-broersma