diff --git a/.github/workflows/changelog-preview.yml b/.github/workflows/changelog-preview.yml new file mode 100644 index 00000000..fa8acb10 --- /dev/null +++ b/.github/workflows/changelog-preview.yml @@ -0,0 +1,18 @@ +name: Changelog Preview + +on: + pull_request_target: + types: [opened, synchronize, reopened, edited, labeled, unlabeled] + paths: + - clients/** + +permissions: + contents: read + pull-requests: write + statuses: write + +jobs: + changelog-preview: + uses: getsentry/craft/.github/workflows/changelog-preview.yml@924b450ede4af30e30de4821a4b357d676c8df92 # v3 + with: + working-directory: clients diff --git a/AGENTS.md b/AGENTS.md index d8e3d24a..25a37910 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -70,3 +70,11 @@ When adding docs or moving types, verify documentation references: ```bash cargo doc --workspace --all-features --no-deps --document-private-items ``` + +## Pull Requests + +When making a change that touches one of the clients, consider the user-facing changelog entry, which is generated from PR titles: + +- 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. +- Split changes to both clients into one PR per client. +- 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. diff --git a/clients/.craft.yml b/clients/.craft.yml index 16b5db49..701dc0a8 100644 --- a/clients/.craft.yml +++ b/clients/.craft.yml @@ -1,4 +1,7 @@ -changelogPolicy: auto +changelog: + policy: auto + # Categories in `.github/release.yml` are the per-client headings; no scope subheadings. + scopeGrouping: false preReleaseCommand: ../scripts/bump-version-clients.sh releaseBranchPrefix: release-library diff --git a/clients/.github/release.yml b/clients/.github/release.yml new file mode 100644 index 00000000..9d10d567 --- /dev/null +++ b/clients/.github/release.yml @@ -0,0 +1,34 @@ +# Changelog categories for client releases, read by Craft from `clients/`. +# +# PR titles must use the `py-client` or `rs-client` scope to be listed, e.g. +# `feat(py-client): Add X`. Entries are matched top to bottom; categories that +# share a title render as one section, and `semver` drives the version bump. +changelog: + exclude: + labels: + - skip-changelog + categories: + - title: Python Client + commit_patterns: + - "^(?\\w+\\(py-client\\)!:\\s*)" + semver: major + - title: Rust Client + commit_patterns: + - "^(?\\w+\\(rs-client\\)!:\\s*)" + semver: major + - title: Python Client + commit_patterns: + - "^(?feat\\(py-client\\):\\s*)" + semver: minor + - title: Rust Client + commit_patterns: + - "^(?feat\\(rs-client\\):\\s*)" + semver: minor + - title: Python Client + commit_patterns: + - "^(?\\w+\\(py-client\\):\\s*)" + semver: patch + - title: Rust Client + commit_patterns: + - "^(?\\w+\\(rs-client\\):\\s*)" + semver: patch