Infer bug_tracking_url and code_view_url from vcs_url#4944
Infer bug_tracking_url and code_view_url from vcs_url#4944Kaushik-Kumar-CEG wants to merge 1 commit intoaboutcode-org:developfrom
Conversation
AyanSinhaMahapatra
left a comment
There was a problem hiding this comment.
Thanks @Kaushik-Kumar-CEG, see comments for your consideration.
|
|
||
| def parse_vcs_urls(vcs_url): | ||
| ''' | ||
| given a vcs_url, return (code_view_url, bug_tracking_url) when the |
There was a problem hiding this comment.
You misunderstand code view URLs, this should showthe source tree at a specific version/commit and not just the default code view.
Add this for pinned packages with exact versions only. No need to populate this for purls without versions.
There was a problem hiding this comment.
good catch, fixed! code_view_url now points to the tagged source tree (e.g. /tree/1.2.3 for GitHub) and is only populated when the package has a concrete version
| @@ -128,3 +129,45 @@ def test_normalize_vcs_url_does_not_fail_on_empty(self): | |||
| assert normalize_vcs_url(None) == None | |||
| assert normalize_vcs_url('') == None | |||
There was a problem hiding this comment.
I'm surprises there are no test expectation changes, there should be lots of test files with updated URLs, can you look for/fix test failures?
There was a problem hiding this comment.
right, fixed. Updated the expected fixtures across the test suite (SCANCODE_REGEN_TEST_FIXTURES) — they now include the inferred URLs
43257b0 to
cb98430
Compare
Signed-off-by: Kaushik <kaushikrjpm10@gmail.com>
cb98430 to
eef1893
Compare
|
@AyanSinhaMahapatra ready for review :) |
Fixes #4943
This PR adds a post-parsing step to automatically infer
bug_tracking_urlandcode_view_urlfrom a package'svcs_urlif they aren't already provided in the manifest.It handles standard HTTPS links, as well as
git@SSH strings andgit+prefixes, stripping trailing.gitsuffixes so the final URLs resolve properly in a browser.Added tests covering all 4 requested platforms (GitHub, GitLab, Codeberg, and Bitbucket) alongside the URL edge cases.
Tasks
Run tests locally to check for errors.