Danger: Running multiple dangers seems to only care about the last

Created on 19 Sep 2016  路  9Comments  路  Source: danger/danger

Report

What did you do?

  • Ran multiple dangers for a PR on a CI machine.
  • I have two danger files, one that's executed before fastlane, another one after.
  • Danger are executed with different danger_id

    What did you expect to happen?

See comment about violations and the PR should be stopped (danger is required)

What happened instead?

Saw comment about danger violation but was able to merge pr anyway.
The violation was in the first execution, the second didn't have any violations.

Your Environment

  • Which CI are you running on?
    Jenkins 2.7.2
  • Are you running the latest version of Danger?
    No. 3.2.1

Most helpful comment

Closed by #571 馃帀

All 9 comments

The GitHub API allows to associate multiple status to a given commit. In order to do so you have to specify a different "context" for each status.

Danger always submit the status with the same context. Therefore the last execution will determine the final status of the commit.

I think it would be nice if we could pass the context as arguments to the CLI interface or use the danger_id as the context of the status.

I am using danger in similar way, running it multiple times during the build pipeline lifecycle.

  • Quick validate if the PR is good (#loc changes, changelog updated or not?, )
  • Publish test results
  • Upload artifacts to external server once the build finishes

Can confirm that's the current behavior. What we do is to make Jenkins publish the status by itself as well (and we basically ignore the Danger one, using it only for the comment).

I think it would be rather neat to use danger_id as context name, it makes the most sense.

This is where we set the context: https://github.com/danger/danger/blob/master/lib/danger/request_sources/github.rb#L169

This would be a fist contribution, would you like to create a PR? 馃挴

Was just writing that I would! 馃槃

Hi guys.
I was investigating the same issue before find this page, just submitted a PR #571.

It should allow users to distinguish the status from different danger execution based on the context and danger_id.

Hope you don't mind @fwal that I PR your issue. If you are working on a PR by yourself I won't mind if we closes mine and merges yours.

@thiagofelix nah, go ahead! The important thing is that it gets done 馃槂

Closed by #571 馃帀

I never even noticed this issue - great work all

Was this page helpful?
0 / 5 - 0 ratings