Skip to content

Strip conventional-commit title prefixes and capitalize titles - #4445

Merged
theletterf merged 3 commits into
mainfrom
feat/changelog-strip-conventional-prefix
Oct 14, 2026
Merged

theletterf merged 3 commits into
mainfrom
feat/changelog-strip-conventional-prefix

Conversation

@theletterf

Copy link
Copy Markdown
Member

While reviewing the automated Kibana Serverless bundle in elastic/docs-internal-workflows#1051, I found that changelog add leaves PR titles like fix(apm): …, feat(cases): …, Fix: … and fix create visualization … untouched. extract.strip_title_prefix only handles a leading [Bracket] prefix.

This PR extends that option. When it is true, title cleanup now runs three steps in order: strip [Bracket] prefixes (unchanged), strip a conventional-commit prefix (feat, fix, docs, chore, refactor, perf, test, style, build, ci, revert, with an optional scope and !), then capitalize the first letter. The prefix is removed only when text follows it, and the entry type already carries the same information. Capitalization skips titles whose first word looks like code (digits, underscores, dots, backticks or inner capitals), so identifiers such as kibana.alert.rule keep their casing.

The change lives in ChangelogTextUtilities.StripTitlePrefix, and all five existing call sites now use it. Verb-form rewrites (for example "Fixing …" to "Fix …") and type corrections stay out of scope. Those need judgment and belong to the review and fix workflows.

Behavior changes for every repo that sets strip_title_prefix: true, since the option now also capitalizes. I kept it under the existing flag rather than adding a new one. Say so if you would rather have a separate opt-in.

I added unit tests for each step and updated docs/data/release-notes/configure-ref.md. Elastic.Documentation.Configuration.Tests (849) and Elastic.Changelog.Tests (1377) pass locally.

Fixes elastic/docs-eng-team#1036

🤖 Generated with Claude Code

Extend extract.strip_title_prefix to remove fix:, feat(scope): and similar
prefixes after square-bracket prefixes, then capitalize the first letter
unless the first word looks like code.

Related to elastic/docs-eng-team#1036

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@theletterf
theletterf requested a review from a team as a code owner October 14, 2026 09:15
@theletterf
theletterf requested a review from technige October 14, 2026 09:15
@github-actions

Copy link
Copy Markdown
Contributor

Adds matchTimeoutMilliseconds: 2000, the value CallOutParser already uses, to
the conventional-commit prefix regex and to the two older regexes in the same
class. A test fails if a regex in the class has no timeout.

Related to elastic/docs-eng-team#1036

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01RyiyHmDHcUFt8rjMNR8TBm
@theletterf
theletterf enabled auto-merge (squash) October 14, 2026 10:36
@theletterf
theletterf merged commit 5254abb into main Oct 14, 2026
32 checks passed
@theletterf
theletterf deleted the feat/changelog-strip-conventional-prefix branch October 14, 2026 10:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants