Skip to content

refactor(release): update note formatting in release previews#67

Merged
goosewobbler merged 4 commits intomainfrom
fix/release-preview-formatting
Mar 26, 2026
Merged

refactor(release): update note formatting in release previews#67
goosewobbler merged 4 commits intomainfrom
fix/release-preview-formatting

Conversation

@goosewobbler
Copy link
Copy Markdown
Owner

@goosewobbler goosewobbler commented Mar 26, 2026

[!NOTE], [!WARNING] and [!IMPORTANT] don't display correctly in github comments.

  • Changed the formatting of note messages in the getLabelBanner and formatPreviewComment functions from [!NOTE] to **Note:** for improved clarity and consistency in release previews.
  • Updated unit tests to reflect the new note formatting, ensuring that the changes are accurately represented in the test outputs.

- Changed the formatting of note messages in the `getLabelBanner` and `formatPreviewComment` functions from `[!NOTE]` to `**Note:**` for improved clarity and consistency in release previews.
- Updated unit tests to reflect the new note formatting, ensuring that the changes are accurately represented in the test outputs.
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 26, 2026

Release Preview — no release

No release label detected.
Note: Add release:patch, release:minor, or release:major to trigger a release.


Updated automatically by ReleaseKit

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Mar 26, 2026

Greptile Summary

This PR replaces GitHub-flavored markdown alert syntax ([!NOTE], [!WARNING], [!IMPORTANT]) with plain bold-text equivalents (**Note:**, **Warning:**, **Important:**) in release preview comments. The motivation is correct — those GFM alert directives don't render in GitHub PR comment threads, only in markdown files and wiki pages.

Key changes:

  • getLabelBanner: three GFM alert cases replaced with inline bold prefixes; the noBumpLabel case splits into two blockquote lines ("No release label detected." + "Note: Add …") to preserve the two-sentence structure of the original alert
  • getNoChangesMessage: per-strategy messages no longer carry their own > prefix or "No releasable changes detected." preamble — both are now applied at the single call-site in formatPreviewComment via a template literal
  • formatPreviewComment: no-changes note consolidated to a single > **Note:** No releasable changes detected. ${…} push
  • Tests updated to match new strings; two [!NOTE] assertions correctly removed for bump-label-in-label-mode paths where no note prefix is emitted in the new implementation

Confidence Score: 5/5

Safe to merge — straightforward formatting-only change with full test coverage

All changes are cosmetic string substitutions in a pure formatting function; no logic paths are added or removed, the TypeScript types are unaffected, and every modified assertion in the test suite correctly reflects the new output strings. No regressions are expected.

No files require special attention

Important Files Changed

Filename Overview
packages/release/src/preview-format.ts Replaces GitHub-flavored [!NOTE]/[!WARNING]/[!IMPORTANT] alert syntax with plain bold-text equivalents; also collapses getNoChangesMessage prefixes into the single call-site template literal
packages/release/test/unit/preview-format.spec.ts Test expectations updated to match new bold-text formatting; two [!NOTE] assertions removed for label-mode bump-label tests where no note prefix is emitted in the new code

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[formatPreviewComment] --> B{result == null?}
    B -- yes --> C[getLabelBanner]
    B -- no --> D[getLabelBanner]
    C --> E{labelContext.trigger}
    D --> E
    E -- commit + skip --> F["> **Warning:** This PR is marked to skip release."]
    E -- commit + major --> G["> **Important:** This PR is labeled for a **major** release."]
    E -- label + noBumpLabel --> H["> No release label detected. / > **Note:** Add label"]
    E -- label + bumpLabel --> I["> This PR is labeled for a **bumpLabel** release."]
    E -- none --> J["[]"]
    B -- yes --> K{noBumpLabel?}
    K -- no --> L["> **Note:** No releasable changes detected. getNoChangesMessage"]
    K -- yes --> M[skip note push]
Loading

Reviews (4): Last reviewed commit: "refactor(release): simplify no changes m..." | Re-trigger Greptile

@goosewobbler goosewobbler added the bump:minor Release a minor version label Mar 26, 2026
…n release previews

- Updated the formatting of warning and important messages in the `getLabelBanner` function to enhance clarity, changing from `[!WARNING]` and `[!IMPORTANT]` to `**Warning:**` and `**Important:**`.
- Adjusted related unit tests to verify the new message formats, ensuring consistency in the output of release previews.
…g in release previews

- Consolidated warning and important messages in the `getLabelBanner` function for improved readability by removing unnecessary line breaks.
- Updated unit tests to reflect the changes in message formatting, ensuring consistency in the output of release previews.
- Removed redundant phrasing from the no changes messages in the `getNoChangesMessage` function for improved clarity.
- Updated the `formatPreviewComment` function to reflect the changes in message formatting, ensuring consistency in the output of release previews.
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