Skip to content

fix(changelog): classify added fields as additive (feat), not fix#43

Merged
gjtorikian merged 1 commit into
mainfrom
fix/field-added-additive-changelog
Jun 30, 2026
Merged

fix(changelog): classify added fields as additive (feat), not fix#43
gjtorikian merged 1 commit into
mainfrom
fix/field-added-additive-changelog

Conversation

@gjtorikian

Copy link
Copy Markdown
Collaborator

Problem

An added field is showing up under Fixes in generated SDK changelogs even when the release correctly bumps minor.

Concrete case — workos-python#678 (8.2.0 → 8.3.0, minor):

* [#676](…) fix(generated): regenerate from spec

  **Fixes**
  * **[organization_membership](…)**:
    * Added `roles` to organization membership models

The version bump is right (release-please read PR #676's squash subject feat(generated): OrganizationMembership … → minor), but the changelog text — which comes from this script's .changelog-pending fragment, not release-please — files the new field under Fixes.

Root cause

factsFromDiff hardcodes model-added and enum-added to severity: 'additive', but the field-added branch runs the differ's classification through capSeverity:

severity: capSeverity(fieldChange.kind, fieldChange.classification),

field-added is in BACKEND_ONLY_DIFF_KINDS, and capSeverity floors a would-be-breaking backend-only change at fix. The spec differ sometimes flags an added field breaking (it reads the new field as a request-shape tightening), so the addition collapsed to fixseverityToPrefix('fix') = fixFixes section. A missing/odd classification would also fall through severityToPrefix to fix. Meanwhile the minor bump came from a different additive fact in the same batch, so the two disagree.

Fix

Floor pure additions (field-added, value-added) at additive in capSeverity, regardless of the differ's classification — an addition can't break a caller and isn't a fix. This brings field additions in line with the already-hardcoded model-added/enum-added.

Tests

Added scripts/__tests__/sdk-release-metadata.spec.mjs:

  • field-added flagged breaking / additive / no-classification → all resolve to additive (feat)
  • field-removed flagged breaking still caps to fix (the cap must not leak to altering/removing changes)

Full suite: 45 pass, 1 skipped (built-bundle fixture), 0 fail.

🤖 Generated with Claude Code

A brand-new field is additive — a feature — but the SDK changelog was
filing field additions under **Fixes** while the release correctly
bumped minor. `model-added` and `enum-added` are hardcoded `additive`,
but the `field-added` branch ran the differ's classification through
`capSeverity`, which floors a would-be-breaking backend-only change at
`fix`. The spec differ sometimes flags an added field `breaking` (it
reads as a request-shape tightening), so the addition collapsed to
`fix` -> **Fixes**, disagreeing with the `feat`/minor bump that came
from a different additive fact in the same batch (e.g. workos-python
8.3.0, "Added `roles` to organization membership models").

Floor `field-added`/`value-added` at `additive` in `capSeverity`,
regardless of the differ's classification: an addition can't break a
caller and isn't a fix. This also covers a missing/odd classification,
which previously fell through `severityToPrefix` to `fix`.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@gjtorikian gjtorikian merged commit b6b0f90 into main Jun 30, 2026
6 checks passed
@gjtorikian gjtorikian deleted the fix/field-added-additive-changelog branch June 30, 2026 15:22
@greptile-apps

greptile-apps Bot commented Jun 30, 2026

Copy link
Copy Markdown

Greptile Summary

This PR updates SDK changelog classification for added fields and enum values. The main changes are:

  • Treats field-added and value-added as additive changes regardless of differ classification.
  • Keeps backend-only breaking caps for removals and other field/value changes.
  • Adds tests for field-added classifications and the field-removed non-regression case.

Confidence Score: 5/5

The changes are narrowly scoped to changelog classification and covered by targeted regression tests.

The implementation matches the described intent and adds tests for the key added-field cases plus a removal regression case.

T-Rex T-Rex Logs

What T-Rex did

  • Ran the baseline additive-classification run to establish the initial behavior, noting how field-added, missing/odd field additions, and value-added were classified.
  • Ran the head run after the changes and verified that all tested field-added and value-added additions resolve to severity=additive prefix=feat, while field-removed breaking remains severity=fix prefix=fix.
  • Executed the added-tests-02-after scenario and confirmed the head test command exited 0 with 4/4 passing tests.

View all artifacts

T-Rex Ran code and verified through T-Rex

Reviews (1): Last reviewed commit: "fix(changelog): classify added fields as..." | Re-trigger Greptile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant