Skip to content

Conversation

JonoYang
Copy link
Member

@JonoYang JonoYang commented Sep 1, 2025

@pombredanne pombredanne changed the title 660 purl next maven Add support to mine maven Package-URLs #660 Sep 2, 2025
@@ -26,3 +27,28 @@ def write_data_to_file(path, data):
path.parent.mkdir(parents=True, exist_ok=True)
with open(path, encoding="utf-8", mode="w") as f:
f.write(saneyaml.dump(data))


def write_purls_to_repo(repo, package, packages, push_commit=False):
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AyanSinhaMahapatra I've moved your write_packageurls_to_file and write_purls_to_repo functions to this file and I see that we have overlapping functionality here, especially with the code in https://github.com/aboutcode-org/purldb/blob/main/minecode_pipeline/pipes/pypi.py#L135

I think we should use a common function to do these actions

Signed-off-by: Jono Yang <[email protected]>


def write_packageurls_to_file(repo, base_dir, packageurls):
purl_file_rel_path = os.path.join(base_dir, PURLS_FILENAME)
purl_file_rel_path = os.path.join(base_dir, hashid.PURLS_FILENAME)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JonoYang @AyanSinhaMahapatra I think we should avoid computing the package URL path and just use this function. ppath = hashid.get_package_purls_yml_file_path(package)

    * This is done in the collect_packages_from_maven step

Signed-off-by: Jono Yang <[email protected]>
Signed-off-by: Jono Yang <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants