Skip to content

ci: drive changelog from PR titles via Conventional Commits#2143

Merged
iMicknl merged 1 commit into
mainfrom
ci/changelog-labeling-strategy
Jun 21, 2026
Merged

ci: drive changelog from PR titles via Conventional Commits#2143
iMicknl merged 1 commit into
mainfrom
ci/changelog-labeling-strategy

Conversation

@iMicknl

@iMicknl iMicknl commented Jun 21, 2026

Copy link
Copy Markdown
Owner

Problem

PRs from feat/* branches were labeled feature by the branch-glob labeler, but Release Drafter's "Features" category only matched enhancement — so feature PRs silently dropped out of the changelog. Off-convention branches (docs/…, v2-api-polish) matched no rule and got no label at all, dropping them too. The feature/enhancement split was a duplicate with no real distinction, and several categories (refactoring, style, performance) had a changelog section but no labeler rule feeding them.

Change

Drive labeling from the PR title (Conventional Commits) via Release Drafter's built-in autolabeler, and retire the separate TimonVS/pr-labeler-action. One source of truth, robust to branch naming.

Consolidate into five primary buckets plus Documentation:

Prefix Label Section
any prefix with ! breaking 💥 Breaking Changes
feat: feature 🚀 New Features
fix: bug 🐛 Bug Fixes
refactor: perf: style: test: ci: chore: code-quality 🧹 Code Quality
build(deps): / Dependabot dependencies 📦 Dependencies
docs: documentation 📚 Documentation

Breaking changes route first (the ! rule is matched before the type label).

Details

  • .github/release-drafter.yml — new categories + autolabeler.
  • .github/workflows/release-drafter.yml — added pull_request trigger and pull-requests: write so the autolabeler runs on PRs.
  • Removed .github/pr-labeler.yml and .github/workflows/pr-labeler.yml.
  • AGENTS.md — documents the prefix → label → section mapping.

Repo labels (already applied)

  • Created code-quality.
  • Gave feature a description/color.
  • Marked enhancement DEPRECATED in its description (kept for historical issues).

YAML validated; pre-commit (incl. actionlint) passes.

Labels from `feat/*` branches were tagged `feature`, but Release Drafter
only matched `enhancement`, so feature PRs silently dropped out of the
changelog. Off-convention branches (docs/, v2-api-polish) got no label
at all and were likewise dropped.

Replace the branch-glob TimonVS/pr-labeler-action with Release Drafter's
built-in autolabeler, keyed on the Conventional-Commit PR title. One
source of truth, robust to branch naming. Consolidate the nine
fragmented categories into five primary buckets (Breaking, Features,
Bug Fixes, Code Quality, Dependencies) plus Documentation.

Document the prefix -> label -> section mapping in AGENTS.md.
@iMicknl iMicknl requested a review from tetienne as a code owner June 21, 2026 16:33
@iMicknl iMicknl added the code-quality Refactoring, performance, style, tests, CI, and chores label Jun 21, 2026
@iMicknl iMicknl merged commit 0db11ac into main Jun 21, 2026
10 checks passed
@iMicknl iMicknl deleted the ci/changelog-labeling-strategy branch June 21, 2026 16:38
iMicknl added a commit that referenced this pull request Jun 21, 2026
## Problem

Changelog entries render the Conventional-Commit prefix that's already
implied by the section — e.g. under 🚀 New Features:

> - **feat:** add core:IntrusionDetectedState for Somfy IntelliTAG air
(#2142)

The `feat:` is redundant ("doubled") with the section heading.

## Change

The prefix can't simply be dropped from the PR title — it's the signal
the autolabeler uses to sort entries into sections. Instead, strip it
from the *rendered* entry via a Release Drafter `replacers` rule:

```yaml
replacers:
  - search: '/\* (build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test)(\(.+?\))?!?:\s*/g'
    replace: '* '
```

Now `feat: add X` renders as `Add X` while the title keeps driving
labeling/sectioning.

Also documents this in AGENTS.md (keep the prefix in titles; it's
stripped on publish) and drops two now-obvious comments from the
workflow.

Follow-up to #2143.
iMicknl added a commit that referenced this pull request Jun 21, 2026
## Why

Now that #2144 strips the Conventional-Commit prefix, the summary
becomes the first word the reader sees in the changelog. Conventional
Commits' default lowercase summary renders as:

> - add core:IntrusionDetectedState for Somfy IntelliTAG air (#2142)

Capitalizing the summary gives the expected:

> - Add core:IntrusionDetectedState for Somfy IntelliTAG air (#2142)

## Why a convention, not config

Release Drafter `replacers` can find/replace text but **cannot transform
case** (no callback / uppercase function), so forcing the capital via
regex isn't possible. The only route is writing the title capitalized:
`feat: Add X`.

Documents this in AGENTS.md. Follow-up to #2143 / #2144.
iMicknl added a commit that referenced this pull request Jun 21, 2026
## Problem

The `autolabeler` rules added in #2143 were never actually executed. The
main `release-drafter/release-drafter` action only **drafts releases** —
it parses the full config (hence the deprecation warnings in its logs)
but does **not** apply labels. Labeling is a *separate* sub-action:
`release-drafter/release-drafter/autolabeler`.

Consequences observed:
- #2145 was opened with **no labels** at all.
- #2143 (`code-quality`) and #2144 (`ci`) were labeled **manually**, not
by the action.
- No "add label" activity appears in any release-drafter run log.

Since the changelog draft groups by label, an unlabeled merged PR falls
into the uncategorized bucket — the exact drop we set out to fix.

## Fix

- Add a dedicated `autolabel` job (PRs only) using the
`release-drafter/release-drafter/autolabeler` sub-action, with
`pull-requests: write`.
- Gate the existing `update_release_draft` job to `push` events, so each
job only runs where it applies (no wasted draft run per PR).
- Pin both to the same SHA (v7.4.0).

Follow-up to #2143 / #2144.

## Verification

After merge I'll confirm a new PR gets labeled by `github-actions` (not
manually). Also worth a separate cleanup: relabel #2144 `ci` ->
`code-quality`, and deprecate the stale `ci` label (not part of the new
scheme).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

code-quality Refactoring, performance, style, tests, CI, and chores

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant