-
Notifications
You must be signed in to change notification settings - Fork 49.8k
Calculate build sizes relative to merge base #11883
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
sophiebits
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we handle the case where there is no build for a particular SHA? One case this could happen is if someone pushes two commits to master at once and there's no build for the first one, but your PR is based off the first one. Probably uncommon but we should at least handle the error gracefully.
Either by doing nothing or trying to go back and try some previous commits.
|
Hmm, we don't want the merge base with master here. This fails because we force check out PR commit as master on CI (and thus its merge base with master is that commit itself). We want the branch that the PR was sent against. |
|
maybe CIRCLE_COMPARE_URL? |
|
Seems like that's just a URL so we'd have to parse it. Also not sure what this means:
Aren't all builds triggered by pushes? (I guess this just means it's PR-only) |
|
Yeah, PR vs push. |
|
Even CIRCLE_COMPARE_URL isn't helpful 😞 |
|
Looks like @orta also bumped into this. danger/danger#45 |
|
Yeah, Circle can be real tricky to gather this kind of information - in Danger Ruby we use the Circle API to grab the PR and then use that to pull out the metadata like base/head. |
|
One thing worth noting - if we still aren't doing builds for docs, the merge base might be a commit that we don't have a build for. Otherwise, I made it possible to jump straight to the commit without needing to look at the commit time. Just /builds/branch/_commits/SHA eg: http://react.zpao.com/builds/master/_commits/247c5241706356033cd5bf1dc31197e058853e13/ |
|
Closing since this is broken. |
|
Yep - that's what it does, uses the PR's base sha 👍 ( sorry for that lack of updates to the PR, I got distracted today for my OSS time with prettier prettier/prettier#3669 ) |
See #11882 (comment).