Skip to content

Commit a40cb70

Browse files
authored
[#68]: feature: v5
2 parents 616a209 + a780eeb commit a40cb70

127 files changed

Lines changed: 1350 additions & 87306 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: 'Trigger api-go Update'
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
workflow_dispatch:
8+
inputs:
9+
branch:
10+
description: "Branch in api-go repo to trigger update protos (default: master)"
11+
required: true
12+
default: master
13+
14+
jobs:
15+
notify:
16+
name: 'Trigger api-go update'
17+
runs-on: ubuntu-latest
18+
defaults:
19+
run:
20+
shell: bash
21+
steps:
22+
- name: Generate token
23+
id: generate_token
24+
uses: actions/create-github-app-token@v1
25+
with:
26+
app-id: ${{ secrets.RR_CICD_APP_ID }}
27+
private-key: ${{ secrets.RR_CICD_PRIVATE_KEY }}
28+
owner: ${{ github.repository_owner }}
29+
repositories: api-go
30+
31+
- name: Dispatch api-go Github Action
32+
env:
33+
GH_TOKEN: ${{ steps.generate_token.outputs.token }}
34+
EVENT_PUSH_BRANCH: ${{ github.event.ref }}
35+
EVENT_PUSH_COMMIT_AUTHOR: ${{ github.event.head_commit.author.name }}
36+
EVENT_PUSH_COMMIT_AUTHOR_EMAIL: ${{ github.event.head_commit.author.email }}
37+
EVENT_PUSH_COMMIT_MESSAGE: ${{ github.event.head_commit.message }}
38+
EVENT_WF_DISPATCH_BRANCH: ${{ github.event.inputs.branch }}
39+
run: |
40+
case "${{ github.event_name }}" in
41+
"push")
42+
BRANCH="${EVENT_PUSH_BRANCH#refs/heads/}"
43+
COMMIT_AUTHOR="${EVENT_PUSH_COMMIT_AUTHOR}"
44+
COMMIT_AUTHOR_EMAIL="${EVENT_PUSH_COMMIT_AUTHOR_EMAIL}"
45+
COMMIT_MESSAGE="${EVENT_PUSH_COMMIT_MESSAGE}"
46+
;;
47+
"workflow_dispatch")
48+
BRANCH="${EVENT_WF_DISPATCH_BRANCH}"
49+
COMMIT_AUTHOR="RoadRunner Bot"
50+
COMMIT_AUTHOR_EMAIL="bot@roadrunner.dev"
51+
COMMIT_MESSAGE="Update proto"
52+
;;
53+
esac
54+
55+
gh workflow run update-proto.yml \
56+
-R roadrunner-server/api-go \
57+
-r master \
58+
-f branch="${BRANCH}" \
59+
-f commit_author="${COMMIT_AUTHOR}" \
60+
-f commit_author_email="${COMMIT_AUTHOR_EMAIL}" \
61+
-f commit_message="${COMMIT_MESSAGE}"

README.md

Lines changed: 46 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,29 +16,65 @@
1616

1717
# RoadRunner API
1818

19-
To install and use generated packages:
19+
This repository contains the **Protocol Buffer definitions** for [RoadRunner](https://roadrunner.dev). These protos are used for external integrations (RPC) and internal communications between RoadRunner plugins.
20+
21+
Generated Go code lives in a separate repository: [`roadrunner-server/api-go`](https://github.com/roadrunner-server/api-go).
22+
23+
## Repository structure
24+
25+
```
26+
roadrunner/api/ — RoadRunner proto definitions (jobs, kv, http, status, etc.)
27+
third_party/api/ — Temporal API submodule (used as a proto dependency)
28+
buf.yaml — Buf module configuration
29+
buf.gen.yaml — Buf code generation configuration
30+
```
31+
32+
## Using generated Go packages
33+
34+
Install a package from the [`api-go`](https://github.com/roadrunner-server/api-go) repository:
2035
```bash
21-
go get github.com/roadrunner-server/api/v4/build/<API_NAME>/v1
36+
go get github.com/roadrunner-server/api-go/v5/build/<module>/<version>
2237
```
2338

24-
The Proto API is used for external integrations, mostly for RPC or as internal communications. For example:
39+
Example usage:
2540
```go
2641
package foo
2742

2843
import (
29-
jobsv1 "github.com/roadrunner-server/api/v4/build/jobs/v1"
44+
jobsv1 "github.com/roadrunner-server/api-go/v5/build/jobs/v1"
3045
)
3146

3247
func Push(in *jobsv1.PushRequest, out *jobsv1.Empty) error {
3348
return nil
3449
}
3550
```
3651

37-
# Centrifugal API
38-
- [API](https://github.com/centrifugal/centrifugo/blob/master/internal/apiproto/api.proto)
39-
- [Proxy](https://github.com/centrifugal/centrifugo/blob/master/internal/proxyproto/proxy.proto)
52+
## Auto-generation
53+
54+
Pushing to `master` in this repo triggers a GitHub Actions workflow in [`api-go`](https://github.com/roadrunner-server/api-go) that:
55+
1. Pulls the latest proto definitions via a git submodule.
56+
2. Runs `buf generate` to produce Go code.
57+
3. Commits and pushes the result.
58+
59+
You do not need to run code generation manually — CI handles it automatically.
4060

41-
# Building API
61+
## Local development
4262

43-
- Install buf: `go install github.com/bufbuild/buf/cmd/buf@latest`.
44-
- In the repository root run: `buf generate --debug`
63+
Install [Buf](https://buf.build/docs/installation):
64+
```bash
65+
go install github.com/bufbuild/buf/cmd/buf@latest
66+
```
67+
68+
Lint proto files:
69+
```bash
70+
buf lint
71+
```
72+
73+
Generate code locally (output goes to `build/`):
74+
```bash
75+
buf generate
76+
```
77+
78+
## Centrifugal API
79+
- [API](https://github.com/centrifugal/centrifugo/blob/master/internal/apiproto/api.proto)
80+
- [Proxy](https://github.com/centrifugal/centrifugo/blob/master/internal/proxyproto/proxy.proto)

buf.yaml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
version: v2
22
modules:
3-
- path: proto
3+
- path: roadrunner/api
44
- path: third_party/api
55
lint:
66
disallow_comment_ignores: true
77
ignore:
8-
# This is a third-party API, so we ignore them for linters.
98
- third_party/api
10-
- proto/centrifugo/api
11-
- proto/centrifugo/proxy
9+
- roadrunner/api/centrifugo/api
10+
- roadrunner/api/centrifugo/proxy

build/applogger/v1/applogger.pb.go

Lines changed: 0 additions & 227 deletions
This file was deleted.

0 commit comments

Comments
 (0)