AdministrativeMonitorsDecorator cleanup; ManageJenkinsAction.getBadge optimization - #10855
Merged
Merged
Conversation
…dge` optimization
…ministrativeMonitorsDecorator
timja
approved these changes
Aug 4, 2025
timja
left a comment
Member
There was a problem hiding this comment.
Tested locally, looks reasonable, no need for this to be precise
| public abstract boolean isActivated(); | ||
|
|
||
| @Restricted(NoExternalUse.class) | ||
| public boolean isActivationFake() { |
Member
There was a problem hiding this comment.
should there be some javadoc to explain when to use this / why its here?
Member
Author
There was a problem hiding this comment.
Well, it is for now only exposed internally, so I figure anyone curious can easily follow the overrides & reference. The prior code was not particularly illuminating either. I guess the more interesting comments would be on the implementations.
NotMyFault
approved these changes
Aug 14, 2025
Member
|
/label ready-for-merge This PR is now ready for merge, after ~24 hours, we will merge it if there's no negative feedback. Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#2558 introduced
AdministrativeMonitorsDecoratorwhich #5063 elaborated withAdministrativeMonitorsApi. However #10245 completely redesigned how this information is shown in all cases except for the actual/manage/page, which continues to display the HTML blurbs of all active admin monitors. Now other pages (as viewed by an admin) merely need to show a badge if there are any admin monitors active. It did include a count, but counting them forces theisActivatedmethod of all applicable monitors to be run on every page load, when really what we mainly care about is whether or not a badge needs to be shown (and whether it should be marked a security issue or not). So we can now actually just check whether there is at least one security monitor active; if not, whether there is at least one non-security monitor active. WhileisActivatedwas documented to need to run “fast”, this was a burden, and we may as well try to avoid checking any more monitors than we really have to, if there is already at least one monitor active.This also cleans up a bunch of dead code left behind by #10245.
Testing done
New test coverage for laziness (failed as expected prior to change). Also various interactive tests causing three categories of monitor to be activated or not:
/manage/or they do not)Proposed changelog entries
Proposed changelog category
/label rfe
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
@daniel-beck @janfaracik
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 (see query).