Skip to content

Dangerfile exits early if build failed#14400

Merged
bvaughn merged 4 commits into
facebook:masterfrom
bvaughn:da-da-dangerfile
Dec 7, 2018
Merged

Dangerfile exits early if build failed#14400
bvaughn merged 4 commits into
facebook:masterfrom
bvaughn:da-da-dangerfile

Conversation

@bvaughn
Copy link
Copy Markdown
Contributor

@bvaughn bvaughn commented Dec 6, 2018

No description provided.

@sophiebits
Copy link
Copy Markdown
Collaborator

Does this mean if danger succeeds then you push an update and break the build, the old comment sticks around?

@bvaughn
Copy link
Copy Markdown
Contributor Author

bvaughn commented Dec 6, 2018

Does this mean if danger succeeds then you push an update and break the build, the old comment sticks around?

I think the comment is only added/removed if output is logged. Given that we only log output if (a) the results JSON file is missing or (b) the size delta of a package is larger than some threshold– I think the danger comment will be added/updated/removed in the right cases.

@bvaughn
Copy link
Copy Markdown
Contributor Author

bvaughn commented Dec 6, 2018

Given the current changes, if a build fails in the scenario you describe, @sophiebits, this comment will replace the previous one:
screen shot 2018-12-06 at 2 17 16 pm

If I just process.exit(0) without logging anything, I think the danger comment would just be removed (or not added to begin with). Which is preferable?

I guess maybe the latter, since you'd get a failed CI build at that point.

@sophiebits
Copy link
Copy Markdown
Collaborator

sophiebits commented Dec 6, 2018

I think showing the message is preferable. It's harder to get misled that way.

@bvaughn
Copy link
Copy Markdown
Contributor Author

bvaughn commented Dec 6, 2018

Seems redundant, since there will also be an update from CI in that case:
screen shot 2018-12-06 at 2 22 12 pm

In either case, the stale/invalid results stats would be removed.

@bvaughn
Copy link
Copy Markdown
Contributor Author

bvaughn commented Dec 6, 2018

I think it's better for the danger comment to be removed if the build fails. I think the red CI ❌ is enough feedback for that case.

Unless anyone objects, I think the behavior this PR currently exhibits is okay.

Copy link
Copy Markdown
Contributor

@trueadm trueadm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is much better than what we have now. Thanks for doing this @bvaughn!

@sophiebits
Copy link
Copy Markdown
Collaborator

ok, cool!

@bvaughn
Copy link
Copy Markdown
Contributor Author

bvaughn commented Dec 7, 2018

No problem 😄

@bvaughn bvaughn merged commit f64906f into facebook:master Dec 7, 2018
@bvaughn bvaughn deleted the da-da-dangerfile branch December 7, 2018 17:06
jetoneza pushed a commit to jetoneza/react that referenced this pull request Jan 23, 2019
* Dangerfile exits early (without leaving an error comment) if build failed
n8schloss pushed a commit to n8schloss/react that referenced this pull request Jan 31, 2019
* Dangerfile exits early (without leaving an error comment) if build failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants