Skip to content
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

Adds exclusion_source #7

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

patrick-premont
Copy link
Member

Adds exclusion_source attribute to java_export so that exclusions can be extracted automatically from a list of artifact coordinates as passed to maven_install.

…cally from a list of artifact coordinates as passed to maven_install
@patrick-premont patrick-premont requested a review from a team as a code owner April 26, 2024 21:24
Comment on lines +301 to +304
exclusion_source_json_strings = [
_json.write_artifact_spec(artifact)
for artifact in parse.parse_artifact_spec_list(exclusion_source)
]
Copy link
Member

Choose a reason for hiding this comment

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

I understand the need for the separate field on java_export, but I wonder if it would make sense to merge the two and just passing a single exclusions dict to pom_file?

At a high level:
parse and filter the exclusion_source list so it only includes dependencies with exclusions
convert the list so it is a dict in the same form as exclusions
merge the two dicts and pass to pom_file

Copy link
Member Author

@patrick-premont patrick-premont May 2, 2024

Choose a reason for hiding this comment

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

Good question. It's not straightforward:

  • pom_file's exclusion has labels for keys, not strings. I think that makes it safer to use so I'm not sure we should change that. If we tried moving the computation of the key outside of pom_file it would have to be a label, and we'd get back to needed to encode in snake case like we to do, and guess the repo (@maven).
  • if we we move to stings as keys, and move the computation of the key outside of pom_file, we wouldn't have access to the list of dependencies expanded_maven_deps that we use to filter the exclusions, so we'd likely forego the filtering and then pom_file would need to ignore irrelevant dependencies (again a bit more error prone for explicitly added exclusions).

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