scancode.io icon indicating copy to clipboard operation
scancode.io copied to clipboard

When we display package manifest and lock files, hyperlink to the upstream package repo web page

Open pombredanne opened this issue 3 years ago • 16 comments

When we display a package manifest or lockfile in the resource details, we should have a way to add a hyperlink to the upstream repository web page for this repo: for instance when we browse a requirements.txt lockfile, if it contains: scancode-toolkit==30.0.1 we should recognize this and link to https://pypi.org/project/scancode-toolkit/30.1.0/

We can parse manifests alright and we can create URLs based on the ScanCode TK packagedcode classes.

pombredanne avatar Feb 24 '22 21:02 pombredanne

@pombredanne can I work on this

soma2000-lang avatar Mar 02 '22 22:03 soma2000-lang

@soma2000-lang sure thing. If you do, I think starting with requirements.txt files would be great. Another easy one would be go.mod and go.sum

pombredanne avatar Mar 03 '22 06:03 pombredanne

Ok

soma2000-lang avatar Mar 03 '22 10:03 soma2000-lang

@pombredanne is this issue unresolved?. I would love to work on it in case it is before mentioned.

the-illuminatus avatar Apr 10 '22 16:04 the-illuminatus

@the-illuminatus I have not heard back from Soma and there has been no pending PRs... so go for it! Note that you can likely reuse the URL templates and functions to get the proper URL that exist in scancode-toolkit packagedcode code. See https://github.com/nexB/scancode-toolkit/blob/fff140efd68dd0098f09ad1bc675569f1f1ad6ae/src/packagedcode/pypi.py#L1163

pombredanne avatar Apr 10 '22 16:04 pombredanne

Sure, thanks!

On Sun, 10 Apr 2022, 10:19 pm Philippe Ombredanne, @.***> wrote:

@the-illuminatus https://github.com/the-illuminatus I have not heard back from Soma and there has been no pending PRs... so go for it! Note that you can likely reuse the URL templates and functions to get the proper URL that exist in scancode-toolkit packagedcode code. See https://github.com/nexB/scancode-toolkit/blob/fff140efd68dd0098f09ad1bc675569f1f1ad6ae/src/packagedcode/pypi.py#L1163

— Reply to this email directly, view it on GitHub https://github.com/nexB/scancode.io/issues/403#issuecomment-1094315792, or unsubscribe https://github.com/notifications/unsubscribe-auth/ASKNS5G4GWQZJ3NACQTFQVLVEMBCNANCNFSM5PIPHJTQ . You are receiving this because you were mentioned.Message ID: @.***>

the-illuminatus avatar Apr 10 '22 17:04 the-illuminatus

A good example of a similar UI would be the hyperlinking in this https://gitlab.com/gitlab-org/security-products/analyzers/gemnasium/-/blob/master/Gemfile ... or https://gitlab.com/gitlab-org/security-products/analyzers/gemnasium-python/-/blob/v2/requirements.txt In the SCIO UI, when we look a Codebase Resource content and that's a manifest file, we should get the URLs collected from SCTK or just use a few heuristics to hyperlink to the public package repo

pombredanne avatar Jul 25 '22 16:07 pombredanne

Sure will look into it.

On Mon, 25 Jul 2022, 9:58 pm Philippe Ombredanne, @.***> wrote:

A good example of a similar UI would be the hyperlinking in this https://gitlab.com/gitlab-org/security-products/analyzers/gemnasium/-/blob/master/Gemfile ... or https://gitlab.com/gitlab-org/security-products/analyzers/gemnasium-python/-/blob/v2/requirements.txt In the SCIO UI, when we look a Codebase Resource content and that's a manifest file, we should get the URLs collected from SCTK or just use a few heuristics to hyperlink to the public package repo

— Reply to this email directly, view it on GitHub https://github.com/nexB/scancode.io/issues/403#issuecomment-1194318783, or unsubscribe https://github.com/notifications/unsubscribe-auth/ASKNS5D5UQCBDFDLSBRHAV3VV26CFANCNFSM5PIPHJTQ . You are receiving this because you were mentioned.Message ID: @.***>

the-illuminatus avatar Jul 25 '22 16:07 the-illuminatus

@the-illuminatus Thanks! note also that @lf32 was interested in fixing it.

pombredanne avatar Jul 28 '22 18:07 pombredanne

@pombredanne is this issue still open?

35C4n0r avatar Aug 28 '22 13:08 35C4n0r

Yes, It's open

lf32 avatar Aug 28 '22 14:08 lf32

@lf32 @pombredanne is this issue still open? I would like to look into in.

melencholicmice avatar Jan 19 '23 15:01 melencholicmice

Yes @melencholicmice, this is still in open.

lf32 avatar Jan 27 '23 10:01 lf32

@pombredanne @lf32 Hello sir i had few doubts in this issue , i will be really thankful if you can help me in them

  • should i create a hyperlink to webpage in extracted_requirement section or should i make some new column in the table ?
  • I'm making a class for getting urls with different methods like get_pypi_url , get_npm_url etc , so in which section should this class go to maintain the code consistency of this project

melencholicmice avatar Jan 31 '23 04:01 melencholicmice

should i create a hyperlink to webpage in extracted_requirement section or should i make some new column in the table ?

We have to make the hyperlink in resource view in scancode.io.

Let's assume we scan using this download URL: https://github.com/nexB/python-inspector/releases/download/v0.9.4/python-inspector-0.9.4.tar.gz and use the scan_codebase/scan_package pipeline. We will have a requirements.txt like this:

py-inspector-requirements

Here each requirement will be a hyperlink, i.e. attrs will link to the latest version of attrs -> https://pypi.org/project/attrs/ If this had a version constraint: like pip install attrs==22.2.0 we would then link to https://pypi.org/project/attrs/22.2.0/ instead.

I'm making a class for getting urls with different methods like get_pypi_url , get_npm_url etc , so in which section should this class go to maintain the code consistency of this project

The code could go in https://github.com/nexB/scancode.io/blob/main/scanpipe/pipes/resolve.py, but this can be discussed more in the PR review stage, first step would be to get something working first, maybe with a few supported type of manifests, then we can think more about generalizing and supporting more lockfiles/manifests.

AyanSinhaMahapatra avatar Feb 01 '23 15:02 AyanSinhaMahapatra

Greetings @pombredanne and @AyanSinhaMahapatra,

I have executed ScanCode.io locally and comprehended the issue along with the anticipated outcome, and I'd love to fix this. As this is my first endeavor in resolving an issue for a public project, I kindly request guidance on how to commence the process and identification of the particular file requiring code adjustments.

Thank you!

gopalM-3 avatar Mar 14 '24 10:03 gopalM-3