Skip to content

chore(dogfood): add validation on OOM OOD parameters #16636

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

Merged
merged 1 commit into from
Feb 24, 2025

Conversation

stirby
Copy link
Collaborator

@stirby stirby commented Feb 19, 2025

You can break the build by setting N < 0 or N > 100.

Copy link
Member

@matifali matifali left a comment

Choose a reason for hiding this comment

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

This is a quick fix but shouldn't we handle this as part of the resource_monitoring?
Or by broken build you meant that it is correctly handled already we just need to make sure someone doesn't enter those out of bound values.

@dannykopping
Copy link
Contributor

This is a quick fix but shouldn't we handle this as part of the resource_monitoring? Or by broken build you meant that it is correctly handled already we just need to make sure someone doesn't enter those out of bound values.

It's handled by the provider; breaking the build in this case means hitting validation errors I would assume.

https://github.com/coder/terraform-provider-coder/blob/main/provider/agent.go#L291
https://github.com/coder/terraform-provider-coder/blob/main/provider/agent.go#L335

Side-note: it would be good to surface these validations in the FE so we don't allow form submissions with invalid data. It's quite a lift, though.

@defelmnq
Copy link
Contributor

Screenshot 2025-02-23 at 14 10 09

Yep @dannykopping - to confirm this is breaking during the build which is what I would expect. ✅

Copy link
Contributor

@defelmnq defelmnq left a comment

Choose a reason for hiding this comment

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

LGTM

@matifali
Copy link
Member

Thanks for the explanation, @dannykopping and @defelmnq.

@stirby stirby merged commit 10326b4 into main Feb 24, 2025
30 checks passed
@stirby stirby deleted the dogfood-notification-tweak branch February 24, 2025 17:03
@github-actions github-actions bot locked and limited conversation to collaborators Feb 24, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants