Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Keep Duplicate Jenkins checker enabled after global config save#26631

Merged
MarkEWaite merged 1 commit into
jenkinsci:masterfrom
officialasishkumar:fix-duplicate-monitor-toggle
Apr 17, 2026
Merged

Keep Duplicate Jenkins checker enabled after global config save#26631
MarkEWaite merged 1 commit into
jenkinsci:masterfrom
officialasishkumar:fix-duplicate-monitor-toggle

Conversation

@officialasishkumar
Copy link
Copy Markdown
Contributor

@officialasishkumar officialasishkumar commented Apr 13, 2026

Fixes #26285

The administrative monitor configuration page was serializing am.id from Groovy. For DoubleLaunchChecker, Groovy resolves that property through getId(), which returns the current process ID instead of the stable AdministrativeMonitor.id field. 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

JAVA_HOME=/usr/lib/jvm/java-21-openjdk-amd64 PATH=/usr/lib/jvm/java-21-openjdk-amd64/bin:$PATH /tmp/apache-maven-3.9.6/bin/mvn -pl test -Dtest=jenkins.management.AdministrativeMonitorsConfigurationTest test

Also installed the required local jenkins-core and jenkins-war snapshots first with the documented quick-build profile because this environment only had Maven 3.8.7 on PATH:

JAVA_HOME=/usr/lib/jvm/java-21-openjdk-amd64 PATH=/usr/lib/jvm/java-21-openjdk-amd64/bin:$PATH /tmp/apache-maven-3.9.6/bin/mvn '-Pquick-build,!yarn-execution,!yarn-lint,!yarn-ci-lint' -pl war,bom -am -rf :jenkins-core -DskipTests -Dspotbugs.skip=true -Dcheckstyle.skip=true -Dspotless.check.skip=true install

Screenshots (UI changes only)

N/A

Before

After

Proposed changelog entries

  • Keep the Duplicate Jenkins checker enabled when saving the global configuration (regression in 2.549).

Proposed changelog category

/label bug

Proposed upgrade guidelines

N/A

Submitter checklist

  • The issue, if it exists, is well-described.
  • The changelog entries and upgrade guidelines are appropriate for the audience affected by the change (users or developers, depending on the change) and are in the imperative mood (see examples). Fill in the Proposed upgrade guidelines section only if there are breaking changes or changes that may require extra steps from users during upgrade.
  • There is automated testing or an explanation as to why this change has no tests.
  • New public classes, fields, and methods are annotated with @Restricted or have @since TODO Javadocs, as appropriate.
  • New deprecations are annotated with @Deprecated(since = "TODO") or @Deprecated(forRemoval = true, since = "TODO"), if applicable.
  • UI changes do not introduce regressions when enforcing the current default rules of Content Security Policy Plugin. In particular, new or substantially changed JavaScript is not defined inline and does not call eval to ease future introduction of Content Security Policy (CSP) directives (see documentation).
  • For dependency updates, there are links to external changelogs and, if possible, full differentials.
  • For new APIs and extension points, there is a link to at least one consumer.

Desired reviewers

N/A

Before the changes are marked as ready-for-merge:

Maintainer checklist

  • There are at least two (2) approvals for the pull request and no outstanding requests for change.
  • Conversations in the pull request are over, or it is explicit that a reviewer is not blocking the change.
  • Changelog entries in the pull request title and/or Proposed changelog entries are accurate, human-readable, and in the imperative mood.
  • Proper changelog labels are set so that the changelog can be generated automatically.
  • If the change needs additional upgrade steps from users, the upgrade-guide-needed label is set and there is a Proposed upgrade guidelines section in the pull request title (see example).
  • If it would make sense to backport the change to LTS, be a Bug or Improvement, and either the issue or pull request must be labeled as lts-candidate to be considered.

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.
Copilot AI review requested due to automatic review settings April 13, 2026 03:46
@comment-ops-bot comment-ops-bot Bot added the bug For changelog: Minor bug. Will be listed after features label Apr 13, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 DoubleLaunchChecker remains 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.

@MarkEWaite
Copy link
Copy Markdown
Contributor

@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?

@mawinter69
Copy link
Copy Markdown
Contributor

yes

Copy link
Copy Markdown
Contributor

@MarkEWaite MarkEWaite left a comment

Choose a reason for hiding this comment

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

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

@comment-ops-bot comment-ops-bot Bot added the ready-for-merge The PR is ready to go, and it will be merged soon if there is no negative feedback label Apr 14, 2026
@MarkEWaite MarkEWaite added the lts-candidate When fixed, this issue should be considered for backporting to the LTS line label Apr 17, 2026
@MarkEWaite MarkEWaite merged commit 82794c9 into jenkinsci:master Apr 17, 2026
22 of 23 checks passed
@welcome
Copy link
Copy Markdown

welcome Bot commented Apr 17, 2026

Congratulations on getting your very first Jenkins core pull request merged 🎉🥳

This is a fantastic achievement, and we're thrilled to have you as part of our community! Thank you for your valuable input, and we look forward to seeing more of your contributions in the future!

We would like to invite you to join the community chats and forums to meet other Jenkins contributors 😊
Don't forget to check out the participation page to learn more about how to contribute to Jenkins.


@MarkEWaite MarkEWaite removed the lts-candidate When fixed, this issue should be considered for backporting to the LTS line label Apr 24, 2026
@MarkEWaite MarkEWaite mentioned this pull request Apr 26, 2026
14 tasks
@MarkEWaite MarkEWaite added the 2.555.2-fixed Fixed in 2.555.2 by backporting label Apr 26, 2026
MarkEWaite pushed a commit that referenced this pull request Apr 29, 2026
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)
MarkEWaite added a commit to jenkins-infra/jenkins.io that referenced this pull request May 8, 2026
* 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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2.555.2-fixed Fixed in 2.555.2 by backporting bug For changelog: Minor bug. Will be listed after features ready-for-merge The PR is ready to go, and it will be merged soon if there is no negative feedback

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Duplicate Jenkins checker monitor disables itself when saving the global configuration

4 participants