Skip to content

Conversation

@AndrewGable
Copy link
Contributor

@AndrewGable AndrewGable commented Jan 4, 2022

Details

Adds a check for the mergeable_state of a PR to make sure it is not BLOCKED. This is the state that a PR can get in with unverified commits, messing up the deploy process.

Fixed Issues

$ https://github.com/Expensify/Expensify/issues/190589

Tests

  1. I verified that PRs that are not able to be auto-merged if they are not in the mergeable_state of "clean", "has_hooks", "unknown", "unstable", so this will prevent auto-merge from silently failing in the BLOCKED state

QA Steps

N/A

@AndrewGable AndrewGable self-assigned this Jan 4, 2022
@AndrewGable AndrewGable changed the title Check for clean status when determining isMergeable Check for non-blocked status when determining isMergeable Jan 4, 2022
@AndrewGable AndrewGable marked this pull request as ready for review January 4, 2022 18:53
@AndrewGable AndrewGable requested a review from a team as a code owner January 4, 2022 18:53
@MelvinBot MelvinBot requested review from jasperhuangg and removed request for a team January 4, 2022 18:53
@AndrewGable AndrewGable removed the request for review from jasperhuangg January 4, 2022 19:51
mergeabilityResolved = true;
isMergeable = data.mergeable;
console.log(`Merge information for #${pullRequestNumber} - mergeable: ${data.mergeable}, mergeable_state ${data.mergeable_state}`);
isMergeable = data.mergeable && data.mergeable_state !== 'BLOCKED';
Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like in the images the value is lowercase, should we uppercase the data.mergeable_state value to ensure the comparison is exact?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated with @roryabraham's suggestion which should handle this

roryabraham
roryabraham previously approved these changes Jan 4, 2022
Co-authored-by: Rory Abraham <47436092+roryabraham@users.noreply.github.com>
AndrewGable and others added 3 commits January 4, 2022 15:07
Co-authored-by: Rory Abraham <47436092+roryabraham@users.noreply.github.com>
Copy link
Contributor

@roryabraham roryabraham left a comment

Choose a reason for hiding this comment

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

Code changes look good, but I think we might need to update the unit tests now

@AndrewGable
Copy link
Contributor Author

Sorry looks like a jest test failed, looking into it now.

@AndrewGable
Copy link
Contributor Author

Jest tests should be passing now, just waiting on E2E for the ✅

@roryabraham roryabraham merged commit 9f3dc92 into main Jan 4, 2022
@roryabraham roryabraham deleted the andrew-mergeable branch January 4, 2022 23:05
@OSBotify
Copy link
Contributor

OSBotify commented Jan 4, 2022

✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release.

@OSBotify
Copy link
Contributor

OSBotify commented Jan 6, 2022

🚀 Deployed to staging by @roryabraham in version: 1.1.25-2 🚀

platform result
🤖 android 🤖 success ✅
🖥 desktop 🖥 success ✅
🍎 iOS 🍎 success ✅
🕸 web 🕸 success ✅

@OSBotify
Copy link
Contributor

🚀 Deployed to production by @Jag96 in version: 1.1.26-1 🚀

platform result
🤖 android 🤖 success ✅
🖥 desktop 🖥 success ✅
🍎 iOS 🍎 success ✅
🕸 web 🕸 success ✅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants