Skip to content

Add bundle release date command options#3072

Open
lcawl wants to merge 17 commits intomainfrom
bundle-release-date-options
Open

Add bundle release date command options#3072
lcawl wants to merge 17 commits intomainfrom
bundle-release-date-options

Conversation

@lcawl
Copy link
Copy Markdown
Contributor

@lcawl lcawl commented Apr 10, 2026

Relates to #3030
This PR is a follow-up to #3066

Overview

This PR implements comprehensive release date automation for changelog bundles, focusing on CI/CD workflows while maintaining flexibility for different use cases. The feature allows release dates to be automatically populated or omitted based on configuration.

Key Features

🚀 Automatic Release Date Population

  • Auto-population: Bundles automatically get today's date (UTC) when no explicit date is provided
  • GitHub Integration: changelog gh-release automatically uses the GitHub release published_at date
  • CLI Override: --release-date YYYY-MM-DD flag for explicit date specification
  • Preservation: Existing release dates in bundle YAML files are preserved during re-bundling

🎛️ Configurable Release Date Population

  • Profile-level override: bundle.profiles.<name>.release_dates for per-profile customization
  • Bundle-level config: bundle.release_dates to change default behavior in changelog config
  • CLI flag: --no-release-date to explicitly suppress date population

🔧 Profile Mode Enhancement

  • Seamless integration: Profile and option modes of changelog bundle behave identically
  • No manual editing: Eliminates need to manually update config files before releases

Major Files Changed

Configuration & Domain Models

  • BundleConfiguration.cs - Added ShowReleaseDates property (default: false)
  • Bundle.cs - Added ShowReleaseDates property to domain model
  • ChangelogConfigurationYaml.cs - YAML serialization support
  • ChangelogConfigurationLoader.cs - Configuration parsing logic

Core Services

  • ChangelogBundlingService.cs - Auto-population and profile resolution logic
  • GitHubReleaseChangelogService.cs - GitHub published_at date integration
  • GitHubReleaseService.cs - Extended GitHub API response parsing

Rendering Engine

  • ChangelogRenderingService.cs - Bundle-level rendering control
  • IndexMarkdownRenderer.cs - Conditional Markdown output
  • ChangelogAsciidocRenderer.cs - Conditional AsciiDoc output
  • ChangelogInlineRenderer.cs - Directive rendering updates

CLI Interface

  • ChangelogCommand.cs - Added --release-date and --no-release-date flags with validation

Documentation

  • Updated CLI docs (bundle.md, gh-release.md)
  • Enhanced syntax documentation (changelog.md)
  • Added contribution guidelines (contribute/changelog.md)
  • Updated example configuration (changelog.example.yml)

Usage Examples

CLI Commands

# Auto-populate with today's date (profile mode)
changelog bundle elasticsearch-release 9.1.0

# Specify explicit release date (option mode)
changelog bundle --all --release-date 2026-04-15

# Suppress release date entirely (option mode)
changelog bundle --all --no-release-date

# GitHub release with automatic date from published_at
changelog gh-release elastic/elasticsearch v9.1.0

# GitHub release with explicit override date
changelog gh-release elasticsearch v9.1.0 --release-date 2026-04-15

Configuration

# changelog.yml
bundle:
  release_dates: false
  profiles:
      elasticsearch:
         release_dates: true  # Include release dates in this type of bundle
         description: "Release {version} ({lifecycle})"

bundle.release_dates serves as a global default that affects all bundle operations, whether using profiles or command-line flags (unless overridden by profile-level setting or explicity command option).

This implementation prioritizes CI/CD automation while providing flexible control over release date rendering, supporting both automated workflows and manual release processes.

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: claude-sonnet-4

Copy link
Copy Markdown
Member

@Mpdreamz Mpdreamz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Base automatically changed from bundle-release-date to main April 15, 2026 21:34
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 15, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 89a10397-8313-4432-b13a-0babacf8b6fa

📥 Commits

Reviewing files that changed from the base of the PR and between da54410 and e672cd1.

📒 Files selected for processing (1)
  • src/services/Elastic.Changelog/Bundling/ChangelogBundlingService.cs
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/services/Elastic.Changelog/Bundling/ChangelogBundlingService.cs

📝 Walkthrough

Walkthrough

Adds configurable release-date behavior across changelog bundling: new nullable ReleaseDates on bundle and profile config; CLI flags --no-release-date and --release-date for bundle and --release-date for gh-release with validation; propagation of GitHub published_at into release handling; precedence for resolved release date (existing bundle → explicit CLI → GitHub published_at → UTC today unless suppressed); config discovery/serialization updates; renderer output gated on resolved bundle release date; and tests covering config and bundling behavior.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant CLI as ChangelogCommand
    participant Config as ChangelogConfigurationLoader
    participant GitHub as GitHubReleaseService
    participant Bundler as ChangelogBundlingService
    participant Output as Bundle YAML

    User->>CLI: run gh-release [--release-date]
    CLI->>GitHub: FetchReleaseFromUrl()
    GitHub-->>CLI: GitHubReleaseInfo (PublishedAt?)

    CLI->>Bundler: CreateChangelogsFromReleaseArguments (ReleaseDate?)
    alt ReleaseDate provided
        Bundler->>Bundler: validate yyyy-MM-dd
    else if release.PublishedAt present
        Bundler->>Bundler: derive ReleaseDate from PublishedAt (UTC)
    else
        Bundler->>Bundler: use UTC today (if not suppressed)
    end
    Bundler->>Output: write bundle.yaml with resolved release-date

    User->>CLI: run bundle [--no-release-date | --release-date]
    CLI->>Config: ParseBundleConfiguration()
    Config-->>CLI: BundleConfiguration / profiles (ReleaseDates?)
    CLI->>Bundler: BundleChangelogsArguments (SuppressReleaseDate, ReleaseDate?)
    Bundler->>Bundler: resolve final ReleaseDate (existing -> explicit -> auto unless suppressed)
    Bundler->>Output: write bundle.yaml with/without release-date
Loading

Possibly related PRs

Suggested labels

documentation

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 17.14% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: adding CLI command options for controlling bundle release dates.
Description check ✅ Passed The description is comprehensively related to the changeset, detailing the release date automation feature, configuration options, CLI flags, and affected files.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch bundle-release-date-options

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/tooling/docs-builder/Commands/ChangelogCommand.cs (1)

551-595: ⚠️ Potential issue | 🟠 Major

Propagate GitHub published_at in bundle --release-version mode.

Line 575 fetches the release, but that timestamp is never forwarded; Line 852 then passes null, so bundling falls back to UTC “today” instead of the release publish date.

Proposed fix
+using System.Globalization;
...
 				var release = await releaseService.FetchReleaseAsync(resolvedOwner, resolvedRepo, releaseVersion, ctx);
 				if (release == null)
 				{
 					collector.EmitError(string.Empty,
 						$"Failed to fetch release '{releaseVersion}' for {resolvedOwner}/{resolvedRepo}. Ensure the tag exists and credentials are set.");
 					return 1;
 				}
+
+				if (!noReleaseDate && string.IsNullOrWhiteSpace(releaseDate) && release.PublishedAt.HasValue)
+				{
+					releaseDate = DateOnly
+						.FromDateTime(release.PublishedAt.Value.UtcDateTime)
+						.ToString("yyyy-MM-dd", CultureInfo.InvariantCulture);
+				}

Also applies to: 851-853

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/tooling/docs-builder/Commands/ChangelogCommand.cs` around lines 551 -
595, You fetch the GitHub release via GitHubReleaseService.FetchReleaseAsync and
parse notes, but you never forward the release.PublishedAt timestamp; update the
code so that when a release is fetched (variable release) you capture
release.PublishedAt and pass it into the downstream bundling call that currently
gets null (the bundle creation / bundling invocation invoked later when building
the bundle from prs/parsedNotes). Concretely: after FetchReleaseAsync and before
setting prs from parsedNotes, store release.PublishedAt (or a UTC DateTime
derived from it) and thread that value into the bundle creation API call
(replace the null currently passed) so the bundling uses the release publish
date instead of falling back to today.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/Elastic.Documentation.Configuration/ReleaseNotes/BundleLoader.cs`:
- Around line 250-251: The conflict resolution for ShowReleaseDates in
BundleLoader.cs is currently order-dependent because mergedShowReleaseDates
falls back to first.Data?.ShowReleaseDates when multiple differing values exist;
change this to a deterministic fallback (e.g., false) so that
mergedShowReleaseDates = showReleaseDatesValues.Count == 1 ?
showReleaseDatesValues[0] : false, replacing the reference to
first.Data?.ShowReleaseDates and ensuring the resolution uses the
showReleaseDatesValues collection and a fixed default rather than the first
bundle's value.

In `@src/tooling/docs-builder/Commands/ChangelogCommand.cs`:
- Around line 851-853: The code currently sets ReleaseDate = noReleaseDate ?
null : releaseDate which loses the intent of --no-release-date; instead add a
boolean property (e.g., SuppressReleaseDate) to the object being constructed and
set it from noReleaseDate while leaving ReleaseDate to reflect only an explicit
date (Description = description, ReleaseDate = releaseDate /* or null only when
truly absent */, SuppressReleaseDate = noReleaseDate). Then update the bundling
service’s release-date resolution branch to check the new SuppressReleaseDate
flag (in addition to ReleaseDate) and treat SuppressReleaseDate as explicit
suppression of any resolved date.

---

Outside diff comments:
In `@src/tooling/docs-builder/Commands/ChangelogCommand.cs`:
- Around line 551-595: You fetch the GitHub release via
GitHubReleaseService.FetchReleaseAsync and parse notes, but you never forward
the release.PublishedAt timestamp; update the code so that when a release is
fetched (variable release) you capture release.PublishedAt and pass it into the
downstream bundling call that currently gets null (the bundle creation /
bundling invocation invoked later when building the bundle from
prs/parsedNotes). Concretely: after FetchReleaseAsync and before setting prs
from parsedNotes, store release.PublishedAt (or a UTC DateTime derived from it)
and thread that value into the bundle creation API call (replace the null
currently passed) so the bundling uses the release publish date instead of
falling back to today.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 4749e90b-7d10-4460-a2f4-a386a0109aae

📥 Commits

Reviewing files that changed from the base of the PR and between 08d43d9 and 5695a9d.

📒 Files selected for processing (22)
  • config/changelog.example.yml
  • docs/cli/changelog/bundle.md
  • docs/cli/changelog/gh-release.md
  • docs/syntax/changelog.md
  • src/Elastic.Documentation.Configuration/Changelog/BundleConfiguration.cs
  • src/Elastic.Documentation.Configuration/ReleaseNotes/Bundle.cs
  • src/Elastic.Documentation.Configuration/ReleaseNotes/BundleLoader.cs
  • src/Elastic.Documentation.Configuration/ReleaseNotes/ReleaseNotesSerialization.cs
  • src/Elastic.Documentation/ReleaseNotes/Bundle.cs
  • src/Elastic.Markdown/Myst/Directives/Changelog/ChangelogInlineRenderer.cs
  • src/services/Elastic.Changelog/Bundling/ChangelogBundlingService.cs
  • src/services/Elastic.Changelog/Configuration/ChangelogConfigurationLoader.cs
  • src/services/Elastic.Changelog/GitHub/GitHubReleaseService.cs
  • src/services/Elastic.Changelog/GitHub/IGitHubReleaseService.cs
  • src/services/Elastic.Changelog/GithubRelease/GitHubReleaseChangelogService.cs
  • src/services/Elastic.Changelog/Rendering/Asciidoc/ChangelogAsciidocRenderer.cs
  • src/services/Elastic.Changelog/Rendering/ChangelogRenderContext.cs
  • src/services/Elastic.Changelog/Rendering/ChangelogRenderingService.cs
  • src/services/Elastic.Changelog/Rendering/Markdown/IndexMarkdownRenderer.cs
  • src/services/Elastic.Changelog/Serialization/ChangelogConfigurationYaml.cs
  • src/tooling/docs-builder/Commands/ChangelogCommand.cs
  • tests/Elastic.Markdown.Tests/Directives/ChangelogBasicTests.cs

Comment thread src/Elastic.Documentation.Configuration/ReleaseNotes/BundleLoader.cs Outdated
Comment thread src/tooling/docs-builder/Commands/ChangelogCommand.cs
@coderabbitai coderabbitai bot added documentation Improvements or additions to documentation and removed feature labels Apr 15, 2026
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/services/Elastic.Changelog/GithubRelease/GitHubReleaseChangelogService.cs (1)

344-361: ⚠️ Potential issue | 🟠 Major

Don't pass GitHub published_at through ReleaseDate as an override.

BundleChangelogs treats any non-empty ReleaseDate as the explicit override path before it preserves an existing bundle date. Deriving releaseDate here means re-bundling an existing bundle will replace its stored date with published_at, which breaks the "preserve existing release dates" behavior. The GitHub date needs to stay a fallback that is applied only after the existing bundle metadata has been checked.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@src/services/Elastic.Changelog/GithubRelease/GitHubReleaseChangelogService.cs`
around lines 344 - 361, The code sets releaseDate to GitHub's published_at and
always passes it into BundleChangelogsArguments.ReleaseDate, which forces
BundleChangelogs to treat it as an explicit override; instead only pass a
ReleaseDate when the user explicitly provided one (input.ReleaseDate). In
GitHubReleaseChangelogService.cs remove or avoid assigning release.PublishedAt
into releaseDate for the bundleArgs; ensure
BundleChangelogsArguments.ReleaseDate is left null/empty unless
input.ReleaseDate is non-empty so the bundler can preserve existing bundle
metadata and only fall back to published_at later when appropriate.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/Elastic.Markdown/Myst/Directives/Changelog/ChangelogBlock.cs`:
- Around line 355-363: The auto-discovery only checks ".yml" filenames (the
candidates array in ChangelogBlock.cs) so "changelog.yaml" is missed; update the
candidates creation in the method that returns the discovered changelog path to
include the corresponding ".yaml" variants (e.g., add
Path.GetFullPath(Build.DocumentationSourceDirectory.ResolvePathFrom("changelog.yaml"))
and the "../changelog.yaml" and "../docs/changelog.yaml" equivalents) so
Build.ReadFileSystem.File.Exists can find either extension when resolving the
changelog file.
- Around line 295-313: LoadConfiguration currently uses
ShowReleaseDatesPattern()/regex to scan the file and can pick up a
top-level/profile show_release_dates instead of the bundle-level setting;
replace the regex scan with proper YAML parsing (e.g., load the YAML into a
node/object and read bundle.show_release_dates) inside LoadConfiguration so you
explicitly read the "bundle" mapping and its "show_release_dates" value
(preserve boolean parsing and fallback behavior), remove or stop relying on
ShowReleaseDatesPattern() for this lookup, and update the config auto-discovery
logic used by ResolveConfigPath() to include ".yaml" as a candidate extension in
addition to ".yml".

---

Outside diff comments:
In
`@src/services/Elastic.Changelog/GithubRelease/GitHubReleaseChangelogService.cs`:
- Around line 344-361: The code sets releaseDate to GitHub's published_at and
always passes it into BundleChangelogsArguments.ReleaseDate, which forces
BundleChangelogs to treat it as an explicit override; instead only pass a
ReleaseDate when the user explicitly provided one (input.ReleaseDate). In
GitHubReleaseChangelogService.cs remove or avoid assigning release.PublishedAt
into releaseDate for the bundleArgs; ensure
BundleChangelogsArguments.ReleaseDate is left null/empty unless
input.ReleaseDate is non-empty so the bundler can preserve existing bundle
metadata and only fall back to published_at later when appropriate.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 676f30b1-90b2-443f-9c2c-b490178563c9

📥 Commits

Reviewing files that changed from the base of the PR and between 5695a9d and d67277e.

📒 Files selected for processing (8)
  • src/Elastic.Documentation.Configuration/ReleaseNotes/BundleLoader.cs
  • src/Elastic.Markdown/Myst/Directives/Changelog/ChangelogBlock.cs
  • src/Elastic.Markdown/Myst/Directives/Changelog/ChangelogInlineRenderer.cs
  • src/services/Elastic.Changelog/Bundling/ChangelogBundlingService.cs
  • src/services/Elastic.Changelog/GithubRelease/GitHubReleaseChangelogService.cs
  • src/services/Elastic.Changelog/Rendering/ChangelogRenderingService.cs
  • src/tooling/docs-builder/Commands/ChangelogCommand.cs
  • tests/Elastic.Markdown.Tests/Directives/ChangelogBasicTests.cs
🚧 Files skipped from review as they are similar to previous changes (4)
  • src/Elastic.Documentation.Configuration/ReleaseNotes/BundleLoader.cs
  • src/services/Elastic.Changelog/Rendering/ChangelogRenderingService.cs
  • src/services/Elastic.Changelog/Bundling/ChangelogBundlingService.cs
  • src/tooling/docs-builder/Commands/ChangelogCommand.cs

Comment thread src/Elastic.Markdown/Myst/Directives/Changelog/ChangelogBlock.cs Outdated
Comment thread src/Elastic.Markdown/Myst/Directives/Changelog/ChangelogBlock.cs Outdated
@coderabbitai coderabbitai bot removed the documentation Improvements or additions to documentation label Apr 15, 2026
@coderabbitai coderabbitai bot added feature and removed documentation Improvements or additions to documentation labels Apr 15, 2026
@coderabbitai coderabbitai bot added documentation Improvements or additions to documentation and removed feature labels Apr 15, 2026
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/Elastic.Markdown/Myst/Directives/Changelog/ChangelogBlock.cs`:
- Around line 315-318: The code only reads config.Bundle?.ShowReleaseDates so
profile-level settings are ignored; change the logic to first check the
profile-specific value in the deserialized ChangelogDirectiveConfigYaml (e.g.
config.Bundle?.Profiles?[currentProfile]?.ShowReleaseDates) and only fall back
to config.Bundle?.ShowReleaseDates if the profile value is null/unspecified,
then assign the resolved boolean to ShowReleaseDates; locate the current profile
identifier from the build/profile context (e.g. Build.Profile?.Name or
equivalent) and use it to index into config.Bundle.Profiles when implementing
this override.
- Around line 338-348: The code currently trims the leading '/' into trimmedPath
before calling Path.IsPathRooted, which lets Unix absolute paths bypass the
absolute-path guard; fix by not stripping the leading slash and perform the
rooted check on the original ConfigPath (e.g., replace trimmedPath usage with
the raw ConfigPath in the Path.IsPathRooted call) or explicitly check for
Unix-style leading '/' (ConfigPath.StartsWith("/")) before proceeding; keep the
subsequent ResolvePathFrom/GetFullPath/ValidateConfigCandidate flow and still
call EmitError("Changelog config path must not be an absolute path.") and return
null when the path is absolute.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 54c39158-6794-4b2c-be4a-e232ace55ba4

📥 Commits

Reviewing files that changed from the base of the PR and between bd50396 and 72fbc96.

📒 Files selected for processing (1)
  • src/Elastic.Markdown/Myst/Directives/Changelog/ChangelogBlock.cs

Comment thread src/Elastic.Markdown/Myst/Directives/Changelog/ChangelogBlock.cs Outdated
Comment thread src/Elastic.Markdown/Myst/Directives/Changelog/ChangelogBlock.cs
@coderabbitai coderabbitai bot added feature and removed documentation Improvements or additions to documentation labels Apr 15, 2026
@coderabbitai coderabbitai bot added documentation Improvements or additions to documentation and removed feature labels Apr 15, 2026
@coderabbitai coderabbitai bot added feature and removed documentation Improvements or additions to documentation labels Apr 16, 2026
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/tooling/docs-builder/Commands/ChangelogCommand.cs (1)

777-797: ⚠️ Potential issue | 🟠 Major

--plan bypasses the new release-date validation.

Lines 777-797 return before Lines 799-826 run, so bundle --plan accepts invalid input like --no-release-date --release-date ..., bad date formats, and profile-mode release-date flags. That makes plan mode disagree with the real bundle execution path.

Also applies to: 799-826

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/tooling/docs-builder/Commands/ChangelogCommand.cs` around lines 777 -
797, The plan branch in ChangelogCommand.cs builds a BundleChangelogsArguments
and calls service.PlanBundleAsync but returns before the release-date validation
run later for the real bundle path, so --plan can accept invalid
release-date/profile flags; to fix, invoke the same validation routine (the
release-date/profile validation used in the non-plan flow) before returning in
the plan branch or reuse the central validation method that checks releaseDate,
--no-release-date, formats and profile-mode flags (ensure the same checks that
run after line ~799 are executed here), then only proceed to
SetOutputAsync/return 0 if validation passes; reference
BundleChangelogsArguments, service.PlanBundleAsync and
githubActionsService.SetOutputAsync to locate the code to update.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/services/Elastic.Changelog/Bundling/ChangelogBundlingService.cs`:
- Around line 475-476: ProcessProfile() currently computes
profileSuppressReleaseDate with profileSuppressReleaseDate =
!(profile.ReleaseDates ?? config.Bundle.ReleaseDates ?? true), but later code
(around where SuppressReleaseDate is set) reapplies the bundle default and
therefore lets bundle.release_dates:false override a profile's true; fix this by
using the resolved profile-level boolean (the result of profile.ReleaseDates ??
config.Bundle.ReleaseDates ?? true) when assigning the profile's
SuppressReleaseDate property (i.e., set SuppressReleaseDate to the negation of
that resolved value) so the explicit profile.ReleaseDates value is honored
instead of being overwritten by the bundle default.

---

Outside diff comments:
In `@src/tooling/docs-builder/Commands/ChangelogCommand.cs`:
- Around line 777-797: The plan branch in ChangelogCommand.cs builds a
BundleChangelogsArguments and calls service.PlanBundleAsync but returns before
the release-date validation run later for the real bundle path, so --plan can
accept invalid release-date/profile flags; to fix, invoke the same validation
routine (the release-date/profile validation used in the non-plan flow) before
returning in the plan branch or reuse the central validation method that checks
releaseDate, --no-release-date, formats and profile-mode flags (ensure the same
checks that run after line ~799 are executed here), then only proceed to
SetOutputAsync/return 0 if validation passes; reference
BundleChangelogsArguments, service.PlanBundleAsync and
githubActionsService.SetOutputAsync to locate the code to update.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 1d68b56c-0e1d-4ceb-9656-cd707b13011c

📥 Commits

Reviewing files that changed from the base of the PR and between 5fb179b and da54410.

📒 Files selected for processing (9)
  • config/changelog.example.yml
  • docs/syntax/changelog.md
  • src/Elastic.Documentation.Configuration/Changelog/BundleConfiguration.cs
  • src/services/Elastic.Changelog/Bundling/ChangelogBundlingService.cs
  • src/services/Elastic.Changelog/Configuration/ChangelogConfigurationLoader.cs
  • src/services/Elastic.Changelog/Serialization/ChangelogConfigurationYaml.cs
  • src/tooling/docs-builder/Commands/ChangelogCommand.cs
  • tests/Elastic.Changelog.Tests/Changelogs/BundleChangelogsTests.cs
  • tests/Elastic.Changelog.Tests/Changelogs/ChangelogConfigurationTests.cs
🚧 Files skipped from review as they are similar to previous changes (5)
  • src/services/Elastic.Changelog/Serialization/ChangelogConfigurationYaml.cs
  • src/services/Elastic.Changelog/Configuration/ChangelogConfigurationLoader.cs
  • config/changelog.example.yml
  • docs/syntax/changelog.md
  • src/Elastic.Documentation.Configuration/Changelog/BundleConfiguration.cs

Comment thread src/services/Elastic.Changelog/Bundling/ChangelogBundlingService.cs
@lcawl
Copy link
Copy Markdown
Contributor Author

lcawl commented Apr 16, 2026

Following discussion with @cotti I've pushed a commit with the following change in da54410:

  • Users can now set release_dates: false at the bundle level to suppress auto-populated release dates globally, or use profile-level overrides for more granular control.
  • release_dates replaces no_release_dates to align with other settings such as extract.release_notes

Completed Changes:

  1. ✅ Model + YAML DTO Updates

    • Added bool? ReleaseDates to BundleConfiguration
    • Replaced NoReleaseDates with ReleaseDates in BundleProfile
    • Updated corresponding YAML DTOs (BundleConfigurationYaml and BundleProfileYaml)
  2. ✅ Loader Updates

    • Updated ParseBundleConfiguration to map release_dates from YAML
    • Added bundle-level ReleaseDates mapping
    • Replaced profile-level NoReleaseDates with ReleaseDates
  3. ✅ Bundling Service Updates

    • Modified ApplyConfigDefaults to merge release date suppression logic
    • Updated ProcessProfile to use profile inheritance: !(profile.ReleaseDates ?? config.Bundle.ReleaseDates ?? true)
    • Both methods now correctly handle the inverted logic (positive semantics)
  4. ✅ CLI and Documentation Updates

    • Updated error message in ChangelogCommand.cs to reference both bundle and profile level release_dates
    • Updated config/changelog.example.yml with examples at both bundle and profile levels
    • Updated docs/syntax/changelog.md to document the positive semantics
  5. ✅ Comprehensive Tests Added

    • Configuration round-trip tests for bundle and profile levels
    • Profile inheritance testing (profile overrides bundle, null inherits)
    • Bundle behavior tests (with config release_dates: false and true)
    • All tests follow the established patterns in the codebase

Key Features Implemented:

  • Positive semantics: release_dates: true (default) auto-populates dates; false suppresses them
  • Profile inheritance: Profile release_dates overrides bundle setting; null inherits from bundle
  • Bundle-level default: Can now set bundle.release_dates: false to suppress dates globally without needing profiles
  • CLI precedence maintained: --no-release-date still takes precedence over configuration
  • No legacy support: Clean implementation with only release_dates (no no_release_dates migration needed)

Verification:

  • ✅ All modified projects compile successfully with 0 warnings and 0 errors
  • ✅ Changes follow the existing codebase patterns and conventions
  • ✅ Comprehensive test coverage mirrors existing test structures
  • ✅ Documentation updated consistently throughout

@coderabbitai coderabbitai bot added documentation Improvements or additions to documentation and removed feature labels Apr 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants