Expensify / App

Welcome to New Expensify: a complete re-imagination of financial collaboration, centered around chat. Help us build the next generation of Expensify by sharing feedback and contributing to the code.
https://new.expensify.com
MIT License
3.51k stars 2.86k forks source link

Broken prod release/Upwork automation #49963

Closed roryabraham closed 3 weeks ago

roryabraham commented 1 month ago

slack: https://expensify.slack.com/archives/C01GTK53T8Q/p1727737595030879

Problem

The automation for App production deploy which sets the HOLD for Payment on issues has been failing for a while now, which leads to contributors not getting paid on time because of obvious delays - and most of the times, in order to get paid, C / C+ have to post a comment on the issue to let the assigned BZ / CME know that automation failed and payment due on [x] date.

Pretty sure this was broken when we changed the staging deploy trigger to be release instead of a pushed tag.

Solution

Fix it!

roryabraham commented 1 month ago

methinks I have a fix: https://github.com/Expensify/Web-Expensify/pull/43753

roryabraham commented 4 weeks ago

Looks like my fix didn't work. Logs.

Github webhook comment on external issue ~~ repo: 'App' currentReleaseFromWebhook: '9.0.42-3' currentReleaseFromAPI: '9.0.42-3' previousRelease: '9.0.42-2' ...

But given the latest release of 9.0.42-3, the previousRelease should have been the previous release that was not a prerelease, 9.0.41-10. Not 9.0.42-2 which was clearly a prerelease.

But what I find very confounding is that I replayed it all in psysh:

use Expensify\Libs\Github\API as Github_API;
use Expensify\Libs\ArrayUtils;
$github = new Github_API(EXPENSIFY_GITHUB_APP_PRIVATE_KEY, Github_API::REPO_OWNER, 'App');
$currentReleaseTag = '9.0.42-3';
$releases = $github->listReleases();
$previousRelease = ArrayUtils::find($releases, fn (array $release) => $release['tag_name'] !== $currentReleaseTag && !$release['prerelease']);
$previousReleaseTag = $previousRelease['tag_name'];

and it all worked as expected?!?!

image

No idea what to make of this

roryabraham commented 4 weeks ago

Likely explanation here

roryabraham commented 3 weeks ago

This is confirmed fixed ✅