Skip to content

Generate @package_metadata info for jvm_import targets #1410

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 25, 2025

Conversation

Yannic
Copy link
Contributor

@Yannic Yannic commented Jul 9, 2025

No description provided.

@Yannic Yannic requested review from jin, shs96c and cheister as code owners July 9, 2025 19:25
@@ -84,6 +84,15 @@ def _get_maven_url(artifact_urls):
# Return anything
return artifact_urls[0]

def _create_purl(coordinates):
Copy link
Collaborator

Choose a reason for hiding this comment

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

The jvm_import rule exposes the provider directly. We should do the same here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think we should: users (companies) will want to override or add some attributes of package_metadata with info they need. They way this will work is that companies can define a toolchain for all the overrides/additions, keyed by the label of the package_metadata target. if we generate PackageMetadataInfo outside of package_metadata, that'll need to integrate with all the override toolchain stuff, which is probably not something I want rules to do.

See bazel-contrib/supply-chain#1 (comment) for a draft how the overrides are going to work

Copy link
Collaborator

Choose a reason for hiding this comment

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

Won't that happen at the point where people are consuming this data? In your example, the users will be the ones who want to (eg) annotate a dual-licensed project as using one specific license for their use.

@@ -84,6 +84,15 @@ def _get_maven_url(artifact_urls):
# Return anything
return artifact_urls[0]

def _create_purl(coordinates):
Copy link
Collaborator

Choose a reason for hiding this comment

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

Won't that happen at the point where people are consuming this data? In your example, the users will be the ones who want to (eg) annotate a dual-licensed project as using one specific license for their use.

@shs96c
Copy link
Collaborator

shs96c commented Jul 24, 2025

Happy to merge this once the already existing to_purl function is being used.

@Yannic
Copy link
Contributor Author

Yannic commented Jul 25, 2025

Switched to to_purl. PTAL

Copy link
Collaborator

@shs96c shs96c left a comment

Choose a reason for hiding this comment

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

LGTM. Thank you!

@shs96c shs96c merged commit 935db47 into bazel-contrib:master Jul 25, 2025
6 checks passed
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