Skip to content

Comments

Fix changelog add --no-extract-issues and --no-extract-release-notes#2778

Merged
lcawl merged 2 commits intomainfrom
bundle-extract
Feb 24, 2026
Merged

Fix changelog add --no-extract-issues and --no-extract-release-notes#2778
lcawl merged 2 commits intomainfrom
bundle-extract

Conversation

@lcawl
Copy link
Contributor

@lcawl lcawl commented Feb 24, 2026

Relates to #2775

Summary

The changelog add command documents that extract.release_notes and
extract.issues in changelog.yml can be set as defaults, but the CLI's own defaults (always true) are used instead.

ChangelogCreationService.ApplyConfigDefaults currently returns the input unchanged.
The comment in ChangelogCreationService.cs
says "Apply config defaults to input (for extract_release_notes,
extract_issues)" but the implementation does nothing.

With this fix, the behaviour is as follows:

  • With no flag → uses extract.release_notes / extract.issues from config (default true)
  • With --no-extract-release-notes / --no-extract-issues → CLI wins and disables extraction

Code changes

  1. CreateChangelogArguments (ChangelogCreationService.cs)

    • ExtractReleaseNotes and ExtractIssues changed from bool to bool?
    • null means “use config default”; true/false means an explicit CLI value
  2. ChangelogCommand.Create (ChangelogCommand.cs)

    • Sends null instead of true when the user doesn’t pass --no-extract-release-notes or --no-extract-issues
    • Sends false when the user passes those flags
  3. ApplyConfigDefaults (ChangelogCreationService.cs)

    • Uses config when CLI did not specify a value:
      • ExtractReleaseNotes = input.ExtractReleaseNotes ?? config.Extract.ReleaseNotes
      • ExtractIssues = input.ExtractIssues ?? config.Extract.Issues
  4. Consumers (PrInfoProcessor.cs, IssueInfoProcessor.cs)

    • Use input.ExtractReleaseNotes ?? false and input.ExtractIssues ?? false because the properties are now bool?

Documentation

  • docs/contribute/changelog.md already describes the intended behavior... The docs assume both the CLI and config work; the fix makes the implementation match that.
  • docs/cli/release/changelog-add.md does not say where the default comes from when the flags are omitted. I've added a note that when the flag is not provided, the default comes from extract.release_notes / extract.issues in changelog.yml.

Tests

A new test CreateChangelog_WhenExtractNotSpecifiedByCli_UsesConfigExtractReleaseNotes verifies that when CLI does not pass the flag, extract.release_notes: false in config disables extraction (PR title is used instead of extracted release notes)

Existing tests that pass ExtractReleaseNotes = true or ExtractIssues = true still pass, since those values remain valid for bool?.

Tests that don’t set these properties (default null) now get their values from config. When tests use CreateConfigDirectory() with configs that omit extract, the loader falls back to extract.release_notes ?? true and extract.issues ?? true, so the effective behavior stays “extraction on” as before. The full changelog suite (231 tests) continues to pass, so no existing test behavior is regressed.

Steps for testing

  1. Create a changelog configuration file (e.g. use the one in [DOCS] Add changelog configuration file kibana#247875)
  2. Uncomment the extract.release_notes and extract.issues changelog configuration settings. Try the subsequent tests with them set to both true and false to verify they're heeded.
  3. Create a changelog. In particular, test with a PR that has the "Release notes" section in its PR description and has at least one issue in its body. For example:
    docs-builder changelog add \
    --products "kibana 9.3.0" \
    --config ./docs/changelog.yml \
    --prs https://github.com/elastic/kibana/pull/243792
  4. Re-run the command with the --no-extract-release-notes and --no-extract-issues to verify that they override the changelog config settings.

Generative AI disclosure

  1. Did you use a generative AI (GenAI) tool to assist in creating this contribution?
  • Yes
  • No
  1. If you answered "Yes" to the previous question, please specify the tool(s) and model(s) used (e.g., Google Gemini, OpenAI ChatGPT-4, etc.).

Tool(s) and model(s) used: composer-1.5

@lcawl lcawl added the bug label Feb 24, 2026
@github-actions
Copy link

github-actions bot commented Feb 24, 2026

🔍 Preview links for changed docs

@lcawl lcawl marked this pull request as ready for review February 24, 2026 20:14
@lcawl lcawl requested review from a team as code owners February 24, 2026 20:14
@lcawl lcawl requested a review from reakaleek February 24, 2026 20:14
@lcawl lcawl merged commit ab2bdf7 into main Feb 24, 2026
30 checks passed
@lcawl lcawl deleted the bundle-extract branch February 24, 2026 21:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants