-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Preview Envs on Harvester: Delete when inactive #10379
Conversation
212010d
to
4f148e8
Compare
Object.entries(result).forEach(([key]) => logLine+=` ${key}:${result[key]},`); | ||
logLine = logLine.slice(0, -1); | ||
|
||
werft.log(sliceID, `${previewEnvironment.name} (${previewEnvironment.namespace}) - is-active=${isActive} ${logLine}`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a fan of logging here, but it does make things cleaner
6327cb2
to
db7a143
Compare
8dc2474
to
1d0d1d9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for working on this, and I agree that removing the double negative is a nice improvement. I have left a few suggestions for improvements, but they can be done in a follow up PR if you prefer (I have added the hold label, so you can just remove it if you want to merge this and open a new PR).
This does not solve all of #9891 yet though, as currently we'd still delete the preview environment if e.g. the branch was missing or stale (it was mentioned as a comment on the issue). For that you'd need to modify the logic for previewsToDelete
213815b
to
4c6227a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One tiny boolean that I think you have to flip, but otherwise, LGTM
4c6227a
to
86864d9
Compare
Description
is-inactive
->is-active
, as double negatives make for a confusing experience (CHECKING_FOR_NO_DB_ACTIVITY, isInactive = false = actually active env, etc)Related Issue(s)
Fixes #9891
How to test
Following is a
platform-delete-preview-environments
job (no preview environments were harmed, as all are returned as active on that run)https://werft.gitpod-dev.com/job/gitpod-custom-aa-del-harvester.28
Release Notes