There were two issues preventing the build history from updating properly:
1) The next build number being fetched wasn't taking into account running builds, so any builds already running when the page is refreshed would be ignored. The fix was to use nextBuildNumberToFetch if it is available (which is the case if there are running builds) and to fall back to the next build otherwise.
2) The first transient build key (used to clear out builds from the history that are being updated) wasn't being set when the page first loads. This was fixed by making getHistoryPageFilter calculate the value so that it happens in all cases rather than just during the ajax call.
* [JENKINS-10912] Use setInterval in refreshPart
The current implementation of refreshPart creates a new closure every 5
seconds, which, in combination with XMLHttpRequest objects, results in a
significant memory leak in all major browsers. By using
window.setInterval to schedule periodic refreshes, only one closure per
id is created. Please see issue #10912 in the Jenkins tracker for
further details.
* Stop periodical calls if we can't find the div
* Don't check if isRunAsTest changed after page load
* [FIXED JENKINS-37731] Change symbol and constructor for SCMTrigger.
Using "scm" as the @Symbol led to collisions with the "scm" global
variable in Pipeline, so that had to go. Changed it to "pollScm". Also
moved the @DataBoundConstructor to the single-parameter constructor,
deprecated the two-parameter constructor, created a @DataBoundSetter
for ignorePostCommitHooks, and added a getter for "scmpoll_spec" to
fix snippet generator and general syntactic goodness.
So now, with this, it's possible to do:
properties([
pipelineTriggers([
pollScm('@daily')
])
])
Tada.
Tests for the snippet generator and job property stuff will be landing
in a separate PR for workflow-multibranch.
* Review comments.
* Updating @since to 2.22
* [JENKINS-37874] - Log SEVERE messages if Jenkins does not reach COMPLETED stage during startup or reload
* [JENKINS-37874] - Add Administrative monitor for the COMPLETED state
* [JENKINS-37874] - Polish log messages
* [JENKINS-36748] Add a test case and not process null specs
* [JENKINS-36748] Correct license and add a minor comment
* [JENKINS-36748] Add a Waning logger when spec is null