Skip to content

Fix #170 When bintray.key is null the bintrayUpload task silently fails #186

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

Conversation

mstachniuk
Copy link

No description provided.

Copy link

@mockitoguy mockitoguy left a comment

Choose a reason for hiding this comment

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

I hope my comments are useful :)

errors.add("key is not configured")
}
if(!errors.isEmpty()) {
errors.join(" and ")

Choose a reason for hiding this comment

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

Unused code

Copy link
Author

Choose a reason for hiding this comment

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

It is used, see should throw an exception when user and api key is not configured test.

Copy link
Author

Choose a reason for hiding this comment

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

Ahhh ok in next line I have this same.

}
if(!errors.isEmpty()) {
errors.join(" and ")
def message = "Failing task '${this.project.name}:bintrayUpload' because ${errors.join(" and ")}"

Choose a reason for hiding this comment

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

It is not desirable to duplicate the task name here. Instead of ${this.project.name}:bintrayUpload we can just use $path. Every task has 'path' property which I think is exactly what we need here :)

Copy link
Author

Choose a reason for hiding this comment

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

I just copied and modified a message from line 177. I can fix that if needed.

throw new GradleException(message)
}
}

boolean shouldSkip() {

Choose a reason for hiding this comment

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

dead code

Copy link
Author

Choose a reason for hiding this comment

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

It's used in getAllBintrayUploadTasks()

logger.info("Skipping task '{}:bintrayUpload' because user or apiKey is null.", this.project.name);
return
}
assertUploadConfiguration()

Choose a reason for hiding this comment

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

Warning to bintray plugin owners: this change is backwards incompatible. This change makes sense from the standpoint of fast feedback and the principle of least surprise (silently skipping is bad). If you choose to roll out incompatible change please document it well and apply semver principles (bump major version).

Choose a reason for hiding this comment

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

If JFrog does not want to make a missing API key or user fail the build, then at least log a warning instead of silently failing. Just changing logger.info to logger.warn would save a lot of people a lot of time as warnings would be logged by Gradle by default.

@mockitoguy
Copy link

Thank you @mstachniuk for taking the initiative to fix the problem!

@mstachniuk
Copy link
Author

@eyalbe4 Could you look on this PR please?

@eyalbe4
Copy link
Contributor

eyalbe4 commented Jun 14, 2017

Sure @mstachniuk. Thank you for this. It is great to see the collaboration and team work.
I'll look into and test this soon.

@eyalbe4
Copy link
Contributor

eyalbe4 commented Jul 2, 2017

@mstachniuk and @szczepiq,
I tacked down the original issue, for which the shouldSkip() method has been added: #74
Adding this validation will probably trigger back the original issue. We need to come up with a solution that will satisfy both requirements.

@eddiezane
Copy link

Any update here? I got burned by this hard today.

@eyalbe4
Copy link
Contributor

eyalbe4 commented Aug 4, 2018

I think that this issue can be closed, because the plugin's behaviour has been modified in the lastest releases and this issue should be resolved now.
If anyone is still affected by this l, please let us know and we'll reopen.

@eyalbe4 eyalbe4 closed this Aug 4, 2018
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.

5 participants