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

Error on invalid jib.httpTimeout values at plugin front-ends #667

Merged
merged 23 commits into from
Jul 19, 2018

Conversation

chanseokoh
Copy link
Member

@chanseokoh chanseokoh commented Jul 19, 2018

Fixes #582.

@chanseokoh
Copy link
Member Author

You can start reviewing. Once #656 is merged, I'll change the target base for merging.

@chanseokoh
Copy link
Member Author

Hmm... I just saw the .jib.frontend package in jib-core. I guess the code should go in there.

@chanseokoh
Copy link
Member Author

Also, looks like I should throw MojoExecutionException for Maven and GradleException for Gradle.

@chanseokoh chanseokoh changed the base branch from i582-http-timeout to master July 19, 2018 19:24
try {
String value = System.getProperty("jib.httpTimeout");
if (value != null && Integer.parseInt(value) < 0) {
throw exceptionFactory.apply("negative value of jib.httpTimeout");
Copy link
Contributor

Choose a reason for hiding this comment

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

How about a wording of "jib.httpTimeout cannot be negative: -1234" (with the negative value)?

throw exceptionFactory.apply("negative value of jib.httpTimeout");
}
} catch (NumberFormatException ex) {
throw exceptionFactory.apply("non-integer value of jib.httpTimeout");
Copy link
Contributor

Choose a reason for hiding this comment

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

How about a wording of "jib.httpTimeout must be an integer: notaninteger" (with the attempted value)?

}
} catch (NumberFormatException ex) {
throw exceptionFactory.apply("non-integer value of jib.httpTimeout");
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's include a private constructor for this static utility class.

@coollog coollog added this to the v0.9.7 milestone Jul 19, 2018
@coollog
Copy link
Contributor

coollog commented Jul 19, 2018

Cools, we'll be able to do a v0.9.7 release after this is merged.

@TadCordle
Copy link
Contributor

@coollog should we get the last bit of #586 in as well?

@coollog
Copy link
Contributor

coollog commented Jul 19, 2018

@TadCordle We could probably do the equals(registry) || startsWith(registry + "/") since its quick and easy.

@chanseokoh
Copy link
Member Author

@TadCordle We could probably do the equals(registry) || startsWith(registry + "/") since its quick and easy.

To clarify, this is being handled correctly after #650.

@chanseokoh chanseokoh merged commit 283b33a into master Jul 19, 2018
@chanseokoh chanseokoh deleted the i582-http-timeout-frontends branch July 19, 2018 20:21
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.

3 participants