refactor(proto): move protos to top-level api/ tree by domain/service#258
Merged
Conversation
This was referenced Jun 17, 2026
behinddwalls
added a commit
that referenced
this pull request
Jun 17, 2026
## Summary
Move the cross-domain shared trees out of the repo root into a single
`platform/` umbrella. Domain-scoped trees (`submitqueue/`, `stovepipe/`,
`runway/`) keep their own `core/`, `entity/`, `extension/`.
| From | To |
|------|----|
| `core/{errs,metrics,consumer}` | `platform/{errs,metrics,consumer}` |
| `core/httpclient` | `platform/http` |
| `entity/*` (`change`, `mergestrategy`, `messagequeue`) |
`platform/base/*` |
| `extension/*` (`counter`, `messagequeue`) | `platform/extension/*` |
Details:
- `platform/http`: package renamed `httpclient` -> `http`; `net/http`
aliased as `nethttp` inside the package; callers that also import
`net/http` use a `phttp` alias.
- `platform/base`: root doc package renamed `entity` -> `base`; `change`
/ `mergestrategy` / `messagequeue` preserved as subpackages.
- Rewrites all Go import paths and Bazel labels; updates `Makefile`
schema/admin paths and `go:generate` roots.
- Docs refreshed to the `platform/` layout (`CLAUDE.md`, package
READMEs, RFCs), documenting current state only.
> Stacked on #256 (hermetic Go SDK). Review/merge that first.
## Test plan
- [x] `make gazelle` clean (BUILD files in sync)
- [x] `make build` — 201 targets build (hermetic)
- [x] `make test` — 54/54 unit tests pass
Made with [Cursor](https://cursor.com)
## Test Plan
## Issues
## Stack
1. @ #257
1. #258
1. #259
1. #260
---------
Co-authored-by: Cursor <cursoragent@cursor.com>
sbalabanov
approved these changes
Jun 17, 2026
This was referenced Jun 17, 2026
Relocate each service's proto/ and protopb/ dirs under api/{domain}/{service}/,
updating go_package, Bazel importpaths, gazelle resolve hints, consumer deps,
and all Go imports to .../api/{domain}/{service}/protopb.
Generalize the tool/proto codegen rule and the `make proto` copy loop to
support multiple .proto files per service package, so messagequeue payload
contracts can later be added alongside each service's RPC contract under the
same api/{domain}/{service}/proto dir.
Co-authored-by: Cursor <cursoragent@cursor.com>
84bbb33 to
d6ecbf8
Compare
behinddwalls
added a commit
that referenced
this pull request
Jun 17, 2026
## Summary ### Why? The "Rebase Stacked PRs" job silently no-ops when the repo's "Automatically delete head branches" setting is on. On merge, GitHub deletes the merged head branch, which auto-retargets every child PR's base from the merged head branch to the merged base (e.g. main) *before* the job runs. The job discovers children via `gh pr list --base <merged-head>`, which then returns nothing — so it rebases nothing, force-pushes nothing, and still reports success. Run #257 (and #256 before it) did exactly this, leaving the downstream stack (#258/#259/#260) with doubled diffs that had to be rebased by hand. The fix is to keep "Automatically delete head branches" off (now done at the repo level) and let this workflow own head-branch cleanup. With the setting off, GitHub leaves child bases untouched, the lookup finds them, and the job rebases the stack and then deletes the merged branch itself — for both stacked and non-stacked PRs. ### What? - Document the hard requirement that "Automatically delete head branches" stays off, with the retarget-race rationale, in the workflow header. - Log a clear line when a merge has no child PRs instead of returning silently. - Clarify the branch-deletion step: it runs on every merged PR (stacked or not) and is skipped only when a child rebase failed; fix the misleading "All stacked PRs rebased successfully" message that printed even on no-op runs. No behavior change on the happy path — the job already deleted the merged branch on success; this makes the intent explicit and the logs legible. ## Test Plan - ✅ `python3 -c "import yaml; yaml.safe_load(open('.github/workflows/rebase-stack.yml'))"` — YAML parses. - Confirmed `delete_branch_on_merge` is `false` via `gh api repos/uber/submitqueue`. - Post-merge: the next Rebase Stack run should log child rebases or "No open child PRs … nothing to rebase", then "Deleting merged branch …" and actually remove it. Co-authored-by: Cursor <cursoragent@cursor.com>
behinddwalls
added a commit
that referenced
this pull request
Jun 17, 2026
## Summary ### Why? The "Rebase Stacked PRs" job was silently no-opping: with the repo's "Automatically delete head branches" setting on, GitHub deleted the merged head branch on merge, which auto-retargeted every child PR's base from the merged head branch to the merged base (e.g. `main`) *before* the job ran. Its child lookup (`gh pr list --base <merged-head>`) then found nothing, so it rebased nothing and still went green. Run #257 (and #256 before it) did exactly this, leaving #258/#259/#260 with doubled diffs that had to be rebased by hand. The repo setting is now off, making this workflow the sole owner of head-branch cleanup. But that exposed a second gap: the job only deleted the merged branch at the end of its own run. When a child rebase conflicts, the run intentionally keeps the merged branch (the child still bases on it) and never fires again — so after the author manually rebases and retargets the child, nothing ever deletes the orphaned merged branch. ### What? - Document the hard requirement that "Automatically delete head branches" stays **off**, with the retarget-race rationale, in the workflow header. - Replace the outcome-gated single-branch delete with an invariant-based sweep, `cleanup_orphaned_merged_branches`, that runs on every invocation: for each recently merged PR whose head branch still exists, delete it **iff** no open PR references it as a base or head. This: - deletes the just-merged branch on a clean run (children retargeted away), - **keeps** it when an immediate child rebase failed (that child still bases on it — deleting it would retarget the child to `main` and recreate the broken diff), - reaps branches stranded by an earlier conflicted run on the next merge, once their children were manually fixed. - Branch existence is snapshotted in one `git ls-remote`; the merged base (e.g. `main`) is never touched. Conflicted runs also emit a `::warning::` for visibility while still exiting non-fatally, and no-stack merges log a clear line. ## Test Plan - ✅ `yaml.safe_load` parses the workflow. - ✅ `bash -n` on the extracted `run:` script. - ✅ Simulated the sweep loop with mock data (dedup, skip-gone, skip-base, consider-delete all behave correctly). - Post-merge: the next Rebase Stack run should log child rebases (or "No open child PRs … nothing to rebase"), then a sweep that deletes the merged branch when nothing depends on it. --------- Co-authored-by: Cursor <cursoragent@cursor.com>
behinddwalls
added a commit
that referenced
this pull request
Jun 17, 2026
…ion (#262) ## Summary ### Why? Stovepipe verifies commits that are already on trunk (post-merge/post-submit build and test), but its gateway only exposed Ping. It needs an intake RPC, analogous to SubmitQueue's Land, where a client hands in a trunk commit and gets back a tracking id while verification runs asynchronously. ### What? Adds the `Ingest` RPC to the Stovepipe gateway proto contract (proto-only; controller and server wiring follow separately): - `IngestRequest{ queue, change }` and `IngestResponse{ spid }`, where `spid` is the "stovepipe id" handle for tracking the request lifecycle (mirroring Land's `sqid`). - `change` reuses the shared `uber.base.change.Change` wire type from the parent PR; for git, callers pass a `git://<remote>/<repo>/<ref>/<commit_sha>` commit URI. Unlike Land there is no merge strategy, since the commit is already on trunk. ## Test Plan - ✅ `make proto` - ✅ `./tool/bazel build //...` - ✅ `make test` ## Stack 1. #258 1. #261 1. @ #262 Co-authored-by: Cursor <cursoragent@cursor.com>
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.
Summary
Stacked on top of
refactor(#257). Moves all proto wire contracts into a single top-levelapi/tree organized bydomain/service, and lays the groundwork for upcoming messagequeue payload contracts.proto/andprotopb/dirs toapi/{domain}/{service}/(history-preserving renames). New importpath:github.com/uber/submitqueue/api/{domain}/{service}/protopb.go_package, all Bazel importpaths, rootgazelle:resolvehints, consumerdeps, and all Go imports.tool/protocodegen rule (srcslist) and themake protocopy loop to support multiple.protofiles per service package, so messagequeue contracts can later live alongside each service's RPC contract under the sameapi/{domain}/{service}/proto/dir.CLAUDE.mdproject layout / import paths / proto-gen workflow,example/README.md).The proto
packagedeclarations are intentionally left unchanged (onlygo_packagemoved) to avoid churning wire-level type names.Test plan
make buildmake test(54/54 pass)make check-gazellemake lintmake check-tidymake protoproduces zero drift vs committed stubsMade with Cursor
Stack