Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a scheduled Hatchet app cleaner workflow #1422

Merged
merged 1 commit into from
Mar 2, 2023
Merged

Conversation

edmorley
Copy link
Member

@edmorley edmorley commented Mar 2, 2023

As of Hatchet v8.x, Hatchet now:

  • Removes the apps it creates after each test runs, rather than only enabling maintenance mode. This occurs even if an individual test fails.
  • Cleans up older apps iff it runs into the app limit. (This is only done when the app limit is hit, in order to prevent hundreds of unnecessary API requests, when test concurrency is high.)

However, leftover apps can still occur in the following cases:

  • The GitHub Actions run is cancelled, or aborts in a non-clean way.
  • If a Hatchet bug (or a mis-use of Hatchet by the tests) cause Hatchet to exit non-cleanly.
  • If there is a platform incident causing the Heroku API to not be available.

Therefore, this scheduled cleanup job has been added to catch any such leftover apps. It runs daily at 6am UTC, and can also be triggered manually via the GitHub dashboard.

The cleanup job only deletes apps older than 10 minutes, so that it doesn't break any in progress CI jobs.

GUS-W-12629391.

@edmorley edmorley self-assigned this Mar 2, 2023
@edmorley edmorley marked this pull request as ready for review March 2, 2023 12:53
@edmorley edmorley requested a review from a team as a code owner March 2, 2023 12:53
As of Hatchet v8.x, Hatchet now:
- Removes the apps it creates after each test runs, rather than only
  enabling maintenance mode. This occurs even if an individual test fails.
- Cleans up older apps iff it runs into the app limit. (This is only done when
  the app limit is hit, in order to prevent hundreds of unnecessary API
  requests, when test concurrency is high.)

However, leftover apps can still occur in the following cases:
- The GitHub Actions run is cancelled, or aborts in a non-clean way.
- If a Hatchet bug (or a mis-use of Hatchet by the tests) cause Hatchet
  to exit non-cleanly.
- If there is a platform incident causing the Heroku API to not be available.

Therefore, this scheduled cleanup job has been added to catch any such
leftover apps. It runs daily at 6am UTC, and can also be triggered manually
via the GitHub dashboard.

The cleanup job only deletes apps older than 10 minutes, so that it doesn't
break any in progress CI jobs.

GUS-W-12629391.
@edmorley edmorley force-pushed the hatchet-app-cleaner branch from 125c615 to 8c00049 Compare March 2, 2023 12:56
@edmorley edmorley merged commit 1fd3e01 into main Mar 2, 2023
@edmorley edmorley deleted the hatchet-app-cleaner branch March 2, 2023 13:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants