Skip to content

feat: Add instance autokill#355

Open
jedevc wants to merge 1 commit into
prod-stagingfrom
jedevc/instance-autokill
Open

feat: Add instance autokill#355
jedevc wants to merge 1 commit into
prod-stagingfrom
jedevc/instance-autokill

Conversation

@jedevc

@jedevc jedevc commented Jun 5, 2026

Copy link
Copy Markdown
Member

TODO:

  • Instances
  • Services
  • Templates

@jedevc jedevc requested a review from craciunoiuc June 5, 2026 08:15

@craciunoiuc craciunoiuc left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

some comments

assert.Regexp(t, `autokill:`, out)
assert.Regexp(t, `time:\s+10s`, out)
assert.Regexp(t, `num-requests:\s+100`, out)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can we make it auto-kill on 1 request and then do an httpget on it and check again if it dissapeared?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Hm. This feels like something for the QA team.

We test that the property can be created + edited + viewed - so the CLI is working correctly. We should avoid testing that the platform behavior is correct (as much as possible in these tests).

More complex tests make sense in some scenarios... but I think this one is a bit over-the-line. If you think otherwise, I can hack something together though.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm fine either way, but I don't think that the functionality tested is that complex 🙏

I'll let you decide

Comment thread internal/cmd/instances.go Outdated
Comment thread internal/cmd/instances.go Outdated
Signed-off-by: Justin Chadwell <[email protected]>
@jedevc jedevc force-pushed the jedevc/instance-autokill branch from bf86d2b to ee13210 Compare June 5, 2026 08:31
@jedevc jedevc requested a review from craciunoiuc June 5, 2026 08:33
Comment thread internal/cmd/instances.go

ScaleToZero InstanceScaleToZero `group:"flag-edit" shortcut:"scale-to-zero" help:"Scale-to-zero options.\n policy: on | idle | off\n cooldown-time: cooldown in ms before scaling to zero\n notify-time: notification time in ms before scaling to zero\n stateful: true | false" placeholder:"<key>=<value>" example:"on,policy=on\\,cooldown-time=300,policy=on\\,stateful=true\\,cooldown-time=500\\,notify-time=100"`

Autokill InstanceAutokill `group:"flag-edit" shortcut:"autokill" help:"Autokill options.\n time: time after the instance stops before it is deleted\n num-requests: max requests before the instance is deleted" placeholder:"<key>=<value>" example:"time=5s,num-requests=100,time=5s\\,num-requests=100"`

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
Autokill InstanceAutokill `group:"flag-edit" shortcut:"autokill" help:"Autokill options.\n time: time after the instance stops before it is deleted\n num-requests: max requests before the instance is deleted" placeholder:"<key>=<value>" example:"time=5s,num-requests=100,time=5s\\,num-requests=100"`
Autokill InstanceAutokill `group:"flag-edit" shortcut:"autokill" help:"Autokill options.\n time: time after the instance stops before it is deleted\n num-requests: max requests before the instance is deleted" placeholder:"<key>=<value>" example:"time=5s,num-requests=100\\,num-requests=100"`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants