Repository navigation
[M0.3] Proto and codegen pipeline - #9
Merged
Merged
Conversation
|
The latest Buf updates on your PR. Results from workflow proto / buf (pull_request).
|
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.
Task
[M0.3] Proto and codegen pipeline. Closes #3
What changed
buf.yaml(v2, lintSTANDARD, breakingFILE) andbuf.gen.yamlwith pinned remote plugins:protocolbuffers/gov1.36.12,grpc/gov1.5.1,bufbuild/esv2.16.0. Managed mode sets the Go package prefix togithub.com/samuelmbabhazi/shipkeep/lib/gen.proto/shipkeep/agent/v1/:gateway.proto:AgentGatewayService(Enroll, RenewCertificate, Connect, ExecStream), theConnectRequest/ConnectResponseenvelopes,ActionRequestwith the 23-caseactiononeof exactly as SPEC Appendix A,ActionUpdate,StateReport,RoutingTable,PeerList,LeaseRenewal,ConfigUpdate,OperationState.actions.proto: every action of SPEC 3.3 with its fields, shared types (ContainerSpec,Mount,Resources,HealthCheckSpec,Route,Upstream,WireGuardPeer,S3Target,RegistryCredentials), the capability allow list as an enum, and typedActionResults. Secret-bearing fields (SecretEnv.value,git_token, registry password, pre-signed URLs, confirmation tokens, join token) carrydebug_redact = true.exec.proto:ExecStreamframes (open, stdin, stdout, stderr, resize, close, exit, error).lib/gen, TypeScript inpackages/proto-ts/src/gen.pnpm genregenerates (clean: true),pnpm proto:lintlints and checks formatting,pnpm proto:breakingcompares againstmain.lib/agentproto:ActionKinds()andActionKind(req)derived from the descriptor;packages/proto-tsexportsACTION_KINDSandactionKind(). Both have tests asserting the catalogue is exactly the 23 actions of the SPEC, so a contract change cannot slip in unnoticed.bufis provided by the@bufbuild/bufnpm package so local and CI versions match; thegenerated-codejob runspnpm gen,pnpm proto:lintand fails on drift.proto.ymlruns buf lint and format on proto changes and the breaking check againstmain, skipped only whilemainhas no proto files (this PR).go.work, threego.mod,.tool-versions, docs): grpc-go v1.85 requires it.**/src/gen/**from every project config; lefthook prints only failures and a summary.Why
The proto is the single source of truth between control plane and agent (ADR 0001, 0002). Every later task in M1 and M2 builds on these messages.
How it was tested
buf lint,buf format -d --exit-code: clean.pnpm genthengit status: no drift after regeneration.pnpm nx run-many -t lint typecheck test build: 25 tasks succeeded, including the new proto-ts tests.go test -race ./agent/... ./cli/... ./lib/...: pass, includinglib/agentproto.golangci-lint runin each module: 0 issues (generated code excluded).actionlint: clean.Security considerations
Defines the closed action list (CLAUDE.md, rule 2). No generic exec, shell or file-write action exists. Secret fields are marked
debug_redactso protobuf text formatters redact them; the agent still must useSecretwrappers (rule 8) when it handles them in M1. Any later change toActionRequestrequires an ADR or SPEC update and thesecurity-reviewlabel.Checklist
docs/PLAN.mdare met and the task is tickedbuf lintpass