Add pause/resume button to the pipeline overview page - #1345
Conversation
|
Could we use an overflow menu? 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 |
There was a problem hiding this comment.
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, andpauseStateendpoints to the Pipeline Console View action. - Added Pause/Resume dropdown items in
temporary-wrapper.jellyplus 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.
| FlowExecution execution = run.getExecution(); | ||
| if (execution == null) { | ||
| return HttpResponses.errorJSON("No execution found"); | ||
| } | ||
|
|
||
| if (!run.isBuilding()) { | ||
| return HttpResponses.errorJSON(Messages.run_isFinished()); | ||
| } |
| FlowExecution execution = run.getExecution(); | ||
| if (execution == null) { | ||
| return HttpResponses.errorJSON("No execution found"); | ||
| } | ||
|
|
||
| if (!run.isBuilding()) { | ||
| return HttpResponses.errorJSON(Messages.run_isFinished()); | ||
| } |
| fetch("pauseState") | ||
| .then((rsp) => rsp.json()) | ||
| .then((result) => { |
| // Start polling | ||
| setInterval(updatePauseResumeMenuItems, 5000); | ||
| // Initial update | ||
| setTimeout(updatePauseResumeMenuItems, 500); |
| <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"> |
| // Verify entire cancel split-button is hidden | ||
| assertThat(cancelButton).isHidden(); |
timja
left a comment
There was a problem hiding this comment.
Generally looks good, copilots comments look worth reviewing.
Feedback:
- Can we add an indication the pipeline in paused? - Maybe an info banner: https://weekly.ci.jenkins.io/design-library/banner/
- This doesn't work in the new experimental view - somewhat similar to jenkinsci/workflow-cps-plugin#1790 but I guess the same is needed for cancel - cc @janfaracik
…overflow menu is visible
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.
|
@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
|
timja
left a comment
There was a problem hiding this comment.
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.



Resolves #1344
Implemented a pause/resume button to toggle the pause state of the underlying CpsFlowExecution.
tempory-wrapper.jellyand connected them to the API methods with javascript following the same pattern as the existing cancel button.Testing done
Added new Playwright tests to verify the pause and resume button behaviors. Additional manual testing.
Submitter checklist