Skip to content

Comments

Fix changelog bundle --directory#2779

Merged
lcawl merged 1 commit intomainfrom
bundle-directory
Feb 24, 2026
Merged

Fix changelog bundle --directory#2779
lcawl merged 1 commit intomainfrom
bundle-directory

Conversation

@lcawl
Copy link
Contributor

@lcawl lcawl commented Feb 24, 2026

Relates to #2775

Summary

The docs-builder changelog bundle command has some bugginess around the --directory option when the bundle.directory changelog configuration setting exists.

Implementation

  1. ChangelogBundlingService.cs

    • BundleChangelogsArguments.Directory is now string? so “not specified” is distinct from “specified”.
    • ApplyConfigDefaults only applies config when input.Directory == null; if the user passes --directory . (or any path), that value is kept.
    • ProcessProfile and call sites correctly support a null directory.
  2. ChangelogCommand.cs

    • The bundle command now forwards Directory = directory instead of Directory = directory ?? Directory.GetCurrentDirectory(), so null is passed when --directory is omitted.
  3. Tests

    • BundleChangelogs_WithConfigDirectory_WhenDirectoryNotSpecified_UsesConfigDirectory – asserts config is used when Directory is null.
    • BundleChangelogs_WithExplicitDirectory_OverridesConfigDirectory – asserts the CLI directory overrides config when --directory is set, even when it equals the current directory.

Steps to test

  1. Add a changelog configuration file (I used the one from Kibana release notes test kibana#250840)
  2. Verify that the bundle.directory is set in the changelog configuration file (e.g. to docs/changelog).
  3. Copy a changelog file into a directory other than what's set in the changelog configuration file (e.g. I copied 224552.yaml into docs/test and changed its title value so I'd know where it was being found).
  4. Go into that new directory and try to create a changelog bundle with changelogs derived from the current directory. For example, from the docs/test directory, I ran:
    docs-builder changelog bundle \
    --config ~/Documents/GitHub/kibana/docs/changelog.yml \                             
    --prs 224552 --repo kibana --owner elastic \                          
    --output-products "kibana 9.3.0 *" --resolve \
    --directory . 
    In Fix inconsistent changelog config overrides #2775 it said this failed but in my test it succeeded (i.e. I could not recreate the exact problem the AI analysis identified).
  5. Create a changelog bundle and use the --directory option with something other than the current directory. For example:
    docs-builder changelog bundle \
    --config ~/Documents/GitHub/kibana/docs/changelog.yml \
    --prs 224552 --repo kibana --owner elastic \
    --output-products "kibana 9.3.0 *"  --resolve \
    --directory ~/Documents/GitHub/kibana/docs/test
    Before this PR, this second command failed with this error, which seems to indicate that it was trying to use the bundle.directory value instead of (or as well as) the --directory value:
    info ::d.b.f.StopwatchFilter :: changelog bundle :: Starting...
    error::d.b.d.Log             :: Directory does not exist (docs/changelog:0)
    The following errors and warnings were found in the documentation
    Error: Directory does not exist
    NOTE: docs/changelog
    After this PR, the second command succeeds (i.e. it no longer returns this error and bundles the changelog from the directory that was specified in --directory).

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
@lcawl lcawl marked this pull request as ready for review February 24, 2026 21:18
@lcawl lcawl requested a review from a team as a code owner February 24, 2026 21:18
@lcawl lcawl requested a review from reakaleek February 24, 2026 21:18
@lcawl lcawl merged commit 696ad8f into main Feb 24, 2026
30 of 31 checks passed
@lcawl lcawl deleted the bundle-directory 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