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

Add java_layer rule that allows fine layering of JVM dependencies (like py_layer for Python) #2122

Merged
merged 1 commit into from
Aug 2, 2022

Conversation

ns476
Copy link
Contributor

@ns476 ns476 commented Jul 6, 2022

PR Checklist

Please check if your PR fulfills the following requirements:

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • Other... Please describe:

What is the current behavior?

There is no rule that allows fine layering of JVM dependencies (like py_layer) for java_images.

Issue Number: N/A

What is the new behavior?

JavaInfo is forwarded by filter_layer and there is a rule java_layer which functions identically to py_layer that allows filtering dependencies.

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

I wasn't sure that building the merged JavaInfo was the best way to do this, but I think any other way requires some more intrusive changes to java_image - I tried with an empty JavaInfo and forwarding the JavaInfo (as the code does with PyInfo) and they result in an empty layer and a layer with all dependencies (not filtering them at all) respectively.

@google-cla
Copy link

google-cla bot commented Jul 6, 2022

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@ns476 ns476 marked this pull request as draft July 6, 2022 18:31
@ns476 ns476 marked this pull request as ready for review July 7, 2022 10:26
Copy link
Collaborator

@gravypod gravypod left a comment

Choose a reason for hiding this comment

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

Since this mirrors existing behavior, and I cant find anything odd with the code, I think this is good.

@gravypod gravypod merged commit a8aff40 into bazelbuild:master Aug 2, 2022
St0rmingBr4in pushed a commit to St0rmingBr4in/rules_docker that referenced this pull request Oct 17, 2022
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