fix(ui): use SCM-specific commit URL paths#1037
fix(ui): use SCM-specific commit URL paths#1037julianderks wants to merge 1 commit intoargoproj-labs:mainfrom
Conversation
Signed-off-by: Julian Derks <derks_julian@hotmail.com>
Bundle ReportChanges will increase total bundle size by 150 bytes (0.36%) ⬆️. This is within the configured threshold ✅ Detailed changes
Affected Assets, Files, and Routes:view changes for bundle: argocd-ui-extension-array-pushAssets Changed:
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1037 +/- ##
==========================================
- Coverage 50.92% 50.63% -0.30%
==========================================
Files 51 51
Lines 5492 5492
==========================================
- Hits 2797 2781 -16
- Misses 2399 2411 +12
- Partials 296 300 +4 ☔ View full report in Codecov by Sentry. |
crenshaw-dev
left a comment
There was a problem hiding this comment.
@zachaller what are your thoughts on building this on the frontend vs. the backend? Frontend means we don't have direct access to the ScmProvider/GitRepository resource to toggle the provider (i.e. we have to do direct URL inspection on the frontend). But doing it on the backend means more code and more stuff stored in the CRs.
A hybrid would be to just store the ScmProvider kind in the CR and then have frontend code to construct URLs based on that.
|
I like they hybrid option but I dont want to store that in the PS, I think we need some form of aggregation API etc to get all resources related to a PromotionStrategy. |
Summary
The
getCommitUrl()function in the ArgoCD extension UI was hardcoded to use/commit/{sha}for all SCM providers. This works for GitHub, Gitea, Forgejo, and Azure DevOps, but produces broken links for:/commits/{sha}(plural)/-/commit/{sha}Fix
Added a domain-based lookup table inside
getCommitUrl()that maps SCM domains to their correct commit URL path pattern, with/commit/as the default fallback. Adding support for a new SCM is a single line addition.Images
Hyperlink
Wrong URL for Bitbucket Cloud