Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2f86507c52 | ||
|
|
9b61d0cb16 | ||
|
|
8afd65a9a4 | ||
|
|
c516f79c15 | ||
|
|
a08fe65027 | ||
|
|
f28b793cec | ||
|
|
93b0188826 | ||
|
|
9b643d9a48 | ||
|
|
3a165d6633 | ||
|
|
6cde453e04 | ||
|
|
c790721f47 | ||
|
|
e0ad32ea0f | ||
|
|
c6131bc111 | ||
|
|
9c4813e9b8 |
@@ -1,79 +0,0 @@
|
||||
name: ci
|
||||
|
||||
on:
|
||||
push:
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
buf:
|
||||
runs-on: docker
|
||||
container:
|
||||
image: bufbuild/buf:latest
|
||||
steps:
|
||||
# actions/checkout@v4 is a JS action — it needs `node` inside the job's
|
||||
# container to run, but bufbuild/buf has no Node.js. Plain git clone has
|
||||
# no such dependency and works in any image.
|
||||
#
|
||||
# The runner's own homelab CA isn't trusted by this container's
|
||||
# default CA bundle, so https clone fails cert verification — install
|
||||
# the CA before cloning.
|
||||
- name: trust homelab CA
|
||||
env:
|
||||
HOMELAB_CA_CERT: ${{ secrets.HOMELAB_CA_CERT }}
|
||||
run: |
|
||||
mkdir -p /usr/local/share/ca-certificates
|
||||
echo "$HOMELAB_CA_CERT" > /usr/local/share/ca-certificates/homelab-ca.crt
|
||||
update-ca-certificates
|
||||
|
||||
- name: checkout
|
||||
env:
|
||||
GIT_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
git clone "https://x-access-token:${GIT_TOKEN}@${GITHUB_SERVER_URL#https://}/${GITHUB_REPOSITORY}.git" .
|
||||
git checkout "${GITHUB_SHA}"
|
||||
|
||||
- name: buf lint
|
||||
run: buf lint
|
||||
|
||||
- name: buf breaking (against main)
|
||||
run: buf breaking --against '.git#branch=main'
|
||||
if: github.ref != 'refs/heads/main'
|
||||
|
||||
codegen-check:
|
||||
runs-on: docker
|
||||
container:
|
||||
image: golang:1.25
|
||||
steps:
|
||||
# Same reason as the buf job: golang:1.25 has no Node.js, so the JS
|
||||
# action actions/checkout@v4 can't run here — plain git clone instead.
|
||||
- name: trust homelab CA
|
||||
env:
|
||||
HOMELAB_CA_CERT: ${{ secrets.HOMELAB_CA_CERT }}
|
||||
run: |
|
||||
mkdir -p /usr/local/share/ca-certificates
|
||||
echo "$HOMELAB_CA_CERT" > /usr/local/share/ca-certificates/homelab-ca.crt
|
||||
apt-get update -qq && apt-get install -y -qq ca-certificates >/dev/null
|
||||
update-ca-certificates
|
||||
|
||||
- name: checkout
|
||||
env:
|
||||
GIT_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
git clone "https://x-access-token:${GIT_TOKEN}@${GITHUB_SERVER_URL#https://}/${GITHUB_REPOSITORY}.git" .
|
||||
git checkout "${GITHUB_SHA}"
|
||||
|
||||
- name: Install buf and protoc plugins
|
||||
run: |
|
||||
go install github.com/bufbuild/buf/cmd/buf@latest
|
||||
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
|
||||
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
|
||||
go install github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway@latest
|
||||
|
||||
- name: Regenerate and diff
|
||||
run: |
|
||||
export PATH="$PATH:$(go env GOPATH)/bin"
|
||||
buf generate
|
||||
git diff --exit-code -- gen || (echo "::error::gen/ is out of date — run buf generate and commit the result" && exit 1)
|
||||
|
||||
- name: go build
|
||||
run: go build ./...
|
||||
@@ -0,0 +1,62 @@
|
||||
# Path is .gitea/workflows/, not .forgejo/workflows/ -- verified live on this
|
||||
# Forgejo instance (forgejo.riotpiao.com) that a .forgejo/workflows/*.yaml
|
||||
# file never creates an action_run row on push, for any repo. This CI has
|
||||
# never once executed until this move.
|
||||
name: ci
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
buf:
|
||||
runs-on: golang
|
||||
container:
|
||||
image: bufbuild/buf:latest
|
||||
steps:
|
||||
# Manual git clone (no actions/checkout@v4 since bufbuild/buf has no node.js).
|
||||
# Use forgejo.riotpiao.com directly + REGISTRY_PAT for auth.
|
||||
- name: checkout
|
||||
env:
|
||||
REGISTRY_PAT: ${{ secrets.REGISTRY_PAT }}
|
||||
run: |
|
||||
git clone "https://oauth2:${REGISTRY_PAT}@forgejo.riotpiao.com/rock/kmsvc-proto.git" .
|
||||
git checkout "${{ github.sha }}"
|
||||
|
||||
- name: buf lint
|
||||
run: buf lint
|
||||
|
||||
- name: buf breaking (against main)
|
||||
run: buf breaking --against '.git#branch=main'
|
||||
if: github.ref != 'refs/heads/main'
|
||||
|
||||
codegen-check:
|
||||
runs-on: golang
|
||||
container:
|
||||
image: golang:1.26
|
||||
steps:
|
||||
# Manual git clone (no actions/checkout@v4 since golang:1.26 has no node.js).
|
||||
# Use forgejo.riotpiao.com directly + REGISTRY_PAT for auth.
|
||||
- name: checkout
|
||||
env:
|
||||
REGISTRY_PAT: ${{ secrets.REGISTRY_PAT }}
|
||||
run: |
|
||||
git clone "https://oauth2:${REGISTRY_PAT}@forgejo.riotpiao.com/rock/kmsvc-proto.git" .
|
||||
git checkout "${{ github.sha }}"
|
||||
|
||||
- name: Install buf and protoc plugins
|
||||
run: |
|
||||
go install github.com/bufbuild/buf/cmd/buf@latest
|
||||
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
|
||||
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
|
||||
go install github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway@latest
|
||||
|
||||
- name: Regenerate and diff
|
||||
run: |
|
||||
export PATH="$PATH:$(go env GOPATH)/bin"
|
||||
buf generate
|
||||
git diff --exit-code -- gen || (echo "::error::gen/ is out of date — run buf generate and commit the result" && exit 1)
|
||||
|
||||
- name: go build
|
||||
run: go build ./...
|
||||
@@ -28,3 +28,7 @@ git add -A && git commit -m "..." && git tag vX.Y.Z && git push --tags
|
||||
CI (`buf-lint-and-breaking`) gates lint + breaking-change checks. CI (`codegen-check`) re-runs `buf generate` and fails if `gen/` doesn't match what's committed — never hand-edit `gen/`.
|
||||
|
||||
See `PLAN.md` for the full rollout plan (tagging convention, server/SDK/CLI migration).
|
||||
# Final test - clean cache removal
|
||||
# Test kmsvc-proto with Forgejo URLs
|
||||
# Test after proto regen
|
||||
# Final CI validation - Forgejo ready
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.36.11
|
||||
// protoc-gen-go v1.36.12
|
||||
// protoc (unknown)
|
||||
// source: kafkamgmt/v1/queue_service.proto
|
||||
|
||||
|
||||
@@ -44,9 +44,6 @@ func request_QueueService_SendMessage_0(ctx context.Context, marshaler runtime.M
|
||||
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
if req.Body != nil {
|
||||
_, _ = io.Copy(io.Discard, req.Body)
|
||||
}
|
||||
val, ok := pathParams["queue_name"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "queue_name")
|
||||
@@ -55,6 +52,9 @@ func request_QueueService_SendMessage_0(ctx context.Context, marshaler runtime.M
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "queue_name", err)
|
||||
}
|
||||
if req.Body != nil {
|
||||
_, _ = io.Copy(io.Discard, req.Body)
|
||||
}
|
||||
msg, err := client.SendMessage(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||
return msg, metadata, err
|
||||
}
|
||||
@@ -89,9 +89,6 @@ func request_QueueService_SendMessageBatch_0(ctx context.Context, marshaler runt
|
||||
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
if req.Body != nil {
|
||||
_, _ = io.Copy(io.Discard, req.Body)
|
||||
}
|
||||
val, ok := pathParams["queue_name"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "queue_name")
|
||||
@@ -100,6 +97,9 @@ func request_QueueService_SendMessageBatch_0(ctx context.Context, marshaler runt
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "queue_name", err)
|
||||
}
|
||||
if req.Body != nil {
|
||||
_, _ = io.Copy(io.Discard, req.Body)
|
||||
}
|
||||
msg, err := client.SendMessageBatch(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||
return msg, metadata, err
|
||||
}
|
||||
@@ -133,9 +133,6 @@ func request_QueueService_ReceiveMessage_0(ctx context.Context, marshaler runtim
|
||||
metadata runtime.ServerMetadata
|
||||
err error
|
||||
)
|
||||
if req.Body != nil {
|
||||
_, _ = io.Copy(io.Discard, req.Body)
|
||||
}
|
||||
val, ok := pathParams["queue_name"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "queue_name")
|
||||
@@ -150,6 +147,9 @@ func request_QueueService_ReceiveMessage_0(ctx context.Context, marshaler runtim
|
||||
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_QueueService_ReceiveMessage_0); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
if req.Body != nil {
|
||||
_, _ = io.Copy(io.Discard, req.Body)
|
||||
}
|
||||
msg, err := client.ReceiveMessage(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||
return msg, metadata, err
|
||||
}
|
||||
@@ -184,9 +184,6 @@ func request_QueueService_DeleteMessage_0(ctx context.Context, marshaler runtime
|
||||
metadata runtime.ServerMetadata
|
||||
err error
|
||||
)
|
||||
if req.Body != nil {
|
||||
_, _ = io.Copy(io.Discard, req.Body)
|
||||
}
|
||||
val, ok := pathParams["queue_name"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "queue_name")
|
||||
@@ -203,6 +200,9 @@ func request_QueueService_DeleteMessage_0(ctx context.Context, marshaler runtime
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "receipt_handle", err)
|
||||
}
|
||||
if req.Body != nil {
|
||||
_, _ = io.Copy(io.Discard, req.Body)
|
||||
}
|
||||
msg, err := client.DeleteMessage(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||
return msg, metadata, err
|
||||
}
|
||||
@@ -242,9 +242,6 @@ func request_QueueService_DeleteMessageBatch_0(ctx context.Context, marshaler ru
|
||||
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
if req.Body != nil {
|
||||
_, _ = io.Copy(io.Discard, req.Body)
|
||||
}
|
||||
val, ok := pathParams["queue_name"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "queue_name")
|
||||
@@ -253,6 +250,9 @@ func request_QueueService_DeleteMessageBatch_0(ctx context.Context, marshaler ru
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "queue_name", err)
|
||||
}
|
||||
if req.Body != nil {
|
||||
_, _ = io.Copy(io.Discard, req.Body)
|
||||
}
|
||||
msg, err := client.DeleteMessageBatch(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||
return msg, metadata, err
|
||||
}
|
||||
@@ -287,9 +287,6 @@ func request_QueueService_ChangeMessageVisibility_0(ctx context.Context, marshal
|
||||
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
if req.Body != nil {
|
||||
_, _ = io.Copy(io.Discard, req.Body)
|
||||
}
|
||||
val, ok := pathParams["queue_name"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "queue_name")
|
||||
@@ -306,6 +303,9 @@ func request_QueueService_ChangeMessageVisibility_0(ctx context.Context, marshal
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "receipt_handle", err)
|
||||
}
|
||||
if req.Body != nil {
|
||||
_, _ = io.Copy(io.Discard, req.Body)
|
||||
}
|
||||
msg, err := client.ChangeMessageVisibility(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||
return msg, metadata, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user