Pull requests not triggering build

There are really a lot of cases when user needs to trigger additional new build once PR was opened.

In our CI case environment is changing when user opened PR against different target branches.
Eg. environment differs depending on v1.3 in this case:

armab wants to merge 1 commit into v1.3 from feature/branching

You can’t know that ^^ v1.3 for PRs with 1 commit, because CircleCI reuses status from previous build, once you open PR.

Without this feature we have this case:

  • User opened PR and got OK green status
  • PR is merged and errored, because env is different

^^ BTW Travis has this option.

2 Likes

I also would love to see this feature. Building on a push is great, but I also want to build on the merge commit that GitHub creates for every pull request (i.e. the head of the pr/<pull_request_id>/merge branch that GitHub creates). I understand it results in more load on CircleCI’s servers, but it seems important to test the actual result of merging a pull request, and not just the commit itself (which might be tens or hundreds of commits behind the target branch). There’s a real risk that even without merge conflicts, the tests may pass for the commit but fail once it is merged.

Additionally, I need this functionality in order to support a downstream build system I’ve pieced together using CircleCI’s experimental build parameters on their API. Without it, the process will only work if another push is made to the PR after it is opened.

It looks like this functionality has also been requested in several other threads:

https://discuss.circleci.com/t/show-test-results-for-prospective-merge-of-a-github-pr/1662

Also related:

https://discuss.circleci.com/t/feature-request-option-to-disable-builds-on-commit-pushes/682

4 Likes

Any updates on this? Triggering builds on PR mades within a repo (not only coming from forked ones) is a very useful feature, specially when it comes to private repositories.

5 Likes

I’ll chime in also asking if there are any updates or plans to support this.

Bump. Anything Circle team? I switched over from travis because Circle is much more friendly with iOS work, but without this feature I may need to switch back.

Any update on this ?

From CircleCI.com/changelog/ there’s this:

Only PR builds

We have added functionality to only run builds when a pull request is open. To enable this functionality you can navigate to “Advanced Settings” for your project and enable the “Only build pull requests” option.

This will still build your default branch, which typically is master. Does this sound like a proper solution to this issue in this thread?

1 Like

Hey Feliciano,

Thanks for the update.
Having some issues with the workflow.

I have enabled the Build on PRs feature, and enabled status check on PRs in github.
What happens is PR never triggers builds, and report status always stays greyed out on github.

Any suggestions?

thanks.

@FelicianoTech:

No, this doesnt solve the issue. Please have a look at your competitor Travis to get an idea of how to do it right.

This is a basic functionality of a paid CI engine and is a deal breaker for most of us.

2 Likes

Is there a way for circle to trigger a build on the branch specified by pull_request[“head”][“ref”] via https://developer.github.com/v3/activity/events/types/#pullrequestevent? If Circle can do that, and pass this along to my test script (maybe through ENV) I think this would be a good workaround since I can write the logic myself in the script to exit 0 immediately if its not a pullrequestevent.

+1, seems enabled, but not obvious, pr build are sporadic, sometimes they work sometimes nothing, not always updating pr status like Travis does on GitHub

+1, gonna have to switch back to travis because of this, but I’ll keep my eyes peeled.

@FelicianoTech I’m curious why the option to “only build prs” and not “build prs as well as merges” This is the only thing preventing me from trying that option.

1 Like

+1 We really need this feature, since commits are often made on feature branch before the PR is open. And we need it to run a specific build for that PR for QA purposes

The “Only build pull request” is not what we want

Hi, our product team triages new features from the Feature Requests category here on Discuss. If the workarounds in this thread don’t deliver what you need, then I’d look through the feature request topic to see if someone has already requested this, and “heart” the post to show your support. If you can find one, then you can create one.

I found a few similar ones here:

oh thanks man. this did help me a lot :smiley:

It seems like an old thread. Could someone pls confirm if CircleCI can trigger a build on GitHub Pull Request Creation (from a branch in the same GitHub repository or from the Fork GitHub repository).

Per "Advanced Settings"
Build forked pull requests
Run builds for pull requests from forks. CircleCI will automatically update the commit status shown on GitHub’s pull request page.

Unless I am missing something, it appears this functionality is not working, i.e. I created a Pull Requests from a Fork, however, CircleCI did not trigger a build.

Thank you.

We need this feature too.
Would it be possible to define multiple “default branches” in config.yml file?

+1 for this, shocking this feature isn’t available. What a joke.