macaron icon indicating copy to clipboard operation
macaron copied to clipboard

feat: add command to run repo and commit finder without analysis

Open benmss opened this issue 1 year ago • 2 comments

This pull request adds a new command find-source that requires a PURL, and optionally accepts a repository path as input. If no repository path is provided, the command will call the Repo Finder and Commit Finder to find the repository and commit of the provided PURL. If a repository is provided as input, only the Commit Finder will be called.

Closes https://github.com/oracle/macaron/issues/781

benmss avatar Aug 15 '24 02:08 benmss

I tried to run the find-source command against a Maven PURL that doesn't have a version:

$ macaron find-source -purl pkg:maven/org.apache.maven/maven
2024-08-16 11:16:55,421 [INFO] Setting the output directory to .../output
2024-08-16 11:16:55,422 [INFO] The logs will be stored in debug.log
2024-08-16 11:16:55,424 [ERROR] Could not find repo for PURL: pkg:maven/apache/maven

I believe we don't support Maven PURL without a version now - https://github.com/oracle/macaron/blob/44dbf0acbd3dcb9f577db97b5c6876cfb8c87957/src/macaron/repo_finder/repo_finder_java.py#L53-L56

However, the debug message doesn't show up if I ran it without the verbose flag. I believe we should let the user of the find-source command know about this behavior by default.

tromai avatar Aug 16 '24 01:08 tromai

I also think it's great to add an integration test case for the new command too (may be we can revisit this after we settle on how to return the results to the user).

tromai avatar Aug 16 '24 03:08 tromai