Skip to content

Tool to cancel builds - #216

Open
mawinter69 wants to merge 4 commits into
jenkinsci:mainfrom
mawinter69:cancel-build
Open

Tool to cancel builds#216
mawinter69 wants to merge 4 commits into
jenkinsci:mainfrom
mawinter69:cancel-build

Conversation

@mawinter69

Copy link
Copy Markdown
Contributor

Add the tool cancelBuild. Requires the parameters jobFullName and buildNumber. Performs relevant checks upfront. While the doStop methods perform permission checks themselves, they only return httpresponses which is a bit arkward to work with. So when we call doStop we can be sure we're allowed to cancel.

fixes #189

Testing done

Full unit test coverage check various scenarios

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

Add the tool `cancelBuild`.  requires the parameters jobFullName and the
build number. Performs relevant checks upfront. While the doStop methods
perform permission checks themselves, they only return httpresponses
which is a bit arkward to work with. So when we call `doStop` we can be
sure we're allowed to cancel.

fixes jenkinsci#189
@mawinter69
mawinter69 requested a review from a team as a code owner August 4, 2026 21:02
"getFlakyFailures",
"getQueueItem");
"getQueueItem",
"cancelBuild");

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.

should be documented in the README as well

@mawinter69

Copy link
Copy Markdown
Contributor Author

Should that maybe also be able to cancel items from the queue? E.g. when the job name is ommitted the buildnumber could be be interpreted as the queue id.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feature: add stop/cancel/abort build tool

2 participants