Skip to content

Added flag to invoke doStop on WorkflowRun instead of throwing FlowInterruptedException #33

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

cconnert
Copy link

Currently the scmSkip does not work as expected in our multi branch pipeline. The build continues to run and only is properly aborted sometimes. Still aborting the build in the JenkinsUI does work. Thus I added a backwards compatible flag to invoke the doStop on a WorkflowRun instead of throwing an execption.

Testing done

Added new unit test to cover new flag

### Submitter checklist
- [x] Make sure you are opening from a **topic/feature/bugfix branch** (right side) and not your main branch!
- [x] Ensure that the pull request title represents the desired changelog entry
- [x] Please describe what you did
- [x] Link to relevant issues in GitHub or Jira
- [x] Link to relevant pull requests, esp. upstream and downstream changes
- [x] Ensure you have provided tests - that demonstrates feature works or fixes the issue

@cconnert cconnert requested a review from a team as a code owner April 18, 2024 13:18
@zbynek
Copy link
Contributor

zbynek commented Apr 18, 2024

Interesting, my experience was the opposite: with doStop some multibranch pipelines kept running, with the exception they stop. Would be nice to have one solution that "just works" instead of a flag. I somehow suspect this may be related to agent type. What kind of agents do you use -- ssh / websocket / ... ?

@cconnert
Copy link
Author

cconnert commented Apr 18, 2024

Indeed interesting.
Well I use containerized build agents based on the standard jenkins agent container. The agent itself is then managed by the jenkins swarm plugin (https://plugins.jenkins.io/swarm/).
Inside those containers I make use of DockerInDocker (DinD) in order to write run the different stages of the declarative multibranch pipeline.
In regards to the pipeline, I do have a custom checkout step. The scmSkip step is executed directly after doing the checkout. I also tried to create a followup stage but that did not change anything.
In regards to the doStop, I did not test it yet but I strongly guess it will work, as it does within the UI.

I agree, that the flag is not a pretty solution. Just wanted to try if it works... If possible (server is not entierly under my control), I'll install a custom build in order to verify my assumption

@cconnert
Copy link
Author

@zbynek did you manage to figure something out? Otherwise it would be great to if consider merging this issue as a workaround. I know that a flag is not to pretty but it is better then nothing

@zbynek
Copy link
Contributor

zbynek commented Jul 24, 2024

@cconnert sorry, I forgot about this.

@cconnert
Copy link
Author

@zbynek: Currently it seems that the aborts to work. I'll monitor our release pipelines and get back to this issue

@lppedd
Copy link

lppedd commented May 30, 2025

Hey! Just to understand the plugin behavior before installing it. Is my understanding correct in that with a pipeline build, the build itself will be reported as a failure because of it being aborted?

@zbynek
Copy link
Contributor

zbynek commented May 30, 2025

@lppedd no, it will have a status of NOT_BUILT.

@lppedd
Copy link

lppedd commented May 31, 2025

@zbynek I might be missing some configuration related to the GitHub integration.

image

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.

3 participants