Keep Duplicate Jenkins checker enabled after global config save#26631
Conversation
Use direct Groovy field access when serializing administrative monitor IDs so monitors with a getId method keep their stable AdministrativeMonitor.id in global configuration submissions. Add a regression test for the Duplicate Jenkins checker monitor staying enabled after a global configuration round-trip.
There was a problem hiding this comment.
Pull request overview
Fixes a global configuration round-trip bug where the “Duplicate Jenkins checker” administrative monitor could disable itself after saving due to Groovy property resolution returning a process ID instead of the stable AdministrativeMonitor.id.
Changes:
- Update the administrative monitors global config UI to serialize the stable monitor ID via direct field access (
am.@id). - Add a regression test ensuring the
DoubleLaunchCheckerremains enabled after submitting/configure.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| core/src/main/resources/jenkins/management/AdministrativeMonitorsConfiguration/config.groovy | Switch checkbox JSON/value source to the stable AdministrativeMonitor id field (avoids getId() overrides). |
| test/src/test/java/jenkins/management/AdministrativeMonitorsConfigurationTest.java | New JUnit 5 test covering the global configuration submit round-trip for DoubleLaunchChecker. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@mawinter69 this is proposing to fix the same issue that you've proposed to fix in pull request: Should we accept this short term fix while you're completing the work on the larger enhancement request? |
|
yes |
MarkEWaite
left a comment
There was a problem hiding this comment.
This PR is now ready for merge. We will merge it after approximately 24 hours if there is no negative feedback. Please see the merge process documentation for more information about the merge process.
/label ready-for-merge
|
Congratulations on getting your very first Jenkins core pull request merged 🎉🥳 |
Fix duplicate Jenkins checker admin monitor round-trip Use direct Groovy field access when serializing administrative monitor IDs so monitors with a getId method keep their stable AdministrativeMonitor.id in global configuration submissions. Add a regression test for the Duplicate Jenkins checker monitor staying enabled after a global configuration round-trip. (cherry picked from commit 82794c9)
* Add 2.555.2 changelog and upgrade guide Includes links to issues: * jenkinsci/jenkins#26285 * jenkinsci/jenkins#26720 * jenkinsci/jenkins#26720 Includes links to pull requests: * jenkinsci/jenkins#26631 * jenkinsci/jenkins#26719 * jenkinsci/jenkins#26757 Testing done: * Confirmed the links work as expected * Add MSI installer signing change Included in upgrade guide and changelog * Remove extra space character Co-authored-by: Hervé Le Meur <[email protected]> --------- Co-authored-by: Hervé Le Meur <[email protected]>
Fixes #26285
The administrative monitor configuration page was serializing
am.idfrom Groovy. ForDoubleLaunchChecker, Groovy resolves that property throughgetId(), which returns the current process ID instead of the stableAdministrativeMonitor.idfield. Saving the global configuration then disables the monitor because the submitted value does not match the persisted monitor ID.This uses direct field access for the serialized monitor ID and adds a regression test for the global configuration round-trip.
Testing done
Also installed the required local
jenkins-coreandjenkins-warsnapshots first with the documented quick-build profile because this environment only had Maven 3.8.7 onPATH:Screenshots (UI changes only)
N/A
Before
After
Proposed changelog entries
Proposed changelog category
/label bug
Proposed upgrade guidelines
N/A
Submitter checklist
@Restrictedor have@since TODOJavadocs, as appropriate.@Deprecated(since = "TODO")or@Deprecated(forRemoval = true, since = "TODO"), if applicable.evalto ease future introduction of Content Security Policy (CSP) directives (see documentation).Desired reviewers
N/A
Before the changes are marked as
ready-for-merge:Maintainer checklist
upgrade-guide-neededlabel is set and there is a Proposed upgrade guidelines section in the pull request title (see example).lts-candidateto be considered.