Skip to content

Commit adbb3b8

Browse files
authored
feat: add orchestrator pipeline, TopicRegistry, and CI improvements (#59)
## Summary - **TopicRegistry**: Centralizes queue topic configuration, decoupling controllers from subscription details. Controllers declare their topic and consumer group; the registry provides the queue and subscription config. - **Orchestrator pipeline**: Adds request controller with publisher for forwarding messages to the next pipeline stage (request → batch → speculation → build → merge). - **Consumer refactor**: Accepts `TopicRegistry` instead of raw `queue.Queue` + subscriber name. Removes `SubscriptionConfig()` from the `Controller` interface. - **Server startup simplification**: Removes retry loops from gateway and orchestrator servers — relies on Docker Compose healthchecks (`--wait`) to ensure dependencies are ready before services start. - **CI caching fix**: Caches `bazel-disk-cache` and `bazel-repo-cache` (matching `.bazelrc` paths) with per-job keys to avoid concurrent save races. Previous setup cached the wrong directory and all jobs raced on a single key. - **Auto-tail container logs**: Streams Docker container logs to stderr in real-time during integration/e2e tests via `ComposeStack.tailLogs()`. Removes the now-redundant `.github/actions/logs` action. - **Test output streaming**: All test targets use `--test_output=streamed` for real-time output in both local and CI runs. - **Documentation consolidation**: Merges `PROJECT_STRUCTURE.md` into `CLAUDE.md`, updates `TESTING.md` for new ComposeStack behavior. ## Test plan - [x] `make build` passes - [x] `make test` passes - [x] `make gazelle` produces no changes - [x] CI integration and e2e tests pass - [x] Verify container logs stream to stderr during test runs - [x] Verify CI Bazel cache saves per-job and restores on subsequent runs - First Run: https://github.com/uber/submitqueue/actions/runs/22336834292/job/64632139444?pr=59 (~10m) - Second Run: https://github.com/uber/submitqueue/actions/runs/22337340518/job/64633633575?pr=59 (1m24s)
1 parent 8ec2c45 commit adbb3b8

39 files changed

Lines changed: 1498 additions & 1224 deletions

File tree

.bazelrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
common --disk_cache=~/.cache/bazel-disk-cache
2+
common --repository_cache=~/.cache/bazel-repo-cache

.github/actions/logs/action.yml

Lines changed: 0 additions & 19 deletions
This file was deleted.
Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: Run Bazel Test
2-
description: Run Bazel test and show logs on failure
2+
description: Run a Bazel test target
33

44
inputs:
55
target:
@@ -11,7 +11,4 @@ runs:
1111
steps:
1212
- name: Run Bazel test
1313
shell: bash
14-
run: ./tool/bazel test ${{ inputs.target }} --test_output=errors
15-
16-
- uses: ./.github/actions/logs
17-
if: always()
14+
run: ./tool/bazel test ${{ inputs.target }} --test_output=streamed

.github/actions/setup/action.yml

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
name: Setup
2-
description: Setup Bazel cache for CI jobs
2+
description: Setup Bazel caches for CI jobs
3+
4+
# Caches three directories that match the paths configured in .bazelrc:
5+
# - disk-cache: compiled build outputs (biggest speedup — avoids recompilation)
6+
# - repo-cache: downloaded external dependencies (avoids re-downloading Go modules, protobuf, etc.)
7+
# - bazelisk: the Bazel binary itself
8+
#
9+
# Cache key includes github.job so each CI job saves its own cache entry
10+
# (otherwise concurrent jobs race on the same key and only one wins).
11+
# github.run_id ensures the key never matches exactly, forcing actions/cache
12+
# to always save — so the disk cache accumulates entries across runs.
13+
# The restore-keys fallback restores from the most recent prior run of the
14+
# same job (preferred), then same deps, then any.
315

416
runs:
517
using: composite
@@ -8,8 +20,11 @@ runs:
820
uses: actions/cache@v4
921
with:
1022
path: |
11-
~/.cache/bazel
23+
~/.cache/bazel-disk-cache
24+
~/.cache/bazel-repo-cache
1225
~/.cache/bazelisk
13-
key: bazel-${{ runner.os }}-${{ hashFiles('MODULE.bazel', 'go.mod', '.bazelversion') }}
26+
key: bazel-${{ runner.os }}-${{ github.job }}-${{ hashFiles('MODULE.bazel', 'go.mod', 'go.sum', '.bazelversion', '.bazelrc') }}-${{ github.run_id }}
1427
restore-keys: |
28+
bazel-${{ runner.os }}-${{ github.job }}-${{ hashFiles('MODULE.bazel', 'go.mod', 'go.sum', '.bazelversion', '.bazelrc') }}-
29+
bazel-${{ runner.os }}-${{ github.job }}-
1530
bazel-${{ runner.os }}-

.github/workflows/ci.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,6 @@ jobs:
5959
- name: Run E2E tests
6060
run: make e2e-test
6161

62-
- uses: ./.github/actions/logs
63-
6462
gateway-integration-test:
6563
name: Gateway Integration Test
6664
runs-on: ubuntu-latest
@@ -71,8 +69,6 @@ jobs:
7169
- name: Run Gateway integration tests
7270
run: make integration-test-gateway
7371

74-
- uses: ./.github/actions/logs
75-
7672
orchestrator-integration-test:
7773
name: Orchestrator Integration Test
7874
runs-on: ubuntu-latest
@@ -83,8 +79,6 @@ jobs:
8379
- name: Run Orchestrator integration tests
8480
run: make integration-test-orchestrator
8581

86-
- uses: ./.github/actions/logs
87-
8882
# ---------------------------------------------------------------------------
8983
# EXTENSION TESTS
9084
# ---------------------------------------------------------------------------

0 commit comments

Comments
 (0)