Skip to content
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-35098] Disable AutoBrowserHolder by default to improve the changelog rendering performance #2371

Merged

Conversation

jglick
Copy link
Member

@jglick jglick commented May 24, 2016

JENKINS-35098

See JIRA for motivation.

Also took the opportunity to clean up some ancient form binding. The fewer weird tricks we have floating around the source base, the better.

@reviewbybees

@oleg-nenashev
Copy link
Member

I'm not convinced the AutoBrowser holder is useless at all.
My recommendation would be to...

  1. deprecate the AutoBrowser class
  2. create AutoBrowser Holder only if SCM returns true for isBrowserReusable()
  3. maybe it's possible to add SystemProperty to disable this AutoBrowser creation at all

@oleg-nenashev oleg-nenashev added the needs-more-reviews Complex change, which would benefit from more eyes label May 25, 2016
@stephenc
Copy link
Member

🐝 👍 let's remove this "magic"

@jglick
Copy link
Member Author

jglick commented May 25, 2016

create AutoBrowser Holder only if SCM returns true for isBrowserReusable()

Not so easy. This method takes both the “owner” SCM, and each candidate SCM. And the performance problem to begin with is finding those candidate SCMs. So you cannot actually call the method. The only thing you could do is use reflection to check if it is overridden.

Anyway this would only potentially benefit Subversion users (i.e., they would get the existing feature, at the existing performance cost). CVS users would continue to get the broken implementation, and the performance cost.

add SystemProperty to disable

That would leave most users with the performance problem.

You could have a system property to enable the feature, but by the time you figure out that you need this feature and such a property exists and you modify your Jenkins startup script and restart, you could have just fixed your job configurations already.

I'm not convinced the AutoBrowser holder is useless

I did not say it was useless, just that on balance it seems like a poor decision from the start to have put this in core. We do not have anything else that I know of in Jenkins which quietly guesses what you meant to configure without you actually doing so. For people using traditional GUI configuration of jobs, this class of feature can be helpful, but the UI would probably need to be different: say, a list of suggested configuration tweaks to newly created jobs to set up not just the SCM browser but the buildDiscarder, mail notification, etc., with a way to batch-approve the suggestions or decline them. Fine territory for a plugin.

@oleg-nenashev
Copy link
Member

@jglick
OK, then SystemProperty, which enables this feature back.
I'm 👍 on disabling this feature by default.

@oleg-nenashev oleg-nenashev added the needs-comments-resolved Comments in the PR need to be addressed before it can be considered for merging label Jun 2, 2016
@jglick
Copy link
Member Author

jglick commented Jun 2, 2016

Still prefer to delete it altogether and simplify the code, but if you insist…

jglick referenced this pull request in jenkinsci/cvs-plugin Jun 2, 2016
@jglick jglick removed the needs-comments-resolved Comments in the PR need to be addressed before it can be considered for merging label Jun 2, 2016
@@ -85,6 +85,15 @@
@ExportedBean
public abstract class SCM implements Describable<SCM>, ExtensionPoint {

/** JENKINS-35098: discouraged */
@SuppressWarnings("FieldMayBeFinal")
private static boolean useAutoBrowserHolder = Boolean.getBoolean(SCM.class.getName() + ".useAutoBrowserHolder");
Copy link
Member

Choose a reason for hiding this comment

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

Please use SystemProperties.getBoolean() (new API in 2.4)

@oleg-nenashev
Copy link
Member

🐝 from me, @reviewbybees done

@jglick jglick added ready-for-merge The PR is ready to go, and it will be merged soon if there is no negative feedback and removed needs-more-reviews Complex change, which would benefit from more eyes labels Jun 10, 2016
@oleg-nenashev oleg-nenashev changed the title [JENKINS-35098] No more AutoBrowserHolder [JENKINS-35098] Disable AutoBrowserHolder by default to improve the changelog rendering performance Jun 10, 2016
@oleg-nenashev oleg-nenashev merged commit d33df0f into jenkinsci:master Jun 10, 2016
oleg-nenashev added a commit that referenced this pull request Jun 12, 2016
SCMDescriptor<?> d = SCM._for(target).get(scmidx);
d.generation++;
return d.newInstance(req, req.getSubmittedForm().getJSONObject("scm"));
SCM scm = req.bindJSON(SCM.class, req.getSubmittedForm().getJSONObject("scm"));
Copy link
Member

Choose a reason for hiding this comment

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

@oleg-nenashev @jglick Could this have caused JENKINS-35906?

Copy link
Member Author

Choose a reason for hiding this comment

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

Probably. No longer calling SCMDescriptor.newInstance overloads. They are a bad idea of course and unnecessary.

Copy link
Member Author

Choose a reason for hiding this comment

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

Possibly could use DescriptorExtensionList.newInstanceFromRadioList for this purpose.

@jglick jglick deleted the AutoBrowserHolder-JENKINS-35098 branch June 28, 2016 15:35
samatdav pushed a commit to samatdav/jenkins that referenced this pull request Jul 25, 2016
…hangelog rendering performance (jenkinsci#2371)

* [FIXED JENKINS-35098] Deleting AutoBrowserHolder.

* Normalizing form binding scheme for AbstractProject.scm.

* At @oleg-nenashev’s insistence, restoring AutoBrowserHolder, though not using it by default.

* Using SystemProperties at @oleg-nenashev’s recommendation.
samatdav pushed a commit to samatdav/jenkins that referenced this pull request Jul 25, 2016
…hangelog rendering performance (jenkinsci#2371)

* [FIXED JENKINS-35098] Deleting AutoBrowserHolder.

* Normalizing form binding scheme for AbstractProject.scm.

* At @oleg-nenashev’s insistence, restoring AutoBrowserHolder, though not using it by default.

* Using SystemProperties at @oleg-nenashev’s recommendation.
olivergondza pushed a commit that referenced this pull request Aug 8, 2016
…hangelog rendering performance (#2371)

* [FIXED JENKINS-35098] Deleting AutoBrowserHolder.

* Normalizing form binding scheme for AbstractProject.scm.

* At @oleg-nenashev’s insistence, restoring AutoBrowserHolder, though not using it by default.

* Using SystemProperties at @oleg-nenashev’s recommendation.

(cherry picked from commit d33df0f)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

4 participants