Skip to content

JENKINS-41806# Fix for failing Build.getBuildResult() during JSON serialization#473

Closed
vivek wants to merge 1 commit intojenkinsci:masterfrom
vivek:fix-for-exportable-build-result
Closed

JENKINS-41806# Fix for failing Build.getBuildResult() during JSON serialization#473
vivek wants to merge 1 commit intojenkinsci:masterfrom
vivek:fix-for-exportable-build-result

Conversation

@vivek
Copy link

@vivek vivek commented Feb 13, 2017

In cases where hudson.plugins.git.util.Build is serialized as JSON, Build.getBuildResult() fails to serialize as reported in https://issues.jenkins-ci.org/browse/JENKINS-41806. The failure is because Stapler expects Result to be @ExportedBean as it's exposed from hudson.plugins.git.util.Build which is ExportedBean and fails serialization.

Here the fix is to preserve Java API contract as well as JSON where buildResult element is returned correctly.

@vivek
Copy link
Author

vivek commented Feb 13, 2017

cc: @reviewbybees

Copy link
Member

@jglick jglick left a comment

Choose a reason for hiding this comment

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

I think this is wrong; Run.getResult successfully exports a Result object, because it implements CustomExportedBean. So somehow that code path is not getting correctly checked in this case. Track down and fix the root problem rather than working around it.

@vivek
Copy link
Author

vivek commented Feb 14, 2017

@jglick yes, the real fix is probably somewhere in stapler and should be fixed there. However this fix has it's won merit: it makes this works with users till that (probable) stapler fix appears in future version of Jenkins and also works for users who are on older versions of LTS.

@jglick
Copy link
Member

jglick commented Feb 14, 2017

till that (probable) stapler fix

Track down and fix the actual bug first, and then it will be clear whether a short-term workaround is necessary and what form it should take.

@vivek
Copy link
Author

vivek commented Feb 14, 2017

Track down and fix the actual bug first, and then it will be clear whether a short-term workaround is necessary and what form it should take.

@jglick jenkinsci/stapler#107. PTAL.

@ghost
Copy link

ghost commented Feb 25, 2017

This pull request originates from a CloudBees employee. At CloudBees, we require that all pull requests be reviewed by other CloudBees employees before we seek to have the change accepted. If you want to learn more about our process please see this explanation.

@vivek
Copy link
Author

vivek commented Mar 11, 2017

Closing it as the right fix was made in blueocean.

@vivek vivek closed this Mar 11, 2017
@vivek vivek deleted the fix-for-exportable-build-result branch March 11, 2017 00:23
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