I have a git multibranch pipeline and it´s set up with options{ disableConcurrentBuilds() }.
This is working great but it does (at least) schedule build´s for other branches if there is changes.
That´s not a problem by itself because the agent only can do one build at a time,
but the scheduled build start´s on the agent with the head of the branch it saw during scanning in the past.
What I would prefer is that there will be no scanning while a build of the multibranch pipeline is active (or scheduled).
I suppose it would also work to explicitly check out the head in the pipeline, but then the commit´s shown in the webui would likely not match what has been built. (?)
I thought this can be used as an option in the Pipeline script, but that is not the case. Or am I missing a plugin?
The test I made show´s my problem:
A job builds Branch 1
A change in main triggered a job that is waiting (Because the current job running is not of the same branch) but with a now fixed commit hash
More changes in main and Branch1 scheduled a future build that will start with the head of their branch
I am okay with the Scheduled builds that will build the latest once the job is created, I am not okay with the waiting job that will build something old.