Skip to content

Commit fdee3c6

Browse files
authored
feat: release automation configs (#262)
* feat: release automation configs * feat: address comments, update workflow * feat: release pipeline secret keys update and extra files * feat: remove unreleased section from changelog
1 parent a6edd7c commit fdee3c6

File tree

9 files changed

+191
-7
lines changed

9 files changed

+191
-7
lines changed
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: release-please
2+
3+
permissions:
4+
contents: read
5+
6+
on:
7+
push:
8+
branches: [main]
9+
workflow_dispatch:
10+
inputs:
11+
bump-type:
12+
description: >
13+
Version bump type. Select 'explicit' to supply an exact version via
14+
the 'release-version' field below. Select 'auto' to let
15+
conventional-commits determine the bump automatically.
16+
required: false
17+
type: choice
18+
default: 'auto'
19+
options:
20+
- auto
21+
- patch
22+
- minor
23+
- major
24+
- explicit
25+
release-version:
26+
description: >
27+
Explicit version to release (e.g. 1.2.3 or 1.4.0-beta.1).
28+
required: false
29+
type: string
30+
31+
jobs:
32+
release:
33+
permissions:
34+
contents: write
35+
pull-requests: write
36+
if: |
37+
github.event_name == 'workflow_dispatch' ||
38+
startsWith(github.event.head_commit.message, 'release:')
39+
uses: openfga/sdk-generator/.github/workflows/release-please.yml@main
40+
with:
41+
trigger-event: ${{ github.event_name }}
42+
bump-type: ${{ inputs.bump-type || 'auto' }}
43+
release-version: ${{ inputs.release-version || '' }}
44+
secrets:
45+
RELEASER_APP_ID: ${{ secrets.RELEASER_APP_ID }}
46+
RELEASER_APP_PRIVATE_KEY: ${{ secrets.RELEASER_APP_PRIVATE_KEY }}
47+
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
48+
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}

.release-please-manifest.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
".": "0.10.0"
3+
}

CHANGELOG.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# Changelog
22

3-
## [Unreleased](https://github.com/openfga/python-sdk/compare/v0.10.0...HEAD)
4-
53
### [0.10.0](https://github.com/openfga/python-sdk/compare/v0.9.9...v0.10.0) (2026-03-24)
64

75
- feat: add `execute_api_request` and `execute_streamed_api_request` methods to `OpenFgaClient` and `OpenFgaApi` for making arbitrary HTTP requests to any OpenFGA API endpoint with full auth, retry, and telemetry support (#252) - thanks @kcbiradar

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Python SDK for OpenFGA
22

33
[![pypi](https://img.shields.io/pypi/v/openfga_sdk.svg?style=flat)](https://pypi.org/project/openfga_sdk)
4-
[![Socket Badge](https://badge.socket.dev/pypi/package/openfga-sdk/0.10.0)](https://socket.dev/pypi/package/openfga-sdk)
4+
[![Socket Badge](https://badge.socket.dev/pypi/package/openfga-sdk/0.10.0)](https://socket.dev/pypi/package/openfga-sdk) <!-- x-release-please-version -->
55
[![DeepWiki](https://img.shields.io/badge/DeepWiki-openfga%2Fpython--sdk-blue.svg?logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACwAAAAyCAYAAAAnWDnqAAAAAXNSR0IArs4c6QAAA05JREFUaEPtmUtyEzEQhtWTQyQLHNak2AB7ZnyXZMEjXMGeK/AIi+QuHrMnbChYY7MIh8g01fJoopFb0uhhEqqcbWTp06/uv1saEDv4O3n3dV60RfP947Mm9/SQc0ICFQgzfc4CYZoTPAswgSJCCUJUnAAoRHOAUOcATwbmVLWdGoH//PB8mnKqScAhsD0kYP3j/Yt5LPQe2KvcXmGvRHcDnpxfL2zOYJ1mFwrryWTz0advv1Ut4CJgf5uhDuDj5eUcAUoahrdY/56ebRWeraTjMt/00Sh3UDtjgHtQNHwcRGOC98BJEAEymycmYcWwOprTgcB6VZ5JK5TAJ+fXGLBm3FDAmn6oPPjR4rKCAoJCal2eAiQp2x0vxTPB3ALO2CRkwmDy5WohzBDwSEFKRwPbknEggCPB/imwrycgxX2NzoMCHhPkDwqYMr9tRcP5qNrMZHkVnOjRMWwLCcr8ohBVb1OMjxLwGCvjTikrsBOiA6fNyCrm8V1rP93iVPpwaE+gO0SsWmPiXB+jikdf6SizrT5qKasx5j8ABbHpFTx+vFXp9EnYQmLx02h1QTTrl6eDqxLnGjporxl3NL3agEvXdT0WmEost648sQOYAeJS9Q7bfUVoMGnjo4AZdUMQku50McDcMWcBPvr0SzbTAFDfvJqwLzgxwATnCgnp4wDl6Aa+Ax283gghmj+vj7feE2KBBRMW3FzOpLOADl0Isb5587h/U4gGvkt5v60Z1VLG8BhYjbzRwyQZemwAd6cCR5/XFWLYZRIMpX39AR0tjaGGiGzLVyhse5C9RKC6ai42ppWPKiBagOvaYk8lO7DajerabOZP46Lby5wKjw1HCRx7p9sVMOWGzb/vA1hwiWc6jm3MvQDTogQkiqIhJV0nBQBTU+3okKCFDy9WwferkHjtxib7t3xIUQtHxnIwtx4mpg26/HfwVNVDb4oI9RHmx5WGelRVlrtiw43zboCLaxv46AZeB3IlTkwouebTr1y2NjSpHz68WNFjHvupy3q8TFn3Hos2IAk4Ju5dCo8B3wP7VPr/FGaKiG+T+v+TQqIrOqMTL1VdWV1DdmcbO8KXBz6esmYWYKPwDL5b5FA1a0hwapHiom0r/cKaoqr+27/XcrS5UwSMbQAAAABJRU5ErkJggg==)](https://deepwiki.com/openfga/python-sdk)
66
[![Release](https://img.shields.io/github/v/release/openfga/python-sdk?sort=semver&color=green)](https://github.com/openfga/python-sdk/releases)
77
[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fopenfga%2Fpython-sdk.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2Fopenfga%2Fpython-sdk?ref=badge_shield)

RELEASE.md

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
# Release guide
2+
3+
This project uses [release-please](https://github.com/googleapis/release-please) via a
4+
`workflow_dispatch`-triggered GitHub Actions workflow. This document explains how to cut
5+
a release and what to watch out for.
6+
7+
---
8+
9+
## Versioning rules for this project
10+
11+
We are pre-1.0.0. Semver conventions are relaxed:
12+
13+
| Change type | Bump | Example |
14+
|--- |--- |--- |
15+
| Breaking change | **Minor** (`0.x.0`) | `0.10.0``0.11.0` |
16+
| Everything else | **Patch** (`0.0.x`) | `0.10.0``0.10.1` |
17+
18+
Major bumps (`1.0.0`) are reserved for a deliberate stable-API graduation decision — not for
19+
routine breaking changes.
20+
21+
---
22+
23+
## Cutting a release
24+
25+
1. Go to **Actions → release-please** and click **Run workflow**.
26+
2. Choose a bump type:
27+
- `patch` — bugfixes, docs, small changes
28+
- `minor` — breaking changes (see above)
29+
- `explicit` — you specify the exact version string (e.g. `0.11.0` or `0.11.0-beta.1`)
30+
3. The workflow creates a release PR. Review it, then merge.
31+
4. The GitHub Release and tag are created automatically on merge.
32+
33+
> **Note — release-please only understands `auto` or an explicit version string.**
34+
> The `patch`, `minor`, and `major` options in the workflow dropdown are conveniences
35+
> implemented in the workflow. The workflow reads the current manifest version, computes
36+
> the next version (e.g. `0.10.0` + patch = `0.10.1`), and passes that computed string
37+
> to release-please as an explicit `Release-As:` commit — exactly the same as choosing
38+
> `explicit` and typing it yourself. There is no native patch/minor/major mode in
39+
> release-please. This is why `explicit` is always the safest option when in doubt —
40+
> you are just skipping the arithmetic step.
41+
42+
---
43+
44+
## When to use `explicit`
45+
46+
Use `explicit` and type the version yourself in any of these situations:
47+
48+
**After a beta or non-conventional tag.**
49+
If the previous release was something like `0.10.0-beta.1`, release-please tracks the
50+
base semver (`0.10.0`) but cannot reliably decide whether the next release should be
51+
`0.10.0`, `0.10.1`, or `0.11.0`. It will often guess wrong.
52+
53+
The rule of thumb: **if the last tag had a pre-release suffix, always use `explicit` for
54+
the next release.**
55+
56+
**After a manually created tag.**
57+
Any tag created outside of the release-please workflow (e.g. hotfixes, manual git tags)
58+
is invisible to release-please's version logic. Use `explicit` to anchor the next version
59+
correctly.
60+
61+
**When you want a beta.**
62+
Release-please does not increment pre-release suffixes automatically. Use `explicit` for
63+
every beta, incrementing the suffix manually:
64+
```
65+
0.11.0-beta.1 → explicit: 0.11.0-beta.2 → explicit: 0.11.0
66+
```
67+
68+
---
69+
70+
## What goes in the changelog
71+
72+
Commit messages must follow [Conventional Commits](https://www.conventionalcommits.org/)
73+
for release-please to group them correctly:
74+
75+
```
76+
feat: add support for batch check → Added
77+
fix: correct retry logic for transient errors → Fixed
78+
docs: update API reference → Documentation
79+
perf: cache DNS lookups → Changed
80+
refactor: extract auth helper → (hidden)
81+
chore: bump dependencies → (hidden)
82+
```
83+
84+
---
85+
86+
## Troubleshooting
87+
88+
**"Invalid previous_tag parameter" error.**
89+
The manifest version does not have a corresponding GitHub Release object. Reset the
90+
manifest to the last valid tag:
91+
```bash
92+
echo '{ ".": "0.x.y" }' > .release-please-manifest.json
93+
git commit -am "chore: reset manifest to v0.x.y"
94+
git push origin main
95+
```
96+
97+
**Duplicate release PRs.**
98+
Close all stale ones. The workflow auto-closes stale open PRs on each dispatch, but
99+
merged duplicates need manual labelling with `autorelease: tagged`.
100+
101+
**Changelog shows everything ungrouped.**
102+
Make sure `changelog-type` in `release-please-config.json` is set to `"default"`, not
103+
`"github"`.

example/example1/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ attrs >= 25.3.0
44
frozenlist >= 1.7.0
55
idna >= 3.10
66
multidict >= 6.6.4
7-
openfga-sdk >= 0.10.0
7+
openfga-sdk >= 0.10.0 # x-release-please-version
88
python-dateutil >= 2.9.0.post0
99
urllib3 >= 1.26.19, != 2.0.*, != 2.1.*, != 2.2.0, != 2.2.1, < 3
1010
yarl >= 1.20.1

example/example1/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
NAME = "example1"
1717
VERSION = "0.0.1"
18-
REQUIRES = ["openfga-sdk >= 0.10.0"]
18+
REQUIRES = ["openfga-sdk >= 0.10.0"] # x-release-please-version
1919

2020
setup(
2121
name=NAME,

openfga_sdk/constants.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,11 @@
1414

1515

1616
# Version of the OpenFGA Python SDK.
17-
SDK_VERSION: Final[str] = "0.10.0"
17+
SDK_VERSION: Final[str] = "0.10.0" # x-release-please-version
1818

1919
# User agent used in HTTP requests.
20-
USER_AGENT: Final[str] = "openfga-sdk python/0.10.0"
20+
21+
USER_AGENT: Final[str] = "openfga-sdk python/0.10.0" # x-release-please-version
2122

2223
# Example API domain for documentation/tests.
2324
SAMPLE_BASE_DOMAIN: Final[str] = "fga.example"

release-please-config.json

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
3+
"release-type": "python",
4+
"packages": {
5+
".": {
6+
"include-component-in-tag": false,
7+
"changelog-path": "CHANGELOG.md",
8+
"changelog-type": "default",
9+
"bump-minor-pre-major": true,
10+
"bump-patch-for-minor-pre-major": true,
11+
"changelog-sections": [
12+
{ "type": "feat", "section": "Added", "hidden": false },
13+
{ "type": "fix", "section": "Fixed", "hidden": false },
14+
{ "type": "perf", "section": "Changed", "hidden": false },
15+
{ "type": "refactor", "section": "Changed", "hidden": false },
16+
{ "type": "revert", "section": "Removed", "hidden": false },
17+
{ "type": "docs", "section": "Documentation", "hidden": false },
18+
{ "type": "test", "section": "Tests", "hidden": true },
19+
{ "type": "ci", "section": "CI", "hidden": true },
20+
{ "type": "chore", "section": "Miscellaneous", "hidden": true }
21+
],
22+
"extra-files": [
23+
{ "type": "toml", "path": "pyproject.toml", "jsonpath": "$.project.version" },
24+
{ "type": "generic", "path": "openfga_sdk/constants.py" },
25+
{ "type": "generic", "path": "README.md" },
26+
{ "type": "generic", "path": "example/example1/setup.py" },
27+
{ "type": "generic", "path": "example/example1/requirements.txt" }
28+
]
29+
}
30+
}
31+
}

0 commit comments

Comments
 (0)