Skip to content

fix(release): baseline preview notes on last prior release - #579

Merged
Wibias merged 2 commits into
lidge-jun:devfrom
Wibias:fix/release-notes-preview-baseline
Jul 28, 2026
Merged

fix(release): baseline preview notes on last prior release#579
Wibias merged 2 commits into
lidge-jun:devfrom
Wibias:fix/release-notes-preview-baseline

Conversation

@Wibias

@Wibias Wibias commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Preview release notes now baseline the newest prior stable or preview tag, so 2.7.43-preview after 2.7.42 uses v2.7.42 → v2.7.43-preview instead of restating v2.7.41-preview → v2.7.42.
  • Stable releases still baseline the prior stable only and keep the existing matching-preview carry into latest.
  • Adds previousReleaseNotesTag helper + CLI + regressions for the skipped-preview-after-stable case.

Test plan

  • bun test --isolate tests/release-notes.test.ts tests/ci-workflows.test.ts
  • Dry-run or next preview cut: confirm Full Changelog / generate-notes start at the prior stable when no intervening preview exists

Summary by CodeRabbit

  • Bug Fixes

    • Improved release-note baselining for stable and preview releases.
    • Ensured “Full Changelog” comparisons consistently reference the correct previous release.
  • Tests

    • Added coverage for preview-to-stable, preview-to-preview, and fallback release scenarios.
    • Strengthened validation of release workflow behavior.

Preview generate-notes was channel-isolated (preview to preview only), so cutting 2.7.43-preview after a stable 2.7.42 with no matching preview restated the stable changelog. Preview baselines now use the newest prior stable or preview tag; stable still baselines prior stable and carries matching preview notes.
@github-actions github-actions Bot added the bug Something isn't working label Jul 28, 2026
@coderabbitai

coderabbitai Bot commented Jul 28, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@Wibias, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 38 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 5987275c-3dcf-48d2-8d21-883c45026af2

📥 Commits

Reviewing files that changed from the base of the PR and between f9f8c3a and f423bbc.

📒 Files selected for processing (2)
  • scripts/release-notes.ts
  • tests/release-notes.test.ts
📝 Walkthrough

Walkthrough

The release workflow now computes previous_tag through a shared release-notes.ts command. The helper applies channel-aware stable and preview rules, with unit and workflow tests covering baseline selection and CLI integration.

Changes

Release baseline tag selection

Layer / File(s) Summary
Baseline selection rules
scripts/release-notes.ts, tests/release-notes.test.ts
Adds shared numeric-aware tag sorting and previousReleaseNotesTag, with tests for stable, preview, fallback, and no-match cases.
Release-notes CLI command
scripts/release-notes.ts
Adds the previous-release-tag <version> command, outputs the selected baseline tag, and updates CLI help text.
Release workflow integration
.github/workflows/release.yml, tests/ci-workflows.test.ts
Uses merged Git tags and the new command for both workflow baseline calculations; tests require the invocation and reject the previous preview-only filtering pattern.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant ReleaseWorkflow
  participant Git
  participant ReleaseNotesCLI
  participant BaselineHelper
  ReleaseWorkflow->>Git: List merged version tags
  Git-->>ReleaseWorkflow: Version tag list
  ReleaseWorkflow->>ReleaseNotesCLI: previous-release-tag RELEASE_VERSION
  ReleaseNotesCLI->>BaselineHelper: Select previous release-note tag
  BaselineHelper-->>ReleaseNotesCLI: Baseline tag or null
  ReleaseNotesCLI-->>ReleaseWorkflow: Print baseline tag
Loading

Possibly related PRs

  • lidge-jun/opencodex#364: Both changes modify release workflow handling of the previous_tag used for release notes and changelog comparison.

Suggested labels: bug

Suggested reviewers: ingwannu, lidge-jun

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: updating release-note baselines for preview releases to use the last prior release.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@Wibias

Wibias commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review
@codex review

@coderabbitai

coderabbitai Bot commented Jul 28, 2026

Copy link
Copy Markdown

@Wibias: I’ll review the changes in #579, focusing on release-tag selection and the preview/stable regression coverage.

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@scripts/release-notes.ts`:
- Around line 49-59: Update previousReleaseNotesTag to filter candidates using
SemVer-aware comparison, retaining only tags strictly older than the normalized
target release rather than merely excluding the exact tag. Preserve the existing
preview filtering and select the newest remaining prior tag; add a regression
test covering a newer preview candidate such as v2.8.0-preview.1 for target
2.7.43-preview.20260728.
🪄 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: ASSERTIVE

Plan: Pro Plus

Run ID: aa30df7f-b341-4f64-9758-886fba9db3fc

📥 Commits

Reviewing files that changed from the base of the PR and between de35caa and f9f8c3a.

📒 Files selected for processing (4)
  • .github/workflows/release.yml
  • scripts/release-notes.ts
  • tests/ci-workflows.test.ts
  • tests/release-notes.test.ts

Comment thread scripts/release-notes.ts

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f9f8c3a051

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/release-notes.ts Outdated
Exclude tags newer than the target and rank stable after matching
previews so generate-notes does not pick the wrong previous release.
@Wibias

Wibias commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review
@codex review

Addressed both findings in f423bbc:

  • SemVer-aware compare ranks stable after matching previews
  • Candidates must be strictly older than the target (ignores newer tags like v2.8.0-preview.1)

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@coderabbitai

coderabbitai Bot commented Jul 28, 2026

Copy link
Copy Markdown
🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

git show --stat --oneline --decorate f423bbc2
git diff f423bbc2^ f423bbc2 -- scripts/release-notes.ts tests/release-notes.test.ts .github/workflows/release.yml tests/ci-workflows.test.ts

ast-grep outline scripts/release-notes.ts --items all
ast-grep outline tests/release-notes.test.ts --items all

printf '\n--- release-note helper and CLI references ---\n'
rg -n -C 8 'previousReleaseNotesTag|sortVersionTagsAscending|previous-release-tag|compare' \
  scripts/release-notes.ts tests/release-notes.test.ts

printf '\n--- workflow baseline call sites ---\n'
rg -n -C 8 'previous-release-tag|previous_tag|RELEASE_VERSION' \
  .github/workflows/release.yml tests/ci-workflows.test.ts

Length of output: 61464


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '%s\n' '--- line-numbered changed helper/tests ---'
nl -ba scripts/release-notes.ts | sed -n '16,122p'
nl -ba tests/release-notes.test.ts | sed -n '56,102p'

printf '%s\n' '--- version/tag validation and release-version conventions ---'
rg -n -i -C 4 \
  '(semver|sem-ver|release.?version|inputs\.version|version.*regex|regex.*version|preview\.)' \
  --glob '!node_modules/**' --glob '!dist/**' --glob '!build/**' \
  package.json .github scripts tests README.md 2>/dev/null || true

printf '%s\n' '--- tracked release tags, if available in this checkout ---'
git tag --list 'v[0-9]*' | tail -n 40

Length of output: 1024


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '%s\n' '--- line-numbered changed helper/tests ---'
awk 'NR >= 16 && NR <= 122 { printf "%6d  %s\n", NR, $0 }' scripts/release-notes.ts
awk 'NR >= 56 && NR <= 102 { printf "%6d  %s\n", NR, $0 }' tests/release-notes.test.ts

printf '%s\n' '--- version/tag validation and release-version conventions ---'
rg -n -i -C 4 \
  '(semver|sem-ver|release.?version|inputs\.version|version.*regex|regex.*version|preview\.)' \
  --glob '!node_modules/**' --glob '!dist/**' --glob '!build/**' \
  package.json .github scripts tests README.md 2>/dev/null || true

printf '%s\n' '--- tracked release tags, if available in this checkout ---'
git tag --list 'v[0-9]*' | tail -n 40 || true

Length of output: 67296


@Wibias: Static re-review of f423bbc2 found no new actionable issues.

The reported fixes are correctly applied:

  • scripts/release-notes.ts Lines 63-75 now orders prereleases before the corresponding stable release, so v2.7.42 is selected over v2.7.42-preview.*.
  • Line 116 filters to candidates that compare strictly older than the target, excluding future tags such as v2.8.0-preview.1.
  • tests/release-notes.test.ts Lines 87-98 add direct regression coverage for both cases.
  • Both release-workflow baseline call sites use the shared previous-release-tag helper.

I did not execute the test suite because repository executables are unavailable in this review sandbox.

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@Wibias
Wibias merged commit ece0d9f into lidge-jun:dev Jul 28, 2026
14 of 15 checks passed
@Wibias
Wibias deleted the fix/release-notes-preview-baseline branch July 28, 2026 00:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant