generated from oracle/template-repo
-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add command to run repo and commit finder without analysis (#827)
This PR adds a new command, find-source, that runs the commit finder and repo finder on a given PURL whilst skipping analysis. It also optionally accepts a repo path, in which case only the commit finder will be called. The results of the operation show up in the logs, and are written to a file in a JSON report format. Signed-off-by: Ben Selwyn-Smith <[email protected]>
- Loading branch information
Showing
17 changed files
with
745 additions
and
262 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,26 @@ | ||
# Copyright (c) 2023 - 2023, Oracle and/or its affiliates. All rights reserved. | ||
# Copyright (c) 2023 - 2024, Oracle and/or its affiliates. All rights reserved. | ||
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/. | ||
|
||
"""This package contains the dependency resolvers for Java projects.""" | ||
|
||
|
||
def to_domain_from_known_purl_types(purl_type: str) -> str | None: | ||
"""Return the git service domain from a known web-based purl type. | ||
This method is used to handle cases where the purl type value is not the git domain but a pre-defined | ||
repo-based type in https://github.com/package-url/purl-spec/blob/master/PURL-TYPES.rst. | ||
Note that this method will be updated when there are new pre-defined types as per the PURL specification. | ||
Parameters | ||
---------- | ||
purl_type : str | ||
The type field of the PURL. | ||
Returns | ||
------- | ||
str | None | ||
The git service domain corresponding to the purl type or None if the purl type is unknown. | ||
""" | ||
known_types = {"github": "github.com", "bitbucket": "bitbucket.org"} | ||
return known_types.get(purl_type, None) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.