diff --git a/website/api/controllers/webhooks/receive-from-github.js b/website/api/controllers/webhooks/receive-from-github.js index beda298f54..5693b4bfc6 100644 --- a/website/api/controllers/webhooks/receive-from-github.js +++ b/website/api/controllers/webhooks/receive-from-github.js @@ -277,27 +277,31 @@ module.exports = { }, baseHeaders); } - // And also unfreeze and re-freeze to temporarily allow merging. - // [?] https://github.com/fleetdm/fleet/issues/5179 - if (isAutoApproved) { + // Temporarily disable re-freeze logic to troubleshoot website caching issues on 2022-05-03. + // (very unlikely this is a culprit, but ruling out race conditions) + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +// // And also unfreeze and re-freeze to temporarily allow merging. +// // [?] https://github.com/fleetdm/fleet/issues/5179 +// if (isAutoApproved) { - let mergeFreezeReport = await sails.helpers.http.get('https://www.mergefreeze.com/api/branches/fleetdm/fleet/main', { access_token: sails.config.custom.mergeFreezeAccessToken });//eslint-disable-line camelcase - if (mergeFreezeReport.frozen) { - await sails.helpers.http.post('https://www.mergefreeze.com/api/branches/fleetdm/fleet/main', { frozen: false, access_token: sails.config.custom.mergeFreezeAccessToken, user_name: 'fleet-release' });//eslint-disable-line camelcase +// let mergeFreezeReport = await sails.helpers.http.get('https://www.mergefreeze.com/api/branches/fleetdm/fleet/main', { access_token: sails.config.custom.mergeFreezeAccessToken });//eslint-disable-line camelcase +// if (mergeFreezeReport.frozen) { +// await sails.helpers.http.post('https://www.mergefreeze.com/api/branches/fleetdm/fleet/main', { frozen: false, access_token: sails.config.custom.mergeFreezeAccessToken, user_name: 'fleet-release' });//eslint-disable-line camelcase - // Then, in the background, 2 minutes later... - setTimeout(()=>{ - sails.helpers.http.post('https://www.mergefreeze.com/api/branches/fleetdm/fleet/main', { frozen: true, access_token: sails.config.custom.mergeFreezeAccessToken, user_name: 'fleet-release' })//eslint-disable-line camelcase - .exec((err)=>{ - if (err) { - sails.log.error('Background instruction failed: Unexpected error re-freezing repo (see https://github.com/fleetdm/fleet/issues/5179 for background):', err); - } - sails.log.info('Re-freeze completed successfully.'); - });//_∏_ - }, 2*60*1000);//_∏_ - }//fi +// // Then, in the background, 2 minutes later... +// setTimeout(()=>{ +// sails.helpers.http.post('https://www.mergefreeze.com/api/branches/fleetdm/fleet/main', { frozen: true, access_token: sails.config.custom.mergeFreezeAccessToken, user_name: 'fleet-release' })//eslint-disable-line camelcase +// .exec((err)=>{ +// if (err) { +// sails.log.error('Background instruction failed: Unexpected error re-freezing repo (see https://github.com/fleetdm/fleet/issues/5179 for background):', err); +// } +// sails.log.info('Re-freeze completed successfully.'); +// });//_∏_ +// }, 2*60*1000);//_∏_ +// }//fi - }//fi +// }//fi + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - } } else if (ghNoun === 'issue_comment' && ['created'].includes(action) && (issueOrPr&&issueOrPr.state === 'open')) {