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 support for parsing build result from string #1

Merged
merged 1 commit into from
Jan 24, 2022

Conversation

jlehtnie
Copy link
Contributor

Previously only numeric process return values were supported in
XML result-tag. This change adds support for parsing string
results. Biggest advantage is that this allows setting any build
result supported by hudson.model.Result and not only success or
failure. For backward compatibility parsing a numeric return value
is always attempted first.

@buildhive
Copy link

Jenkins » external-monitor-job-plugin #4 SUCCESS
This pull request looks good
(what's this?)

@jenkinsadmin
Copy link
Member

Thank you for a pull request! Please check this document for how the Jenkins project handles pull requests

@jglick
Copy link
Member

jglick commented Feb 17, 2014

Not currently mergeable. Use git pull [email protected]:jenkinsci/external-monitor-job-plugin.git or similar, resolving conflicts and pushing the result to update this PR.

@oleg-nenashev
Copy link
Member

Uhm, the change is an useful enhancement, which seems to be relevant even in the current code. Makes sense to revisit and merge it

Previously only numeric process return values were supported in
XML result-tag. This change adds support for parsing string
results. Biggest advantage is that this allows setting any build
result supported by hudson.model.Result and not only success or
failure. For backward compatibility parsing a numeric return value
is always attempted first.
Comment on lines +91 to +92
Scanner sc = new Scanner(text);
if (sc.hasNextInt()) {
Copy link
Member

Choose a reason for hiding this comment

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

Probably better to use Integer.parseInt + catch (NumberFormatException but OK.

@jglick jglick merged commit 48a8cc1 into jenkinsci:master Jan 24, 2022
@jglick
Copy link
Member

jglick commented Jan 24, 2022

Nine years late, but this is now shipped.

@jglick
Copy link
Member

jglick commented Jan 25, 2022

Note that this did not update the CLI command—only the REST flavor.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants