Fix changelog add and gh-release commands to follow repo, owner, and dir precedence pattern#2854
Merged
lcawl merged 3 commits intofeat/changelog-bundle-release-versionfrom Mar 5, 2026
Conversation
cotti
pushed a commit
that referenced
this pull request
Mar 5, 2026
…flow (#2843) * Enhance changelog add command with github release workflow * Enhance changelog bundle command with github release workflow * Enhance changelog remove command with github release workflow (#2844) * Fix changelog add and gh-release commands to follow repo, owner, and dir precedence pattern (#2854) * Remove duplicate content * More docs clarity * More docs cleanup
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
While testing #2843 I found some more areas for improvement.
In particular, the
changelog gh-releaseandchangelog addweren't aligning with the way the "changelog bundle" and "remove" commands are now resolving repo, owner, and changelog directory details from the changelog config file.Details
Fix: hang in
changelog add --release-version(Step 1)In
ChangelogCommand.Create, added theStartAsync/WaitForDrain/StopAsyncdrain triplet before each of the three earlyreturn 1statements inside the--release-versionblock (the--prsmutual exclusivity check, the--issuesmutual exclusivity check, and the missing--repocheck). This matches the pattern used everywhere else in the file and preventsServiceInvoker.DisposeAsyncfrom hanging on an unstarted collector.Feature: config fallbacks for
changelog add --release-versionBefore validating
--repo, the command now loadschangelog.ymland applies the same precedence chain used bychangelog bundleandchangelog remove:--repoCLI >bundle.repoinchangelog.yml--ownerCLI >bundle.ownerinchangelog.yml>"elastic"--outputCLI >bundle.directoryinchangelog.yml>./changelogs(service default)The error message for a missing repo now reads:
"--release-version requires --repo to be specified (or bundle.repo set in changelog.yml)."Feature: config fallback for
changelog gh-release--outputCLI >bundle.directoryinchangelog.yml>./changelogs(service default).Tests
ChangelogConfigurationTests.csverifying thatbundle.repo/bundle.owner/bundle.directoryare correctly parsed from config, that a missing bundle section returns null, and that a missing config file returnsChangelogConfiguration.Defaultwith a nullBundle.ReleaseVersionTests.csverifying that whenOutput = nullis passed toGitHubReleaseChangelogService, it defaults to./changelogsrelative to the current directory.Docs
changelog-add.md: Updated--output,--owner,--repo, and--release-versionoption descriptions to document the config fallbacks.changelog-gh-release.md: Updated--outputdescription and added a short example showing the command can be run without--outputwhenbundle.directoryis set.contribute/changelog.md: Updated all three--release-versionsections and thegh-releasesection to document the config fallbacks and show the minimal invocation example.Feature: config fallback for
changelog addChangelogCommand.CreateinChangelogCommand.cs:resolvedRepo,resolvedOwner,resolvedOutput) are now done once, before theif (releaseVersion != null)split, rather than only inside that block.--release-versionblock now uses the already-resolved values.CreateChangelogArgumentsconstruction (non-release-version path) now usesresolvedOwner,resolvedRepo, andresolvedOutputinstead of the raw CLI values.changelog-add.md:--output: "When used with--release-version" qualifier removed; it now simply says "Falls back tobundle.directory…".--ownerand--repo: Same — the qualifiers have been dropped.contribute/changelog.md:bundle.*fallbacks apply to allchangelog addmodes.--release-versionsubsections to say "This applies to allchangelog addmodes" instead of implying it's a--release-version-only feature.--prs 123 --repo elasticsearch(no--owner)resolvedOwner = bundle.owner ?? "elastic"→ works--prs 123withbundle.repoin configresolvedRepo = bundle.repo→ works--output,bundle.directorysetbundle.directory--prs https://...)Generative AI disclosure
Tool(s) and model(s) used: composer-1.5, clause-4.6-sonnet-medium