Skip to content

fix(changelog): Skip Other scope header when scope grouping is disabled - #919

Merged
MathurAditya724 merged 1 commit into
masterfrom
fix/scope-grouping-disabled-other-header
Oct 22, 2026
Merged

MathurAditya724 merged 1 commit into
masterfrom
fix/scope-grouping-disabled-other-header

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

With changelog.scopeGrouping: false, craft still adds a #### Other subheading to any category that has two or more entries with the same scope. No scope headings are rendered in that mode, so the Other heading has nothing to separate and shows up by itself.

Example

.craft.yml:

changelog:
  policy: auto
  scopeGrouping: false

.github/release.yml:

changelog:
  categories:
    - title: Python Client
      commit_patterns:
        - "^(?<type>\\w+\\(py-client\\)!?:\\s*)"

Commits since the last tag:

  • feat(py-client): Add automatic resumable uploads (#667)
  • fix(py-client): Honor zero retries (#679)

Expected:

### Python Client

- Add automatic resumable uploads by @lcian in #667
- Honor zero retries by @lcian in #679

Actual:

### Python Client

#### Other

- Add automatic resumable uploads by @lcian in #667
- Honor zero retries by @lcian in #679

I reproduced this with craft 2.35.1 against getsentry/objectstore history.

Cause

In serializeChangelog, hasScopeHeaders checks whether any scope has more than one entry, but ignores scopeGroupingEnabled. When grouping is disabled, no scope gets a heading and every entry goes to the headerless bucket. hasScopeHeaders is still true, though, so that bucket gets an Other heading.

Fix

hasScopeHeaders now also requires scopeGroupingEnabled. Output with scopeGrouping: true (the default) doesn't change.

Tests

  • Added does not show Other header when scope grouping is disabled to the scope-grouping tests in changelog-generate.test.ts. It fails without the fix and passes with it.
  • pnpm lint, Prettier and tsc --noEmit pass.
  • In my sandbox, prepare-dry-run.e2e.test.ts and one test in git.test.ts fail on unmodified master too. The sandbox enforces its own Git author identity, so these failures have nothing to do with this change.

via @lcian.

--

View Junior Session [Sentry]

Co-Authored-By: Lorenzo Cian <17258265+lcian@users.noreply.github.com>

@MathurAditya724 MathurAditya724 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the rendering fix and regression coverage at this head. No blocking findings. All 27 applicable checks remain passing. The 149 focused tests, typecheck and lint passed locally; the clean combination with current master also passed 151 focused tests.

@MathurAditya724
MathurAditya724 merged commit f86eae3 into master Oct 22, 2026
29 checks passed
@MathurAditya724
MathurAditya724 deleted the fix/scope-grouping-disabled-other-header branch October 22, 2026 10:28
lcian added a commit to getsentry/objectstore that referenced this pull request Oct 22, 2026
The client changelog will now have exactly two sections, **Python
Client** and **Rust Client**, chosen by the PR title scope. PRs that
touch the clients also get a changelog preview comment.

Requires craft 3.0.0 or newer, which includes getsentry/craft#919. Older
versions add a stray `#### Other` subheading under a client section with
2+ entries.

## What changes for you

**PR titles decide the changelog.** For a client change, scope the
title:

- `feat(py-client): Add automatic resumable uploads` is listed under
**Python Client**
- `fix(rs-client): Drain discarded response bodies` is listed under
**Rust Client**

Craft drops the `feat(...)` prefix, so the entry reads "Add automatic
resumable uploads by @you in #123".

Example output, generated from our real history since `0.2.5` with this
config and the craft fix:

```markdown
### Python Client

- Add automatic resumable uploads by @lcian in #667
- Honor zero retries by @lcian in #679
- Add private resumable upload API by @lcian in #665

### Rust Client

- Mark Error as non-exhaustive by @lcian in #706
```

**Changelog preview.** When a PR touches `clients/**`, a bot comments
with how the PR will look in the changelog and what bump it implies. The
comment updates when you edit the title, description or labels. It's
informational only: it never fails or blocks the PR. PRs that don't
touch `clients/` get no comment.

**Custom wording.** If the title isn't a good user-facing description,
add this to the PR description:

```markdown
### Changelog Entry

Add `Client::foo` for doing X.
```

That text replaces the title in the changelog. Each top-level bullet
becomes a separate entry, all under the section picked by the title's
scope.

**Leaving a PR out.** Add the `skip-changelog` label, or put
`#skip-changelog` anywhere in the PR description.

## Things to be careful of

- **Use exactly `py-client` or `rs-client`.** Older variants
(`python-client`, `rust-client`, `rust`, `clients`, no scope) aren't
matched. A PR that touches `clients/` without a matching scope still
goes into the changelog, under a trailing `### Other` section. The
preview shows this, so check it.
- **Split PRs that change both clients.** Craft puts each PR in one
section only, so a combined PR can't appear under both.
- **Changes only in `objectstore-types`** don't get a preview and aren't
in the changelog. Craft runs from `clients/` and only collects commits
that touch `clients/`. If a types-only change matters to users, also
touch a client in the PR.

## Changes

- `clients/.craft.yml`: `changelogPolicy: auto` becomes
`changelog.policy: auto`, which removes the deprecation warning every
release logged. Also sets `scopeGrouping: false`.
- `clients/.github/release.yml` (new): the Python Client / Rust Client
categories. Each title is listed several times so that breaking, `feat`
and other changes still produce major, minor and patch bumps.
- `.github/workflows/changelog-preview.yml` (new): calls craft's
reusable preview workflow, pinned to the `v3` commit, with
`working-directory: clients` and a path filter on `clients/**`. It
doesn't pass repo secrets (`secrets: inherit`); the called workflow gets
`GITHUB_TOKEN` automatically and needs nothing else.
- `AGENTS.md`: short PR guidance covering the scopes, splitting PRs, and
`### Changelog Entry`.

## Alternative considered: type sections with client subheadings

Craft can also keep the usual type sections and put a client subheading
inside each:

```markdown
### New Features ✨

#### Python Client

- ...

### Bug Fixes 🐛

#### Rust Client

- ...
```

That uses the default categories with `scopeGrouping: true`. I didn't
use it, for two reasons:

- **The scope has to be the full name.** Craft builds the subheading
from the title scope by replacing hyphens with spaces and title-casing
it, and the label can't be configured. So `py-client` would show up as
"Py Client"; to get "Python Client", PR titles would need
`python-client` / `rust-client`.
- **A single entry gets no subheading.** Craft only adds a scope
subheading when that scope has 2+ entries in a section. A lone entry is
listed inline as `(python-client) Foo`, and sometimes under a `####
Other`. So the layout would change from release to release.

The nesting the other way round (Python Client → Features / Fixes) isn't
possible without a craft change: craft always nests type category first,
then scope.

<!-- junior-request-attribution:start -->
via @lcian.
<!-- junior-request-attribution:end -->

<!-- junior-session-footer:start -->
<!-- junior-conversation-id:slack%3AC0C641CPPS8%3A1792657214.524119 -->

--

[View Junior
Session](https://junior-prod.sentry.dev/conversations/slack%3AC0C641CPPS8%3A1792657214.524119)
[[Sentry]](https://sentry.sentry.io/explore/conversations/slack%3AC0C641CPPS8%3A1792657214.524119/?project=4510944073809921)

<!-- junior-session-footer:end -->

---------

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>

This branch was previously deployed

1 inactive deployment
false — 6f53fc90 Deployed Oct 22, 2026 by sentry-junior[bot] via Build #3151
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants