Skip to content

Commit a2b03cd

Browse files
committed
feat(orchestrator): build extension profiles from configuration
## Summary ### Why? Which implementation of each extension a queue resolved to was hardcoded: the build runner was the fake one for every queue regardless of what was available, and the change provider was a global all-or-nothing environment gate. A deployment could not run one queue against a real provider next to one running entirely on fakes, which is what a stack serving both a test environment and a live repository needs. ### What? `PROFILES_CONFIG_PATH` names a YAML file selecting the change provider, build runner, and conflict analyzer per queue. Each extension is independently optional, so a queue that differs only in its analyzer says only that. `kind` is an open string rather than a closed schema, so supporting a new provider is a new value and an implementation behind it, not a change to the file's shape. The file holds no secret: each integration names the environment variable carrying its credential. With no config file the built-in example topology applies, reproducing the previous behavior exactly — including the per-queue analyzers the E2E suite depends on, and a routing change provider that still falls back to the fake when no token is set. That is what keeps the existing suite meaningful as a regression gate. Extensions are reused across queues configured alike. This is load-bearing for the build runner: the build and buildsignal controllers look it up separately and the fake holds a build's outcome in memory, so two instances would lose the result between triggering a build and polling it. ## Test Plan ✅ `bazel test //service/submitqueue/orchestrator/server:go_default_test` — pins the built-in topology against what the E2E suite expects, covers per-extension inheritance, provider defaults, every validation rejection, that queues configured alike share one build runner, that each queue's analyzer behaves as configured, and that a missing token fails at startup rather than mid-merge. # Conflicts: # service/submitqueue/orchestrator/server/main.go # Conflicts: # service/submitqueue/orchestrator/server/main.go # service/submitqueue/orchestrator/server/profiles.go
1 parent ed99818 commit a2b03cd

5 files changed

Lines changed: 1288 additions & 204 deletions

File tree

service/submitqueue/orchestrator/server/BUILD.bazel

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
load("@rules_go//go:def.bzl", "go_binary", "go_cross_binary", "go_library")
1+
load("@rules_go//go:def.bzl", "go_binary", "go_cross_binary", "go_library", "go_test")
22

33
exports_files(
44
["docker-compose.yml"],
@@ -8,6 +8,7 @@ exports_files(
88
go_library(
99
name = "orchestrator_lib",
1010
srcs = [
11+
"config.go",
1112
"main.go",
1213
"profiles.go",
1314
],
@@ -17,6 +18,8 @@ go_library(
1718
"//api/submitqueue/orchestrator/protopb:go_default_library",
1819
"//platform/errs/generic:go_default_library",
1920
"//platform/errs/mysql:go_default_library",
21+
"//platform/extension/buildrunner/buildkite:go_default_library",
22+
"//platform/extension/buildrunner/githubactions:go_default_library",
2023
"//platform/extension/consumergate:go_default_library",
2124
"//platform/extension/consumergate/file:go_default_library",
2225
"//platform/extension/consumergate/noop:go_default_library",
@@ -28,7 +31,9 @@ go_library(
2831
"//submitqueue/core/changeset:go_default_library",
2932
"//submitqueue/entity:go_default_library",
3033
"//submitqueue/extension/buildrunner:go_default_library",
34+
"//submitqueue/extension/buildrunner/buildkite:go_default_library",
3135
"//submitqueue/extension/buildrunner/fake:go_default_library",
36+
"//submitqueue/extension/buildrunner/githubactions:go_default_library",
3237
"//submitqueue/extension/changeprovider:go_default_library",
3338
"//submitqueue/extension/changeprovider/fake:go_default_library",
3439
"//submitqueue/extension/changeprovider/github:go_default_library",
@@ -53,6 +58,7 @@ go_library(
5358
"//submitqueue/orchestrator:go_default_library",
5459
"@com_github_go_sql_driver_mysql//:go_default_library",
5560
"@com_github_uber_go_tally//:go_default_library",
61+
"@in_gopkg_yaml_v3//:go_default_library",
5662
"@org_golang_google_grpc//:go_default_library",
5763
"@org_golang_google_grpc//reflection:go_default_library",
5864
"@org_golang_x_oauth2//:go_default_library",
@@ -87,3 +93,17 @@ filegroup(
8793
],
8894
visibility = ["//test:__subpackages__"],
8995
)
96+
97+
go_test(
98+
name = "go_default_test",
99+
srcs = ["config_test.go"],
100+
embed = [":orchestrator_lib"], # keep
101+
deps = [
102+
"//submitqueue/entity:go_default_library",
103+
"//submitqueue/extension/conflict:go_default_library",
104+
"@com_github_stretchr_testify//assert:go_default_library",
105+
"@com_github_stretchr_testify//require:go_default_library",
106+
"@com_github_uber_go_tally//:go_default_library",
107+
"@org_uber_go_zap//zaptest:go_default_library",
108+
],
109+
)

0 commit comments

Comments
 (0)