feat(runs): apply settings to the run spec at run creation - #7961
Open
davidlin20dev wants to merge 3 commits into
Open
feat(runs): apply settings to the run spec at run creation#7961davidlin20dev wants to merge 3 commits into
davidlin20dev wants to merge 3 commits into
Conversation
AdilFayyaz
reviewed
Sep 3, 2026
| // applied below. Org is empty when the caller passed a ProjectId rather than a | ||
| // RunId; the storage key encoder normalizes that to the default org. | ||
| resolved, err := resolveSettings(ctx, s.settingsRepo, &settings.SettingsKey{ | ||
| Org: runId.GetOrg(), |
Contributor
There was a problem hiding this comment.
The OSS decision was to not support orgs, ( #7157 removed it from every table and service, and the backend is meant to ignore it). The settings key shouldnt take org from the request. The SDK derives an org from the endpoint hostname, so a named run can look up v1:<host>:: and miss the row scheduled runs hit.
Maybe EncodeSettingsKey can ignore org, so settings are stored and looked up under the same key no matter what the client sends
Contributor
Author
There was a problem hiding this comment.
Makes sense, thanks for the review! Unnamed runs drop the org as well, so the fix covers that path too. I'll make EncodeSettingsKey ignore org in a separate PR and remove the org note from this one.
AdilFayyaz
previously approved these changes
Sep 4, 2026
Signed-off-by: davidlin20dev <davidlin20.dev@gmail.com>
Signed-off-by: davidlin20dev <davidlin20.dev@gmail.com>
Signed-off-by: davidlin20dev <davidlin20.dev@gmail.com>
davidlin20dev
force-pushed
the
feat/settings-run-applier
branch
from
September 4, 2026 18:13
df1757e to
3ee332f
Compare
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 closes task 3.1. Related to #7932.
Why are the changes needed?
Settings can be stored and resolved, but nothing reads them, so a run's queue and concurrency still come only from the request or from static config. This is the first applier: it makes a stored setting change what a run actually does.
What changes were proposed in this pull request?
applyRunSettingsinruns/service/settings_apply.gofillsRunSpec.queueandRunSpec.max_action_concurrencywhen the request leaves them unset. An explicit request value always wins, and a setting that is INHERIT or UNSET contributes nothing.CreateRunresolves settings once, right after the run spec is normalized and before the static config defaults below it. A failed lookup returnsCodeInternalrather than continuing, since the settings table shares the database with runs.RunServicetakes aSettingsRepo;setup.goand the api test harness now share one instance with the settings service.How was this patch tested?
applyRunSettings: value applied, explicit request value wins, INHERIT and UNSET contribute nothing, empty settings and a nil spec are safe.TestCreateRun_AppliesSettingsQueuedrivesCreateRunwith no queue in the request and asserts the settings value is both persisted and passed to Enqueue.Labels
Check all the applicable boxes
Related PRs
Stacked on #7956. Builds on #7841, #7859, #7900, #7925, #7927 and #7937.