Skip to content

Commit 0e4d347

Browse files
ci(clients): Release the Python and Rust clients separately (#729)
Splits the shared client release into one Craft release per client, each with its own changelog. A PR that changes both clients now shows up in both changelogs, and the title scope no longer decides anything. ## What changes - **Two release units:** `clients/python/.craft.yml` and `clients/rust/.craft.yml`, with separate tag prefixes (`py-client@` / `rs-client@`), release branches (`release-py/` / `release-rust/`) and bump scripts. - **One release workflow** with a `python`/`rust` input. The Python build workflow is now `build-python-client.yml`. - **Changelogs grouped by type** (Breaking, Features, Fixes, Other) in each client's `.github/release.yml` (two identical copies; Craft only reads the one next to `.craft.yml`). Other Changes catches everything else as a patch bump. - **Per-client changelogs:** `clients/CHANGELOG.md` is split into `clients/python/CHANGELOG.md` and `clients/rust/CHANGELOG.md` in the new format. Each keeps only entries for PRs that changed that client's directory. - **Two changelog previews**, one per client, reported as checks instead of PR comments so they don't overwrite each other. - `AGENTS.md` no longer asks for client scopes. ## Before the first release Craft finds the previous release from the latest tag with the client's prefix. Without a starting tag, the first changelog would contain the whole history. Seed both prefixes at `0.2.10`: ```sh git tag py-client@0.2.10 0.2.10 git tag rs-client@0.2.10 0.2.10 git push origin py-client@0.2.10 rs-client@0.2.10 ``` ## Things to know - A `### Changelog Entry` section applies to every client the PR touches. If a PR touches both clients but the custom text only makes sense for one, it shows up in the other changelog too. For example, #704 changed both clients, so its Rust-flavoured entry would also appear in the Python changelog. - Changes only in `objectstore-types` still don't show up in the Rust changelog, as before, because Craft only collects commits under the client's directory. - The two previews share one commit status context ("Changelog Preview / Semver Impact"), so on a PR touching both clients that status shows whichever ran last. Each job summary is correct. - GitHub has a single "Latest" release per repo, so the badge moves between the two clients. #skip-changelog --------- Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com> Co-authored-by: Lorenzo Cian <17258265+lcian@users.noreply.github.com>
1 parent c51b60e commit 0e4d347

16 files changed

Lines changed: 768 additions & 471 deletions
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Build Python client
33
on:
44
push:
55
branches:
6-
- release-library/**
6+
- release-py/**
77

88
permissions:
99
contents: read
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Changelog Preview (Python client)
2+
3+
on:
4+
pull_request_target:
5+
types: [opened, synchronize, reopened, edited, labeled, unlabeled]
6+
paths:
7+
- clients/python/**
8+
9+
permissions:
10+
contents: read
11+
pull-requests: write
12+
statuses: write
13+
14+
jobs:
15+
changelog-preview:
16+
uses: getsentry/craft/.github/workflows/changelog-preview.yml@924b450ede4af30e30de4821a4b357d676c8df92 # v3
17+
with:
18+
working-directory: clients/python
19+
# Report as a check with a job summary. In comment mode, both client
20+
# previews would overwrite the same PR comment.
21+
comment: false
Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
name: Changelog Preview
1+
name: Changelog Preview (Rust client)
22

33
on:
44
pull_request_target:
55
types: [opened, synchronize, reopened, edited, labeled, unlabeled]
66
paths:
7-
- clients/**
7+
- clients/rust/**
88

99
permissions:
1010
contents: read
@@ -15,4 +15,7 @@ jobs:
1515
changelog-preview:
1616
uses: getsentry/craft/.github/workflows/changelog-preview.yml@924b450ede4af30e30de4821a4b357d676c8df92 # v3
1717
with:
18-
working-directory: clients
18+
working-directory: clients/rust
19+
# Report as a check with a job summary. In comment mode, both client
20+
# previews would overwrite the same PR comment.
21+
comment: false

‎.github/workflows/ci.yml‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ on:
55
branches:
66
- main
77
- release/**
8-
- release-library/**
8+
- release-py/**
9+
- release-rust/**
910

1011
pull_request:
1112

@@ -244,7 +245,7 @@ jobs:
244245
if: github.ref == 'refs/heads/main'
245246

246247
validate_gocd:
247-
if: ${{ !startsWith(github.ref, 'refs/heads/release/') && !startsWith(github.ref, 'refs/heads/release-library/') }}
248+
if: ${{ !startsWith(github.ref, 'refs/heads/release/') && !startsWith(github.ref, 'refs/heads/release-py/') && !startsWith(github.ref, 'refs/heads/release-rust/') }}
248249
name: Validate GoCD Pipelines
249250
runs-on: ubuntu-latest
250251

‎.github/workflows/release-clients.yml‎

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
1-
name: Release client libraries
1+
name: Release client library
22

33
on:
44
workflow_dispatch:
55
inputs:
6+
client:
7+
description: Client to release
8+
required: true
9+
type: choice
10+
options:
11+
- python
12+
- rust
613
version:
714
description: Version to release
815
required: true
@@ -41,4 +48,4 @@ jobs:
4148
version: ${{ github.event.inputs.version }}
4249
force: ${{ github.event.inputs.force }}
4350
merge_target: ${{ github.event.inputs.merge_target }}
44-
path: clients
51+
path: clients/${{ github.event.inputs.client }}

‎AGENTS.md‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,7 @@ cargo doc --workspace --all-features --no-deps --document-private-items
7373

7474
## Pull Requests
7575

76-
When making a change that touches one of the clients, consider the user-facing changelog entry, which is generated from PR titles:
76+
The Python and Rust clients are released separately, each with its own changelog (`clients/python/CHANGELOG.md`, `clients/rust/CHANGELOG.md`). When making a change that touches one of the clients, consider the user-facing changelog entry, which is generated from PR titles:
7777

78-
- Scope client changes as `py-client` or `rs-client`, e.g. `feat(py-client): Add X`. This allows the automatic changelog generation workflow to pick those changes up.
79-
- Split changes to both clients into one PR per client.
80-
- If the title doesn't describe the change well for client users, add a `### Changelog Entry` section to the PR description with the text to use instead.
78+
- A PR is listed in the changelog of every client whose directory it changes, grouped by the conventional commit type of its title (`feat`, `fix`, ...). The scope doesn't matter.
79+
- If the title doesn't describe the change well for client users, add a `### Changelog Entry` section to the PR description with the text to use instead. It's used for every client the PR touches.

‎clients/.github/release.yml‎

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

0 commit comments

Comments
 (0)