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

[JENKINS-63846] From address can't be changed #249

Merged
merged 1 commit into from Oct 26, 2020

Conversation

basil
Copy link
Member

@basil basil commented Oct 24, 2020

See JENKINS-63846. Versions 2.71 and earlier persisted the address for additional accounts but not the default account. Starting in 2.72, the admin address is copied from the Jenkins Location configuration into the default account at the time ExtendedEmailPublisherDescriptor is first saved, but this value is not editable in the UI nor does it get updated when the admin address is subsequently updated in the Jenkins Location configuration. Compare the persisted XML before and after. In the second example, you can see that address has been persisted for the default account at the time ExtendedEmailPublisherDescriptor was saved. Even though the Jenkins Location configuration was later modified, that change was never propagated back to ExtendedEmailPublisherDescriptor.

This change reverts us back to the old (working) design where only additional accounts have a persisted address and the default account has a null address, delegating to the Jenkins Location configuration. In order to clear up the bad state that was persisted between 2.72 and 2.77, we unconditionally clear the address for the default account in ExtendedEmailPublisherDescriptor#readResolve.

I have added two new tests to verify the correctness of this fix. ExtendedEmailPublisherTest#testSystemAdminEmailChange verifies that admin address changes work on the current release, and ExtendedEmailPublisherDescriptorTest#persistedConfigurationBeforeDefaultAddress verifies that the persistent state from 2.72 is correctly cleaned up in ExtendedEmailPublisherDescriptor#readResolve.

@basil basil added the bug label Oct 25, 2020
@basil basil merged commit a8de7cb into jenkinsci:master Oct 26, 2020
@basil
Copy link
Member Author

basil commented Oct 31, 2020

Released in 2.78.

@basil basil deleted the JENKINS-63846 branch October 31, 2020 02:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants