Hello,
I am experiencing issues on some builds because the environment variable CIRCLE_PULL_REQUEST(S) are not being set.
The builds are being triggered by commits to the branch where the changes are being accumulated (not the target branch of the PR). I am using Github.
I have a bash script checking specifically for this environment variable and executing custom logic based on it.
if [[ ! -z $CIRCLE_PULL_REQUEST ]]; then
# execute ui tests
fi
The logic is pretty trivial and basically executes UI tests or not, based on the presence of the variable.
Today, I had to manually rebuild a job 5 times for the environment variable to be set in the container.
We have been experimenting a little bit more with more builds, and apparently, triggering the build manually with the “Rebuild” button on the top right does set the correct PR environment variables.
Sometimes CIRCLE_PULL_REQUEST environment variable are set.
I do not know the reproduction condition.
Two containers are executed in parallel by CircleCI Workflow, but this happens frequently in containers using alpine images.
Thanks for checking and getting back to us. Our engineers are still looking into this, and we’ve been able to reproduce it inconsistently. Our working theory right now is that this is a race condition between two Github hooks, one for a push and one for a PR commit. We’ve been able to reproduce this using a commit from the Github PR web UI, so it’s not a simple matter of “create a PR then push to it”.
For now, rebuilding is the only suggestion I have while our engineers look into this further.
We’re also seeing it. Since the “Only build pull requests” is locked to the default branch on git we rely on this env var to reimplement this feature as we have more than one release branch where we need to run builds on all commits.
We can at the same time not run builds on commits on branches that isn’t a PR yet.
If this can’t be resolved we’ll be forced to switch to another CI provider
The product should generally perform better with executing jobs around the moment a pull request is created, because a lot of QA work should be done at that moment.
I’ve seen issues mentioning this very often, but no one from the team mentioned how the direction for that feature will be.