-
Notifications
You must be signed in to change notification settings - Fork 281
[JENKINS-70558] Fix TopicAssociation not set after Jenkins restart #484
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
[JENKINS-70558] Fix TopicAssociation not set after Jenkins restart #484
Conversation
* | ||
* @param enable true or false. | ||
*/ | ||
@Deprecated | ||
@DataBoundSetter |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that's the way how we want it. If the old build configuration xml is read it will set the value already and create the new TopicAssociation class.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
config.xml
deserialization doesn't care about @DataBoundSetter
et.al. Those are only relevant for form submission and CasC.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can write a test using JenkinsSessionRule or RealJenkinsRule to test that the configuration actually survives a restart.
* | ||
* @param enable true or false. | ||
*/ | ||
@Deprecated | ||
@DataBoundSetter |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
config.xml
deserialization doesn't care about @DataBoundSetter
et.al. Those are only relevant for form submission and CasC.
Thanks for the pointer, added a test now and removed the |
The PR #481 introduced a small bug that the
TopicAssociation
field is not set after a Jenkins restart.Description from Jenkins issue: https://issues.jenkins.io/browse/JENKINS-70558
In the job configuration if TopicAssociation is enabled and Jenkins is restarted the option is not set anymore.
The reason is that the
readResolve()
function checks the config valueprivate transient boolean enableTopicAssociation = Config.DEFAULT_ENABLE_TOPIC_ASSOCIATION;
(GerritTrigger.java) which is always false. Since this condition is always the case the topicAssociation value in the GerritTrigger class is set to "null".