From ff116226a7f5bce764a44a64d1e5bbcb68fd6115 Mon Sep 17 00:00:00 2001 From: Mike McNeil Date: Wed, 27 Jul 2022 01:41:57 -0500 Subject: [PATCH] Tool: Workaround for mergefreeze API (#6908) A timeboxed workaround for an intermittent issue where the mergefreeze API reports that a repo is frozen: false, when the mergefreeze UI says that it is actually truly frozen. --- website/api/controllers/webhooks/receive-from-github.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/website/api/controllers/webhooks/receive-from-github.js b/website/api/controllers/webhooks/receive-from-github.js index 284d3dc6c5..064267b3cd 100644 --- a/website/api/controllers/webhooks/receive-from-github.js +++ b/website/api/controllers/webhooks/receive-from-github.js @@ -242,7 +242,12 @@ module.exports = { // [?] https://docs.mergefreeze.com/web-api#get-freeze-status let isMainBranchFrozen = ( await sails.helpers.http.get('https://www.mergefreeze.com/api/branches/fleetdm/fleet/main', { access_token: sails.config.custom.mergeFreezeAccessToken }) //eslint-disable-line camelcase - ).frozen; + ).frozen || ( + // TODO: Remove this timeboxed hack to consider the repo frozen + // for a while as a workaround for an issue where the MergeFreeze API + // reports that the repo is not frozen, when it actually is frozen. + Date.now() < (new Date('Jul 28, 2022 14:00 UTC')).getTime() + ); // Now, if appropriate, auto-approve the change. if (isAutoApproved) {