You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: switch client generation to openapi-python-client (PDE-755) (#20)
speakeasy's free tier allows one generated SDK per workspace and
convoy.js holds that slot, so python generation moves to the OSS
openapi-python-client (pinned 0.29.0).
- .github/workflows/sdk_generation.yaml: rewritten for
openapi-python-client; same filename and dispatch inputs so the
frain-dev/convoy dispatcher works unchanged; opens a PR only when
the regenerated client differs
- speakeasy pipeline kept dormant, not deleted: old workflow renamed
to speakeasy_generation.yaml (manual-only), .speakeasy/ and
.genignore kept current so switching back is a trigger change
- scripts/generate.sh: fetches the spec, generates with
--fail-on-warning, rsyncs into src/convoy/ excluding hand-written
verify (src/convoy/utils/) and py.typed
- pyproject.toml: hand-owned packaging (convoy-python 1.0.0a1,
httpx + attrs); wheel verified to carry verify + generated client
- MIGRATION.md / README.md updated for the generator switch
git commit -m "feat: regenerate API client from OpenAPI spec"
105
+
# Force push is safe: the regen branch is fully derived from main
106
+
# plus this deterministic generation; any previous content is stale.
107
+
git push --force origin "$BRANCH"
108
+
109
+
existing=$(gh pr list --head "$BRANCH" --state open --json number --jq '.[0].number // empty')
110
+
if [ -z "$existing" ]; then
111
+
gh pr create \
112
+
--head "$BRANCH" \
113
+
--title "feat: regenerate API client from OpenAPI spec" \
114
+
--body "Automated regeneration via openapi-python-client from \`docs/v3/openapi3.yaml\` on frain-dev/convoy main. Hand-written webhook verify (\`src/convoy/utils/\`) is untouched by the sync script."
115
+
echo "Opened PR for $BRANCH" >> "$GITHUB_STEP_SUMMARY"
Copy file name to clipboardExpand all lines: MIGRATION.md
+12-7Lines changed: 12 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,15 +1,19 @@
1
-
# convoy-python 1.x migration (Speakeasy)
1
+
# convoy-python 1.x migration
2
2
3
3
## What changed
4
4
5
-
- The **public HTTP API client** will be generated from Convoy's OpenAPI spec (`docs/v3/openapi3.yaml`) via [Speakeasy](https://www.speakeasy.com/).
6
-
-**Webhook signature verification stays hand-written.** Generators do not own crypto. `src/convoy/utils/webhook.py` and the shared `test/signature-vectors.json` contract remain the source of truth for verify (see `.genignore`).
5
+
- The **public HTTP API client** is generated from Convoy's OpenAPI spec (`docs/v3/openapi3.yaml`) via [openapi-python-client](https://github.com/openapi-generators/openapi-python-client).
6
+
-**Webhook signature verification stays hand-written.** Generators do not own crypto. `src/convoy/utils/webhook.py` and the shared `test/signature-vectors.json` contract remain the source of truth for verify. The generation sync script (`scripts/generate.sh`) never touches `src/convoy/utils/`.
7
+
8
+
## Generator choice
9
+
10
+
Generation originally bootstrapped on Speakeasy, but the Speakeasy free tier allows one generated SDK per workspace and `convoy.js` holds that slot. The Speakeasy pipeline is kept **dormant** (`.speakeasy/`, `.genignore`, `.github/workflows/speakeasy_generation.yaml`) so the provider can be switched back without a rebuild; the active pipeline is openapi-python-client (`.github/workflows/sdk_generation.yaml`).
7
11
8
12
## Breaking change policy
9
13
10
-
Shipping the Speakeasy client is an intentional **1.x** break from the hand-written `0.x` surfaces. Method shapes are **not** silently preserved.
14
+
Shipping the generated client is an intentional **1.x** break from the hand-written `0.x` surfaces. Method shapes are **not** silently preserved.
11
15
12
-
1. This bootstrap PR wires Speakeasy, removes the deprecated hand-written HTTP client, and relocates verify to `src/convoy/utils/webhook.py` (inside the generated module tree, so `from convoy.utils.webhook import Webhook` keeps resolving — `moduleName: convoy` in `.speakeasy/gen.yaml`).
16
+
1. This PR wires openapi-python-client generation; the hand-written HTTP client stays removed and verify lives at `src/convoy/utils/webhook.py` (inside the generated module tree, so `from convoy.utils.webhook import Webhook` keeps resolving — `package_name_override: convoy` in `.openapi-python-client.yml`).
13
17
2. The first `sdk_generation.yaml` run opens a PR that adds the OpenAPI-generated client and publishes as `1.x`.
14
18
3. Consumers pin `0.x` until they migrate call sites.
15
19
@@ -28,8 +32,9 @@ if not webhook.verify_signature(payload, signature):
28
32
29
33
## Regenerating the API client
30
34
31
-
CI on `frain-dev/convoy`triggers Speakeasy when OpenAPI artifacts change. Locally (requires `SPEAKEASY_API_KEY`):
35
+
CI on `frain-dev/convoy`dispatches `sdk_generation.yaml` when OpenAPI artifacts change. Locally:
Copy file name to clipboardExpand all lines: README.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -122,6 +122,6 @@ Please see [CONTRIBUTING](CONTRIBUTING.MD) for details.
122
122
123
123
The MIT License (MIT). Please see [License File](LICENSE) for more information.
124
124
125
-
## Speakeasy-generated API client
125
+
## Generated API client
126
126
127
-
The HTTP API client is generated from Convoy OpenAPI via Speakeasy. **Webhook signature verification remains hand-written** (`convoy/utils/webhook.py`) and is covered by shared `test/signature-vectors.json`. See [MIGRATION.md](./MIGRATION.md).
127
+
The HTTP API client is generated from Convoy's OpenAPI spec via [openapi-python-client](https://github.com/openapi-generators/openapi-python-client). **Webhook signature verification remains hand-written** (`convoy/utils/webhook.py`) and is covered by shared `test/signature-vectors.json`. See [MIGRATION.md](./MIGRATION.md).
0 commit comments