feat(runs): validate settings on create and update - #7900
Merged
Merged
Conversation
Signed-off-by: davidlin20dev <davidlin20.dev@gmail.com>
Signed-off-by: davidlin20dev <davidlin20.dev@gmail.com>
…idators Signed-off-by: davidlin20dev <davidlin20.dev@gmail.com>
Signed-off-by: davidlin20dev <davidlin20.dev@gmail.com>
3 tasks
This was referenced Aug 27, 2026
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Tracking issue
Related to #7775. This is task 2.3 (validators).
Why are the changes needed?
The
buf.validateannotations on the settings protos are not enforced by the generated Go code, so the service currently accepts any value.task_resource.max.memorycan be stored as"apple". Nothing reads these values yet, but once the appliers land a bad value would fail deep inside a run instead of at the point someone saved it.What changes were proposed in this pull request?
Validators wired into
CreateSettingsandUpdateSettings:resource.ParseQuantity, across all eighttask_resource.{min,max}.{cpu,gpu,memory,storage}leaves; the error names the dot-pathmax_action_concurrencymust be0or between2andMaxUint32. The ceiling matchesRunSpec.max_action_concurrency, which is auint32validateSettingsKeyLeaves whose state is not
VALUEare skipped, so sparse documents stay valid.How was this patch tested?
Table tests per validator, plus rows added to the existing
TestCreateSettings_ValidationandTestUpdateSettings_Validationtables to cover the handler wiring.Check all the applicable boxes
Related PRs
Follows #7841, #7859 and #7881.