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
[JENKINS-37368] Improve performance in DownstreamPassCondition RunListener #105
Conversation
…nstreamPassCondition's RunListener
This pull request originates from a CloudBees employee. At CloudBees, we require that all pull requests be reviewed by other CloudBees employees before we seek to have the change accepted. If you want to learn more about our process please see this explanation. |
Formatting-free diff: https://github.com/jenkinsci/promoted-builds-plugin/pull/105/files?w=1 |
…ling DownstreamPassCondition's RunListener" This reverts commit 80b4749.
I realized that the test I added passes even if I don't reset the SecurityContext after impersonating SYSTEM, which made it useless. I've reverted that commit. I might have just been doing something wrong, so if there is a correct way to check that the SecurityContext is reset I can make a working test. |
You are clearly resetting it in a If there is not already functional test coverage for the promotion condition as a whole, that would be useful to add, though IIRC this plugin has fairly extensive tests already; you can enable JaCoCo and check whether the edited code is covered, if you are nervous. |
Good point about JaCoCo, the code is covered by an existing test that checks that a build gets promoted. |
@reviewbybees done |
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.
🐝
Merging & Releasing. Manually tested the patch, it seems to work fine |
Impersonate SYSTEM in DownstreamPassCondition's RunListener before calling getAllItems for faster ACL checks, and then verify the original authentication had read permission just before considering a build for promotion.
https://issues.jenkins-ci.org/browse/JENKINS-37368
@reviewbybees