feat(gateway): land and status subcommands for the client - #547
Conversation
c97cdfb to
cc98ca9
Compare
cc98ca9 to
04c8f20
Compare
04c8f20 to
5214ae8
Compare
5214ae8 to
4866a17
Compare
4866a17 to
0c2e9cf
Compare
0c2e9cf to
c209e8d
Compare
c209e8d to
d03556b
Compare
d03556b to
5ec02f7
Compare
5ec02f7 to
193f751
Compare
193f751 to
880bd39
Compare
3eb2677 to
18a508c
Compare
18a508c to
7f35508
Compare
7f35508 to
18a508c
Compare
18a508c to
b243b1c
Compare
|
The diff includes a compiled binary Looks accidental — should be removed and probably added to |
mnoah1
left a comment
There was a problem hiding this comment.
Is the committed client (18mb) intentional here?
b243b1c to
93b88dc
Compare
Yes..let me remove it..i guess claude just sent it anyway |
## Summary ### Why? The gateway client only knew how to ping. Submitting a change meant hand-assembling protobuf with grpcurl, including a 40-character commit SHA copied out of a pull request — which is both tedious and easy to get subtly wrong. ### What? `ping | land | status` subcommands. `land` takes repeated `-uri` flags, whose order is significant: several changes in one request are a stack, applied in the order given. `-pr <url>` resolves a pull request's head commit and mints the change URI, so nobody types a SHA. It dispatches on the change URL the same way the merger and the change provider dispatch on the URI scheme, rather than assuming one provider; GitHub is implemented, and adding another is a case beside it. Reading a public repository needs no token, and a 404 without one says so rather than reporting the pull request as missing. ## Test Plan ✅ `go build ./service/submitqueue/gateway/client` and `go vet`. ✅ Manually: `land -queue q` reports the missing-change error; `land -pr https://github.com/uber/cadence/pull/1` resolved against the live GitHub API and printed `github://github.com/cadence-workflow/cadence/pull/1/65c322d4...` before failing to dial a gateway, which is the expected end of that path with no stack running.
93b88dc to
96c8f63
Compare
`go build ./service/submitqueue/gateway/client` writes an 18MB executable named `client` into the current directory, and it was swept in from the repo root. The build here is Bazel-only, so nothing in the normal workflow should produce it. Removes the binary and ignores it as root-anchored `/client`, so the pattern cannot shadow the `client/` source packages (`submitqueue/client/`, `service/submitqueue/gateway/client/`, `service/submitqueue/orchestrator/client/`).
4a84d1e to
d39e85c
Compare
|
Removed in Cause: this PR's own test plan ran Fix: binary deleted and a No history rewrite: |
|
Follow-up in #587, stacked on this branch: adds That gives a sanctioned way to produce a standalone binary. Keeping this PR to just the removal so it stays easy to review. |
… into bin/ ## Summary ### Why? An 18MB `client` binary reached #547 and was caught only by review — nothing in CI guards against a committed binary. `go build ./service/submitqueue/gateway/client` names its output after the package directory and writes it to the *current* directory, so run from the repo root it drops a `client` there, where a broad `git add` sweeps it up. Every `service/*/server` package produces a root `server` the same way. The obvious fix — ignoring `/client` — is the wrong one. It would stop the file being committed but equally stop git mentioning it at all, so the mistake becomes invisible and the artifact quietly accumulates. It is also name-specific: it covers 8 of the 12 `main` packages and none of the other binaries anyone might add. Worse, an ignored path is never tracked, so it would hide the offender from the check below rather than complement it. ### What? `tool/linter/binaryfile` fails when any tracked file is binary. It follows the existing `licenseheader` / `messageid` / `queueshard` pattern and is wired in as `make lint-binary`, so `make lint` and the CI gate already cover it. Detection is git's own heuristic — a NUL byte in the leading 8000 bytes. The repository has no tracked binaries today, so the check starts clean and the allowlist is empty. `make build-submitqueue-gateway-client` and `make build-submitqueue-gateway-server` build with Bazel for the host platform into `bin/client` and `bin/server`, giving a sanctioned way to produce a standalone binary. `bin/` was already ignored but had no producer — the only reference to it anywhere in the Makefile, `tool/`, or `.github/` was `rm -rf bin/` in `clean`. No `.gitignore` change is needed: `bazel-bin/`, `bin/`, and `.docker-bin/` already cover every Bazel output, and the whole point of the linter is to surface a stray binary rather than hide it. ## Test Plan ✅ `bazel test //tool/linter/binaryfile:go_default_test` passes. ✅ `make lint-binary` on a clean tree reports `All 884 tracked files are text.` ✅ Reproduced #547 end to end: `go build ./service/submitqueue/gateway/client` from the repo root drops a 17,539,170-byte `client`; `git status` shows it as `?? client` rather than hiding it; after `git add client` the linter fails, naming the file and its size and pointing at Bazel. ✅ Both build targets produce Mach-O arm64 executables at `bin/client` and `bin/server`, are idempotent over Bazel's read-only output, and leave `git status` clean. ✅ `make gazelle` generates the linter's BUILD.bazel with no further drift, and `make help` lists all three new targets.
Summary
Why?
The gateway client only knew how to ping. Submitting a change meant hand-assembling protobuf with grpcurl, including a 40-character commit SHA copied out of a pull request — which is both tedious and easy to get subtly wrong.
What?
ping | land | statussubcommands.landtakes repeated-uriflags, whose order is significant: several changes in one request are a stack, applied in the order given.-pr <url>resolves a pull request's head commit and mints the change URI, so nobody types a SHA. It dispatches on the change URL the same way the merger and the change provider dispatch on the URI scheme, rather than assuming one provider; GitHub is implemented, and adding another is a case beside it. Reading a public repository needs no token, and a 404 without one says so rather than reporting the pull request as missing.Test Plan
✅
go build ./service/submitqueue/gateway/clientandgo vet.✅ Manually:
land -queue qreports the missing-change error;land -pr https://github.com/uber/cadence/pull/1resolved against the live GitHub API and printedgithub://github.com/uber/cadence/pull/1/65c322d4...before failing to dial a gateway, which is the expected end of that path with no stack running.Issues