Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: add inactivity cleanup and failure cleanup configuration fields to Template Schedule Form#7402

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Kira-Pilot merged 24 commits intomainfromworkspace-actions-template-route/kira-pilot
May 5, 2023

Conversation

Kira-Pilot
Copy link
Member

@Kira-PilotKira-Pilot commentedMay 4, 2023
edited
Loading

Resolves#7346 andresolves#7347.
#7401 will be a fast follow. Spoke with Ben - we will not be adding these fields to the new template form at the moment.

Run locally viaCODER_EXPERIMENTS='workspace_actions' ./scripts/develop.sh

Some notes:

  • I took out theworkspace_actions feature. I feel like for now, this feature can live under thecodersdk.FeatureAdvancedTemplateScheduling entitlement. It is still feature flagged separately with a new experiment (workspace_actions)
  • I am using 14 days as a default value for both "Failure Cleanup" and "Inactivity Cleanup".@bpmct does this seem reasonable? Changed to 7 and 180 respectively as per Ben's comment.

Demo
Loom Link

Auditing works, too:
Screenshot 2023-05-03 at 5 33 14 PM

@bpmct
Copy link
Member

bpmct commentedMay 4, 2023
edited
Loading

I am using 14 days as a default value for both "Failure Cleanup" and "Inactivity Cleanup".@bpmct does this seem reasonable?

Let's set "7 days" as a default for failure cleanup when enabled. And "180 days" for inactivity cleanup. It's pretty arbitrary, but here's my thinking:

  • A developer who hasn't used their workspace for 6 months definitely doesn't need it anymore, unless it's for a project they rarely touch. However, there are many workspaces I go 2 weeks without using if its not my primary project.
  • 7 days before stopping failed workspaces gives the operator time to hop in the logs and troubleshoot if needed.

And an admin can always tweak these, but I'd rather default to something more conservative and allow the admin to add more aggressive settings. After all, its disabled by default.

Kira-Pilot reacted with thumbs up emoji

Copy link
Collaborator

@BrunoQuaresmaBrunoQuaresma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

The FE code looks good to me

Kira-Pilot reacted with hooray emoji
}, nil
}

func (*enterpriseTemplateScheduleStore) SetTemplateScheduleOptions(ctx context.Context, db database.Store, tpl database.Template, opts schedule.TemplateScheduleOptions) (database.Template, error) {
if int64(opts.DefaultTTL) == tpl.DefaultTTL &&
int64(opts.MaxTTL) == tpl.MaxTTL &&
int64(opts.FailureTTL) == tpl.FailureTTL &&
int64(opts.InactivityTTL) == tpl.InactivityTTL &&
Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

@deansheather I see us making what looks like a duplicate check in thepatchTemplateMetahandler - curious why we need to check at all (I don't see us doing this in other routes) and also why we need to check twice, once in the handler and once in the store.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

You're right this does seem unnecessary and can probably be removed from the handlers and just kept in the store. Make sure the AGPL version of the store has the equivalent check though (but only for the AGPL-permitted fields)!

Kira-Pilot reacted with thumbs up emoji
Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Great, will handle that in a follow-up!

Copy link
Member

@deansheatherdeansheather left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

BE looks good, I'm glad you could use of the TemplateScheduleStore interface for this

Kira-Pilot reacted with hooray emoji
}, nil
}

func (*enterpriseTemplateScheduleStore) SetTemplateScheduleOptions(ctx context.Context, db database.Store, tpl database.Template, opts schedule.TemplateScheduleOptions) (database.Template, error) {
if int64(opts.DefaultTTL) == tpl.DefaultTTL &&
int64(opts.MaxTTL) == tpl.MaxTTL &&
int64(opts.FailureTTL) == tpl.FailureTTL &&
int64(opts.InactivityTTL) == tpl.InactivityTTL &&
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

You're right this does seem unnecessary and can probably be removed from the handlers and just kept in the store. Make sure the AGPL version of the store has the equivalent check though (but only for the AGPL-permitted fields)!

Kira-Pilot reacted with thumbs up emoji
Kira-Pilotand others added2 commitsMay 5, 2023 07:19
…wn.sqlCo-authored-by: Dean Sheather <dean@deansheather.com>
….sqlCo-authored-by: Dean Sheather <dean@deansheather.com>
@Kira-PilotKira-Pilot merged commit5ffa6da intomainMay 5, 2023
@Kira-PilotKira-Pilot deleted the workspace-actions-template-route/kira-pilot branchMay 5, 2023 15:19
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsMay 5, 2023
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@BrunoQuaresmaBrunoQuaresmaBrunoQuaresma approved these changes

@deansheatherdeansheatherdeansheather approved these changes

@sreyasreyaAwaiting requested review from sreya

@bpmctbpmctAwaiting requested review from bpmct

Assignees

@Kira-PilotKira-Pilot

Labels
None yet
Projects
None yet
4 participants
@Kira-Pilot@bpmct@BrunoQuaresma@deansheather

[8]ページ先頭

©2009-2025 Movatter.jp