Skip to content

Commit

Permalink
chore: extended docstring of repo finder
Browse files Browse the repository at this point in the history
Signed-off-by: Ben Selwyn-Smith <[email protected]>
  • Loading branch information
benmss committed Aug 31, 2023
1 parent fa5139e commit 57d13c9
Showing 1 changed file with 30 additions and 1 deletion.
31 changes: 30 additions & 1 deletion src/macaron/repo_finder/repo_finder.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,36 @@
# Copyright (c) 2023 - 2023, 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 module contains the logic for using/calling the different repo finders."""
"""
This module contains the logic for using/calling the different repo finders.
Input
-----
The entry point of the repo finder depends on the type of PURL being analyzed.
- If passing a PURL representing an artifact, the ``find_repo`` function in this file should be called.
- If passing a PURL representing a repository, the ``to_repo_path`` function in this file should be called.
Artifact PURLs
--------------
For artifact PURLs, the PURL type determines how the repositories are searched for.
Currently, for Maven PURLs, SCM meta data is retrieved from the matching POM retrieved from Maven Central (or
other configured location).
For Python, .NET, Rust, and NodeJS type PURLs, Google's Open Source Insights API is used to find the meta data.
In either case, any repository links are extracted from the meta data, then checked for validity via
``DependencyAnalyzer::find_valid_url`` which accepts URLs that point to a Github repository or similar.
Repository PURLs
----------------
For repository PURLs, the type is checked against the configured valid domains, and accepted or rejected based
on that data.
Result
------
If all goes well, a repository URL that matches the initial artifact or repository PURL will be returned for
analysis.
"""

import logging
import os
Expand Down

0 comments on commit 57d13c9

Please sign in to comment.