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

Deprecate jib.extraDirectory in Gradle #1671

Merged
merged 12 commits into from
May 3, 2019

Conversation

chanseokoh
Copy link
Member

@chanseokoh chanseokoh commented Apr 25, 2019

The last PR for #1020.

Good for review, but I haven't done a lot of manual testing, so I'll give a second pass myself too.

@chanseokoh
Copy link
Member Author

Did a lot of manual testing and fixed a few things. Really ready for review.

// non-plural to retain backward-compatibility for the "jib.extraDirectory.path" config parameter
public void setPath(Object paths) {
public void setPaths(Object paths) {
jibExtension.extraDirectoriesConfigured = true;
Copy link
Member

Choose a reason for hiding this comment

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

I'm curious how necessary this is, would prefer we didn't need to keep track of things with flags?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, this is quite unfortunate. The Gradle case wasn't easy for a few reasons.

  1. I couldn't find a way (if at all) to log inside JibExtension or ExtraDirectoriesParameters.
  2. The way we can extract extraDirectories.paths or extraDirectory.path in our codebase for consumption is to first go through getExtraDirectories(), which is also used by Gradle to set in config values, so unlike Maven, it's not possible to check if the user is using the old or new syntax (or both) inside getExtraDirectories(). On top of that, Gradle always calls both getExtraDirectory() and getExtraDirectories() regardless of whether the user has ever configured anything.

So, although this is very unfortunate, I couldn't find a good alternative.

// non-plural to retain backward-compatibility for the "jib.extraDirectory" config parameter
public void setExtraDirectory(Object extraDirectories) {
this.extraDirectory.setPath(extraDirectories);
public void setExtraDirectories(Object extraDirectories) {
Copy link
Member

Choose a reason for hiding this comment

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

Wouldn't we want to avoid adding getters and setters for extraDirectories? I thought in maven we're pushing everyone to use the complex type configuration for <extraDirectories><paths..... I would image we would want to do that here as well... and just not allow jib.extraDirectories = asdf

Copy link
Member Author

Choose a reason for hiding this comment

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

Sounds good with being consistent. We allowed the shortcut to remain backward compatibility after introducing .permissions, but we can clean that up since we are making breaking changes with deprecation.

@chanseokoh
Copy link
Member Author

Good for another look again.

@chanseokoh chanseokoh merged commit 68e17bc into master May 3, 2019
@chanseokoh chanseokoh deleted the i1020-extra-directories-gradle-deprecation branch May 3, 2019 14:20
zhumin8 pushed a commit that referenced this pull request Jul 14, 2022
…3682)

jib.extraDirectories = file('build/extra-directory') is one of the older syntax shown here, that is later deprecated in #1671 and removed in #2108.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants