Skip to content

Add pause/resume button to the pipeline overview page - #1345

Merged
timja merged 16 commits into
jenkinsci:mainfrom
stuartrowe:issue-1344-pause-button
Jun 22, 2026
Merged

Add pause/resume button to the pipeline overview page#1345
timja merged 16 commits into
jenkinsci:mainfrom
stuartrowe:issue-1344-pause-button

Conversation

@stuartrowe

Copy link
Copy Markdown
Contributor

Resolves #1344

Implemented a pause/resume button to toggle the pause state of the underlying CpsFlowExecution.

  • Added new API methods for pausing, resuming and querying the pause state.
  • Created new buttons in tempory-wrapper.jelly and connected them to the API methods with javascript following the same pattern as the existing cancel button.
Pause Resume
image image

Testing done

Added new Playwright tests to verify the pause and resume button behaviors. Additional manual testing.

Submitter checklist

  • Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
  • Ensure that the pull request title represents the desired changelog entry
  • Please describe what you did
  • Link to relevant issues in GitHub or Jira
  • Link to relevant pull requests, esp. upstream and downstream changes
  • Ensure you have provided tests that demonstrate the feature works or the issue is fixed

@stuartrowe
stuartrowe requested a review from a team as a code owner June 19, 2026 04:29
@timja

timja commented Jun 19, 2026

Copy link
Copy Markdown
Member

Could we use an overflow menu?
I don't think this needs to be a primary action in the app bar.

I've never used this button and I don't think it should be in front of cancel which is intentionally to the left of all other actions to make it easy to click.

Thanks for the PR

@stuartrowe

Copy link
Copy Markdown
Contributor Author

I've prototyped adding an overflow menu to the existing Cancel button:

Pause Resume
image image

It would be nice if the pipeline visualization would reflect the paused state as well.

@timja
timja requested a review from Copilot June 21, 2026 07:46
@timja timja added the enhancement New feature or request label Jun 21, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds pause/resume controls to the Pipeline Overview page, exposing CpsFlowExecution pause state via new backend endpoints and wiring them into the existing “Cancel” split-button dropdown, with Playwright coverage for the new behavior.

Changes:

  • Added doPause, doResume, and pauseState endpoints to the Pipeline Console View action.
  • Added Pause/Resume dropdown items in temporary-wrapper.jelly plus JS handlers and polling to keep UI state in sync.
  • Added Playwright tests and page-object helpers for pause/resume interactions.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
src/main/java/io/jenkins/plugins/pipelinegraphview/consoleview/PipelineConsoleViewAction.java Adds pause/resume endpoints and pause-state query API.
src/main/resources/components/temporary-wrapper.jelly Adds Pause/Resume dropdown items and binds them to Stapler JS proxies.
src/main/webapp/js/build.js Adds click handling + polling to toggle Pause/Resume visibility; improves cancel split-button hiding.
src/main/resources/io/jenkins/plugins/pipelinegraphview/Messages.properties Adds localized messages for pause/resume failures and unsupported pipelines.
src/main/resources/components/temporary-wrapper.properties Adds UI strings for Pause/Resume menu items and success notifications.
src/test/java/io/jenkins/plugins/pipelinegraphview/playwright/PipelineOverviewPage.java Adds page-object helpers for pause/resume.
src/test/java/io/jenkins/plugins/pipelinegraphview/PipelineGraphViewPauseTest.java Adds Playwright tests validating pause/resume behavior and visibility changes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +382 to +389
FlowExecution execution = run.getExecution();
if (execution == null) {
return HttpResponses.errorJSON("No execution found");
}

if (!run.isBuilding()) {
return HttpResponses.errorJSON(Messages.run_isFinished());
}
Comment on lines +416 to +423
FlowExecution execution = run.getExecution();
if (execution == null) {
return HttpResponses.errorJSON("No execution found");
}

if (!run.isBuilding()) {
return HttpResponses.errorJSON(Messages.run_isFinished());
}
Comment on lines +182 to +184
fetch("pauseState")
.then((rsp) => rsp.json())
.then((result) => {
Comment thread src/main/webapp/js/build.js Outdated
Comment on lines +209 to +212
// Start polling
setInterval(updatePauseResumeMenuItems, 5000);
// Initial update
setTimeout(updatePauseResumeMenuItems, 500);
Comment on lines 77 to 82
<j:set var="cancelProxyId" value="${h.generateId()}" />
<st:bind value="${it}" var="rerunAction${cancelProxyId}"/>
<div class="jenkins-split-button">
<button id="pgv-rerun"
data-proxy-name="rerunAction${proxyId}"
data-proxy-name="rerunAction${cancelProxyId}"
class="jenkins-button jenkins-!-build-color">
Comment on lines +95 to +96
// Verify entire cancel split-button is hidden
assertThat(cancelButton).isHidden();

@timja timja left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Generally looks good, copilots comments look worth reviewing.

Feedback:

Remove observer pattern as pause state polling needs to always run when
the build is in progress in order to show/hide the banner. Poll every
5s when the pause/resume menu items are hidden and every 1s when they
are visible.
@stuartrowe

Copy link
Copy Markdown
Contributor Author

@timja I've addressed copilot's suggestions and added a banner when the execution is paused.

Do you have any feedback on the placement and choice of warning color?

image

@timja timja left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Tested, it was missing on the new layout still with the experimental feature flag.

I've added it there too, good enough for now, could add a button to resume to the CTA but I doubt this is used much.

@timja
timja enabled auto-merge (squash) June 22, 2026 21:23
@timja
timja merged commit 1cf0f01 into jenkinsci:main Jun 22, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add pause/resume toggle to pipeline page

3 participants