-
Notifications
You must be signed in to change notification settings - Fork 14
96 lines (81 loc) · 3.5 KB
/
Copy pathproto-sync.yml
File metadata and controls
96 lines (81 loc) · 3.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
name: Proto sync (zeebe gateway.proto)
# Weekly job that fetches the latest upstream gateway.proto from
# camunda/camunda at the ref pinned in .zeebe-proto-version, regenerates
# any auto-emittable additive surface (Class 1-3 RPCs and new wire-type
# interfaces), and opens a pull request when there is drift.
#
# If the upstream ref has introduced a new Class 4 RPC (bespoke shaping
# required: nested *Request, file-bytes, real oneofs, or per-element
# variables), the emitter exits with code 3 and this workflow fails so a
# maintainer is alerted to design the facade by hand.
on:
schedule:
# Mondays at 04:00 UTC.
- cron: '0 4 * * 1'
workflow_dispatch: {}
jobs:
sync:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: Check out the repo
uses: actions/checkout@v6
- name: Use Node.js
uses: actions/setup-node@v6
with:
node-version: "22"
- name: Install dependencies
run: npm ci
- name: Fetch upstream gateway.proto
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npm run fetch:zeebe-proto
- name: Auto-emit Class 1-3 additive surface
# Hard-fails (exit 3) if any new RPC requires bespoke shaping.
run: npm run emit:grpc-additions -- --apply
- name: Verify generated TypeScript compiles
run: npx tsc --noEmit -p tsconfig.json
- name: Confirm drift detector is clean
run: npm run check:grpc-drift
- name: Read pinned ref
id: ref
run: |
ref=$(cat .zeebe-proto-version | tr -d '[:space:]')
sha=$(node -e "console.log(JSON.parse(require('fs').readFileSync('src/proto/.zeebe-proto-source.json','utf8')).sha.slice(0,12))")
echo "ref=$ref" >> "$GITHUB_OUTPUT"
echo "sha=$sha" >> "$GITHUB_OUTPUT"
- name: Open pull request
uses: peter-evans/create-pull-request@v7
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: chore/zeebe-proto-sync
base: main
commit-message: |
chore(zeebe): sync gateway.proto from camunda/camunda@${{ steps.ref.outputs.ref }}
Auto-generated by .github/workflows/proto-sync.yml.
Pinned ref: ${{ steps.ref.outputs.ref }} @ ${{ steps.ref.outputs.sha }}
Refs #760
title: "chore(zeebe): sync gateway.proto from camunda/camunda@${{ steps.ref.outputs.ref }}"
body: |
Automated weekly sync of `src/proto/zeebe.proto` from
`camunda/camunda@${{ steps.ref.outputs.ref }}`
(commit `${{ steps.ref.outputs.sha }}`).
New top-level wire-type interfaces, ZBGrpc method signatures,
and Class 1-3 facade methods were auto-emitted by
`scripts/emit-grpc-additions.mjs`.
**Maintainer checklist:**
- [ ] Review the auto-emitted region(s) (search for
`Auto-emitted by scripts/emit-grpc-additions.mjs`)
- [ ] Splice in any newly-reported optional fields on
existing wire-type interfaces (printed by the emitter
in `--print` mode; not auto-applied)
- [ ] If a new RPC needs bespoke shaping (Class 4), this
workflow will have failed instead — design the facade
by hand on a separate branch
- [ ] Update `CHANGELOG.md` if the additions warrant it
labels: |
zeebe
proto-sync
delete-branch: true