Skip to content

Create GH Action to reliably determine mergeability#1847

Merged
roryabraham merged 7 commits into
masterfrom
Rory-ReliableMergeability
Mar 17, 2021
Merged

Create GH Action to reliably determine mergeability#1847
roryabraham merged 7 commits into
masterfrom
Rory-ReliableMergeability

Conversation

@roryabraham

Copy link
Copy Markdown
Contributor

Details

When getting ready to automerge a PR, we want to first make sure that it's mergeable. However, Github uses a background job to calculate mergeability... from the GH docs:

The value of the mergeable attribute can be true, false, or null. If the value is null, then GitHub has started a background job to compute the mergeability. After giving the job time to complete, resubmit the request. When the job finishes, you will see a non-null value for the mergeable attribute in the response. If mergeable is true, then merge_commit_sha will be the SHA of the test merge commit

So we can't rely on the boolean result of the mergeable attribute to be readily available. This PR creates a custom Github Action to continually poll mergeability of a PR until the result is non-null, and output the end result.

Fixed Issues

Fixes failed workflow run: https://github.com/Expensify/Expensify.cash/runs/2133374703?check_suite_focus=true

Tests

Added automated tests for the new JS action.

Need to test it's usage in the workflow by merging this PR.

@roryabraham roryabraham self-assigned this Mar 17, 2021
@roryabraham roryabraham requested a review from a team as a code owner March 17, 2021 21:10
@botify botify requested review from jasperhuangg and removed request for a team March 17, 2021 21:10
Comment thread .github/libs/promiseWhile.js Outdated
Comment thread .github/actions/isPullRequestMergeable/isPullRequestMergeable.js
@roryabraham roryabraham requested a review from AndrewGable March 17, 2021 22:28
@roryabraham roryabraham merged commit 13fb5fd into master Mar 17, 2021
@roryabraham roryabraham deleted the Rory-ReliableMergeability branch March 17, 2021 23:47
@github-actions github-actions Bot locked and limited conversation to collaborators Mar 17, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants