Skip to content

refactor(changelog): update changelog generation process and format#1528

Closed
Ipriyankrajai wants to merge 5 commits into
superset-sh:mainfrom
Ipriyankrajai:pri/ss-7-change-log-on-release
Closed

refactor(changelog): update changelog generation process and format#1528
Ipriyankrajai wants to merge 5 commits into
superset-sh:mainfrom
Ipriyankrajai:pri/ss-7-change-log-on-release

Conversation

@Ipriyankrajai
Copy link
Copy Markdown
Contributor

@Ipriyankrajai Ipriyankrajai commented Feb 16, 2026

  • Changed the prompt for generating changelogs to reflect version-based entries instead of weekly ones.
  • Updated instructions to find PRs merged since the previous tag and to check for existing changelogs based on version.
  • Modified the changelog file naming convention to include the version number.
  • Enhanced the changelog output format to include version information in the frontmatter and display it in the changelog entries.
  • Updated GitHub Actions workflow to trigger on tag pushes and extract version information for changelog generation.

Description

Related Issues

Type of Change

  • Bug fix
  • New feature
  • Documentation
  • Refactor
  • Other (please describe):

Testing

Screenshots (if applicable)

Additional Notes

Summary by CodeRabbit

  • New Features
    • Changelogs are now generated and tracked by release version (tag) instead of by week/date.
    • Workflow/manual triggers accept a validated version (X.Y.Z) that propagates to branch/PR names, titles, and bodies.
    • Changelog creation now checks for existing versioned changelogs and skips duplicates.
    • Files use version-aware naming and include explicit version in frontmatter.
    • Listings, RSS titles, and displayed dates now show version-aware formatting.

- Changed the prompt for generating changelogs to reflect version-based entries instead of weekly ones.
- Updated instructions to find PRs merged since the previous tag and to check for existing changelogs based on version.
- Modified the changelog file naming convention to include the version number.
- Enhanced the changelog output format to include version information in the frontmatter and display it in the changelog entries.
- Updated GitHub Actions workflow to trigger on tag pushes and extract version information for changelog generation.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Feb 16, 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
📝 Walkthrough

Walkthrough

Replaces date-based changelog generation with a version-based workflow: extract/validate VERSION from release tag or input, drive prompts/branch/PR naming and file frontmatter by VERSION, add version-aware date formatting across changelog utilities, UI components, and RSS feed titles.

Changes

Cohort / File(s) Summary
CI prompts & workflow
\.github/prompts/generate-changelog.md, \.github/workflows/generate-changelog.yml
Switch from weekly/date triggers to version-driven flow: extract/validate VERSION (from release tag or input), export it, include Version: X.Y.Z in prompts, use VERSION in branch/PR names, commits, prompts, and changelog generation; replace npm-based Claude invocation with Bun-based setup.
Changelog model & utils
apps/marketing/src/lib/changelog-utils.ts, apps/marketing/src/lib/changelog.ts
Add optional version?: string to ChangelogEntry; introduce formatVersionDate(version, date, separator?); parse version from frontmatter and update exported types/formatter usage.
UI components & feeds
apps/marketing/src/app/changelog/components/ChangelogCard/ChangelogCard.tsx, apps/marketing/src/app/changelog/components/ChangelogEntry/ChangelogEntry.tsx, apps/marketing/src/app/changelog/[slug]/components/ChangelogEntryLayout/ChangelogEntryLayout.tsx, apps/marketing/src/app/changelog/[slug]/opengraph-image.tsx, apps/marketing/src/app/changelog.xml/route.ts
Replace date-only formatter calls with formatVersionDate(entry.version, entry.date); update RSS item titles to prefix v{version} — when version exists. No structural rendering changes.
Generated file conventions & templates
\.github/prompts/generate-changelog.md (templates)
Move version into frontmatter (version: X.Y.Z), change filename guidance to date-descriptive slugs (remove embedding version in filename), update examples, exact format blocks, and prompt wording to be version-centric.

Sequence Diagram

sequenceDiagram
    participant Git as Git (tag push / dispatch)
    participant WF as GitHub Workflow
    participant AI as Claude Code
    participant Gen as Changelog Generator
    participant UI as Marketing UI / Feed

    Git->>WF: tag push or workflow_dispatch
    WF->>WF: extract & validate VERSION (from tag or input)
    WF->>AI: invoke prompt prefixed with "Version: X.Y.Z"
    AI->>Gen: produce changelog file with frontmatter `version: X.Y.Z`
    Gen->>WF: commit file and open PR `changelog/vX.Y.Z-{RUN_ID}`
    WF->>UI: merged file available
    UI->>UI: render entries using formatVersionDate(version, date)
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Poem

🐰 I hopped from tag to CI with delight,

vX.Y.Z tucked in frontmatter tight,
Prompts and branches call the name,
Cards and feeds now sing the same,
A little hop for changelog light.

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description provides a bullet-point summary of changes at the top, but most required template sections (Related Issues, Type of Change, Testing, etc.) are empty placeholders with no actual content filled in. Fill in the required template sections: select a Type of Change checkbox, describe testing performed, and add any related issues or additional notes. The initial summary is helpful but does not replace template completion.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: refactoring the changelog generation process to be version-based instead of weekly.

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

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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: 3

🤖 Fix all issues with AI agents
In @.github/prompts/generate-changelog.md:
- Around line 27-29: The "check for existing changelog" step currently looks for
the full filename including the date and will miss previously created files when
a tag is re-pushed on a different date; update that check to match only the
version suffix (e.g., search for files matching "*-v{version}.mdx" or use a
regex like /-v\d+\.\d+\.\d+\.mdx$/) instead of the full "YYYY-MM-DD-vX.Y.Z.mdx"
string so duplicates are detected; modify the code that builds and compares
filenames in the "check for existing changelog" logic to extract or match on the
version portion (the "-vX.Y.Z.mdx" suffix) when deciding whether a changelog for
this version already exists.

In @.github/workflows/generate-changelog.yml:
- Around line 27-40: The VERSION extraction step (step id "version" using
INPUT_VERSION and GITHUB_REF) lacks sanitization and uses unquoted $VERSION
elsewhere; add validation to this step that accepts only a strict semantic
version pattern (e.g., regex like ^[0-9]+\.[0-9]+\.[0-9]+(-[A-Za-z0-9.-]+)?$),
strip any surrounding whitespace, and fail the job with a clear message if the
input doesn't match; when deriving from GITHUB_REF keep the existing parameter
expansion but still validate the result; export the validated value to
GITHUB_ENV/GITHUB_OUTPUT (e.g., VALID_VERSION) and replace all downstream uses
(branch creation, commit message, Claude prompt) to reference the validated
variable and always quote it in shell contexts ("${VALID_VERSION}") to prevent
injection or invalid branch names.

In `@apps/marketing/src/app/changelog.xml/route.ts`:
- Line 29: The <title> construction interpolates entry.version directly (in the
expression `${entry.version ? `v${entry.version} — ` :
""}${escapeXml(entry.title)}`) which is inconsistent with the XML-escaping used
for entry.title; update this to XML-escape the version component by passing the
version string through escapeXml (e.g., wrap the `v${entry.version} — ` portion
with escapeXml or escape only entry.version before composing) so that the entire
title content is safely escaped using the existing escapeXml helper.
🧹 Nitpick comments (3)
.github/prompts/generate-changelog.md (1)

9-12: git describe … HEAD^ may not find the correct previous tag.

git describe --tags --abbrev=0 --match "desktop-v*" HEAD^ finds the nearest reachable tag from the parent of HEAD, which only works when HEAD is the tagged commit itself. If the workflow checks out main or a detached HEAD at a different point, this won't reliably return the previous release tag. The fallback (git tag --sort=-v:refname … | head -2 | tail -1) is more robust — consider making it the primary recommendation or dropping the git describe variant to avoid confusion for the AI agent.

.github/workflows/generate-changelog.yml (1)

56-57: claude-code installed globally via npm while the rest of the project uses bun.

Not a correctness issue, but installing @anthropic-ai/claude-code with npm while using Bun for everything else is slightly inconsistent. This is fine if claude-code is a standalone CLI tool that doesn't need to share the project's dependency tree, but worth noting for consistency.

apps/marketing/src/app/changelog/components/ChangelogCard/ChangelogCard.tsx (1)

33-35: Consider extracting the repeated version-date formatting into a utility.

The pattern entry.version ? `v${entry.version} · ${formattedDate}` : formattedDate is duplicated across ChangelogCard, ChangelogEntryLayout, opengraph-image, and ChangelogEntry. A small helper in changelog-utils.ts would centralize the format and make future changes (e.g., tweaking the separator or prefix) a one-line fix.

♻️ Suggested helper in changelog-utils.ts
export function formatVersionDate(version: string | undefined, date: string): string {
  const formatted = formatChangelogDate(date);
  return version ? `v${version} · ${formatted}` : formatted;
}

Comment thread .github/prompts/generate-changelog.md Outdated
Comment thread .github/workflows/generate-changelog.yml
Comment thread apps/marketing/src/app/changelog.xml/route.ts Outdated
- Updated changelog generation instructions to improve clarity on finding previous tags and checking for existing changelogs.
- Introduced a new `formatVersionDate` utility to standardize version and date formatting across changelog components.
- Replaced instances of `formatChangelogDate` with `formatVersionDate` in various changelog components for consistency.
- Adjusted the changelog XML route to correctly format version titles.
- Updated GitHub Actions workflow to validate version format during changelog generation.
@Ipriyankrajai
Copy link
Copy Markdown
Contributor Author

Addressed all review feedback:

Nitpick comments:

  • git describe reliability — Made git tag --sort the primary approach, with git describe as a secondary alternative.
  • npm vs bun for CLI install — Switched to bun install -g for consistency.
  • Duplicate version-date formatting — Extracted a formatVersionDate() utility in changelog-utils.ts and updated all 4 components (ChangelogCard, ChangelogEntry, ChangelogEntryLayout, opengraph-image).

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.

🧹 Nitpick comments (2)
.github/workflows/generate-changelog.yml (1)

60-61: Pin @anthropic-ai/claude-code to a specific version.

An unpinned global install in CI means a breaking change or compromised release could silently break (or worse, compromise) this workflow. Pin it like Bun is pinned on Line 49.

Proposed fix
      - name: Install Claude Code
-        run: bun install -g `@anthropic-ai/claude-code`
+        run: bun install -g `@anthropic-ai/claude-code`@0.2.61

(Replace 0.2.61 with whatever version you're currently using.)

.github/prompts/generate-changelog.md (1)

9-12: Tag-finding command could fail if there's only one tag.

git tag --sort=-v:refname -l "desktop-v*" | head -2 | tail -1 returns an empty string when only a single desktop-v* tag exists (first release). Since this is a prompt for an AI agent that can reason about edge cases, it's low risk, but adding a brief note like "if no previous tag exists, include all PRs" would make the instruction more robust.

- Changed the GitHub Actions workflow to trigger on published release events instead of tag pushes.
- Updated version extraction logic to derive version from release tags, improving clarity and consistency in version handling.
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

🤖 Fix all issues with AI agents
In @.github/workflows/generate-changelog.yml:
- Around line 107-114: The PR body currently hardcodes the tag string
"desktop-v${VERSION}" in the --body section which can be misleading for
workflow_dispatch runs; update the workflow to conditionally include the tag
line by checking the trigger context (e.g., github.event_name or GITHUB_REF)
before adding `- **Tag**: desktop-v${VERSION}`, or change the wording to
indicate the tag is only applicable for release-triggered runs—modify the step
that builds the --body payload (the block using --body and VERSION) to either
omit the tag line when not on a release tag or append a conditional note
instead.
- Around line 74-76: The workflow currently injects the prompt via shell
expansion $(cat .github/prompts/generate-changelog.md) into the claude -p
argument which allows backticks/$ to be interpreted; change the invocation of
the claude CLI in the job to stop using command substitution and instead pass
the markdown prompt file via the CLI's safe input mechanism (e.g., use claude's
--input-file .github/prompts/generate-changelog.md or pipe the prompt on stdin)
while still prepending the "Version: $VERSION" text programmatically so the
claude -p invocation receives the Version header and the prompt content without
shell interpolation; update the claude -p call in the workflow accordingly (keep
the same --allowedTools flags).
🧹 Nitpick comments (1)
.github/workflows/generate-changelog.yml (1)

61-61: Pin @anthropic-ai/claude-code to a specific version.

The package version is unpinned, so each run may install a different version. A breaking change or behavioral shift in a new release could silently alter or break changelog generation. Pin it for reproducibility:

📌 Proposed fix
-        run: bun install -g `@anthropic-ai/claude-code`
+        run: bun install -g `@anthropic-ai/claude-code`@2.1.42

Comment thread .github/workflows/generate-changelog.yml Outdated
Comment thread .github/workflows/generate-changelog.yml Outdated
…rity

- Revised instructions for checking existing changelogs to use `grep` for better accuracy in identifying files with the specified version.
- Changed the filename format for new changelog entries to use a descriptive slug instead of the version number, enhancing SEO and clarity in file identification.
…ndling

- Updated the changelog generation script to use a more structured approach for outputting the version and prompt content.
- Added conditional logic to include a tag line in the changelog based on the event type, enhancing clarity for release events.
- Improved formatting of the changelog output to ensure consistent presentation of version information.
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.

🧹 Nitpick comments (1)
.github/workflows/generate-changelog.yml (1)

60-61: Pin @anthropic-ai/claude-code to a specific version.

The global install has no version constraint, so every run fetches whatever latest resolves to. A breaking CLI change would silently break this workflow with no code change on your side.

📌 Suggested fix
      - name: Install Claude Code
-        run: bun install -g `@anthropic-ai/claude-code`
+        run: bun install -g `@anthropic-ai/claude-code`@2.1.42

Pin to a version you've validated against. Current latest is 2.1.42.

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

In @.github/workflows/generate-changelog.yml around lines 60 - 61, The workflow
step named "Install Claude Code" installs `@anthropic-ai/claude-code` without a
version; update that step to pin the package to a specific validated version
(e.g., append `@2.1.42` to `@anthropic-ai/claude-code`) so the bun install -g
command installs a fixed CLI version and prevents silent breakage from upstream
breaking changes.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In @.github/workflows/generate-changelog.yml:
- Around line 60-61: The workflow step named "Install Claude Code" installs
`@anthropic-ai/claude-code` without a version; update that step to pin the package
to a specific validated version (e.g., append `@2.1.42` to
`@anthropic-ai/claude-code`) so the bun install -g command installs a fixed CLI
version and prevents silent breakage from upstream breaking changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant