WordPress / gutenberg.run

Gutenberg live branch preview provisioning service
https://playground.wordpress.net/gutenberg.html.
MIT License
25 stars 6 forks source link

Gracefully handle build artifacts that don't exist yet or have expired #17

Open iandunn opened 2 years ago

iandunn commented 2 years ago

Trying to build a VM for a very new or very old PR often fails, because the build artifact doesn't exist.

That's a side-effect of fdb90ac92d83ecd1904bd21331b18d740a387707.

As for errors, one of the downsides of the new implementation is it doesn’t yet handle very well if (a) a pull request is first opened and the build hasn’t finished yet or (b) the pull request is so old that GitHub’s artifact expiration purges the zip. Basically it’s assuming a very happy path in its current state.

At the very least, we can show a descriptive error message, so the user knows to: (a) try again in a few minutes; or (b) that it's not possible to build older PRs.

In the case of expired artifacts, maybe we could additionally kick off a process to renew new, or give the user instructions for renewing them. Or maybe in those cases we could bring back the code from fdb90ac92d83ecd1904bd21331b18d740a387707. It was removed for performance reasons, but if it's only running in edge cases then it probably wouldn't be an issue. We can also just increase the host VM's CPU/RAM to handle any additional load.

dd32 commented 2 years ago

It seems that the builder throws a specific error for artifact-unavailable.

It looks like it throws Invalid pull request, you can see that by trying to boot up PR 2649, which throws INVALID rather than ERROR:

Screen Shot 2022-03-14 at 11 58 41 am