> I've tried using the 'stage' step, but this will actually abort waiting
builds if newer builds enter the queue. That's to avoid successive builds
from the same branch, but here I want all builds to run, just in sequence.
Right, ‘stage’ is intended for the use case where a newer build would
supersede the earlier.
> Workflow jobs don't appear to have the option to limit concurrency
through the UI as far as I can tell.
No, not currently. One could be added, I think fairly easily. I initially
omitted such an option intentionally, so that ‘stage’ would be used for
this. There are probably some legitimate use cases for it though.
An alternative would be a different block step that controls concurrency
without aborting. This would be more flexible than a job option, because
you can limit the throttling to just the necessary part of the build: in
your case, the local testing could presumably be run in parallel.
Or, ‘stage’ could be given an option to throttle concurrency in the way you
require: a simple “fair” latch, where the first build enters immediately,
and subsequent builds just wait until it is done, entering in the order
they started waiting.
You could probably even use ‘stage’ as is: use a _computed_ stage name,
based on the branch name or PR number being tested. This might really be
what you want. Consider someone who files a PR with one commit. The build
starts up and gets into the integration tests on the staging server. Then
they push another commit to the PR, triggering a new build; and then in
short succession a third. Then the integration tests from the first commit
fail (because there was really a mistake that the tests caught, corrected
later). The ideal behavior (perhaps) is that the second build is canceled,
and the third runs instead. That is what
stage "ITs for PR #${number}"
should do, without blocking or canceling builds of unrelated PRs. (If this
indeed works for you, it would be great to have a pull request
strengthening StageStepTest to prove it.)
--
You received this message because you are subscribed to the Google Groups
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/jenkinsci-users/f7f0f44a-4d6a-43f5-9d06-64686eb5cf6a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.