Issue #18734 duplicate
This was originally from service request: BBS-106694. The rep handling that request suggested that I file this here.
--- Original issue:
This may be an "as expected" race condition, but is still annoying/distracting. The rough steps to reproduce are: 1. Have a default pipelines configuration that catches all branches. 2. Have a PR on some branch X that triggers this default pipeline. 3. Push some final changes to branch X. This triggers a pipeline execution (as expected). 4. Before the pipeline in step 3 actually starts, merge the PR with "delete branch X" selected. This is the race condition. 5. Note that the pipeline in step 3 errors out with something like "fatal: Remote branch X not found in upstream origin" Possible resolutions: 1. Cancel any pipelines running on branch X when branch X is deleted. This would still probably have a race condition if the cancel doesn't happen before the error is triggered. 2. Don't let users merge and delete branch X while there are pipelines for branch X still running / scheduled. 3. Queue the merge to happen later after all the pending pipelines have (successfully?) completed.