Danger: Allow CIs to request more details about an existing PR

Created on 30 May 2016  Â·  9Comments  Â·  Source: danger/danger

CIs run against an arbitrary commit, of all the CI servers I've worked with only one will trigger a new build specifically on the creation of a PR, travis.

screen shot 2016-05-30 at 16 13 07

In Travis you're guaranteed to have all the right ENV vars setup but only on that /pr build, the /push one is a _maybe_.

For example, Circle. A build is triggered from a commit push, then later it becomes connected to the PR, so you get builds like this: https://circleci.com/gh/artsy/eigen/2632

Which shows the PR connect on the right:
screen shot 2016-05-30 at 16 21 12

where it does't make the ENV vars correct
screen shot 2016-05-30 at 16 22 55

This makes Danger not check
screen shot 2016-05-30 at 16 24 58


Ideally there should be a way to look up, at runtime vs at CI build setup time to pull out the head/base commits.

You Can Do This

Most helpful comment

screen shot 2016-07-26 at 12 10 38 pm

https://circleci.com/changelog/

might be fixed with this

All 9 comments

screen shot 2016-07-26 at 12 10 38 pm

https://circleci.com/changelog/

might be fixed with this

@orta Is it fixed by that? I have an associated PR, and no Danger comment?

Turns out, there are a few bugs on Circle's side:

screen shot 2016-08-26 at 3 09 37 pm

@orta 😞 😢 I'm sure you've looked, but is there nothing that gets returned from the Circle API (assuming that is how you are hooking into Circle, I haven't read the code for Danger yet, just tried to get setup today) that would allow Danger to integrate and run?

There's a few workarounds inside Danger ( Circle is definitely our most complicated CI service because of this - https://github.com/danger/danger/search?q=circle&type=Issues&utf8=✓) which uses their API - you can give that a shot - docs are in the circle section of danger.systems.

I am also seeing something that seems related to this on Jenkins when using the "Github Pull Request Builder" Plugin along with the "Github Folder" plugin

I did something like this for GitLab to fake MR environment (because our Jenkins builder is not exposed to the Internet and GitLab instance cannot communicate with it).

Basically, it tries to fetch MR json by branch name.

I can share/contribute if needed.

Was this page helpful?
0 / 5 - 0 ratings