-
-
Notifications
You must be signed in to change notification settings - Fork 9.2k
AdministrativeMonitorsDecorator cleanup; ManageJenkinsAction.getBadge optimization
#10855
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
AdministrativeMonitorsDecorator cleanup; ManageJenkinsAction.getBadge optimization
#10855
Conversation
…dge` optimization
…ministrativeMonitorsDecorator
A1exKH
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
timja
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested locally, looks reasonable, no need for this to be precise
| public abstract boolean isActivated(); | ||
|
|
||
| @Restricted(NoExternalUse.class) | ||
| public boolean isActivationFake() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should there be some javadoc to explain when to use this / why its here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
|
/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! |
#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).