Repository navigation
Conversation
The has-disabled-dependency rule locks the enable toggle, but the all-dependents-disabled override (made !important for JENKINS-68277) and the has-dependents-but-disabled override come later and unlocked it again, so the toggle took clicks under "This plugin cannot be enabled". Both overrides now skip rows with a disabled dependency. PluginManagerInstalledGUITest judged a toggle changeable from the row's classes alone; it now also checks the toggle's computed pointer-events, which fails on the old stylesheet.
|
Yay, your first pull request towards Jenkins core was created successfully! Thank you so much! |
There was a problem hiding this comment.
🟡 Changes recommended
The regression test never exercises has-dependents-but-disabled, leaving the selector change unprotected without a disabled dependency-chain scenario that verifies pointer-events: none.
1 open issue
What changed in this PR
Fixes the Installed plugins page regression reported in #18237 by keeping toggles locked when a plugin has a disabled dependency, while preserving the ability to disable plugins whose dependents are all disabled.
Changes:
- Prevent both toggle-unlocking CSS rules from overriding the disabled-dependency restriction.
- Extend GUI assertions to check computed
pointer-events, rather than relying solely on row classes.
| File | Description |
|---|---|
test/src/test/java/hudson/PluginManagerInstalledGUITest.java |
Adds computed-style assertions and links the regression issue. |
src/main/scss/pages/_plugin-manager.scss |
Excludes plugins with disabled dependencies from both toggle-unlocking rules. |
Review effort: Balanced
| tr.has-dependents-but-disabled:not(.has-disabled-dependency) .enable input, | ||
| tr.has-dependents-but-disabled:not(.has-disabled-dependency) .enable button, | ||
| tr.has-dependents-but-disabled:not(.has-disabled-dependency) |
There was a problem hiding this comment.
Added test_disabled_dependency_locks_plugins_further_up_a_chain. Three synthetic plugins form a chain (chain-top → chain-middle → chain-bottom), all disabled before the page renders, so chain-middle carries has-dependents-but-disabled while its own dependency is disabled. The test checks that its toggle has pointer-events: none, that chain-top's does too, and that chain-bottom can still be enabled.
With only the has-dependents-but-disabled selector change reverted, it fails with "The enable toggle of plugin 'chain-middle' can be clicked. expected: but was: "; with this PR it passes.
Three synthetic plugins form a chain (chain-top depends on chain-middle, which depends on chain-bottom), all disabled before the page renders. So chain-middle carries has-dependents-but-disabled while its own dependency is disabled, and its toggle must take no clicks. Without the has-dependents-but-disabled selector change, the test fails on it.

Fixes #18237
The Installed plugins page lets you switch on a plugin while one of its dependencies is switched off, even as the page says "This plugin cannot be enabled". Jenkins then records the plugin as enabled, and it fails to load on the next restart. This has been the case since 2.344.
The toggle is meant to be locked by the
has-disabled-dependencyrule, but two rules that unlock it come later in the stylesheet and win:all-dependents-disabled, which gained!importantin [JENKINS-68277] Fix not being able to disable a plugin when dependent plugins are disabled #6486 (JENKINS-68277, 2.344) so a plugin whose dependents are all off can be switched off. It also unlocks a disabled plugin that has a disabled dependency, which is the case in the issue.has-dependents-but-disabled, which unlocks a disabled plugin that has dependents. It does the same for a plugin in the middle of a chain whose own dependency is off.Both now skip rows with
has-disabled-dependency, so a disabled dependency always keeps the toggle locked. JENKINS-68277 stays fixed: a plugin whose dependents are all off can still be switched off.Testing done
PluginManagerInstalledGUITestdecided whether a toggle could be changed from the row's classes alone, so it passed while the toggle could still be clicked. Each "changeable" and "not changeable" assertion now also checks the toggle's computedpointer-events. With master's stylesheet the test fails at the step wheremandatory-dependerhas a disabled dependency ("The enable toggle of plugin 'mandatory-depender' can be clicked. expected: but was: "); with this change it passes. The steps for JENKINS-33843 and JENKINS-68277 still pass.prettier --checkandstylelintpass on the changed stylesheet;spotless:checkpasses on the test.Screenshots (UI changes only)
Before
On 2.590 the toggle is clickable under "This plugin cannot be enabled":
After
The toggle is dimmed and ignores clicks:
Proposed changelog entries
Proposed changelog category
/label regression-fix
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
@janfaracik, who wrote #6486
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.