Skip to content

Fix release notes linter failing on LF-only and multi-line PR bodies - #2300

Open
IrvingMg wants to merge 1 commit into
shipwright-io:mainfrom
IrvingMg:fix/release-notes-linter-lf
Open

Fix release notes linter failing on LF-only and multi-line PR bodies#2300
IrvingMg wants to merge 1 commit into
shipwright-io:mainfrom
IrvingMg:fix/release-notes-linter-lf

Conversation

@IrvingMg

Copy link
Copy Markdown
Member

Changes

The release-notes-linter regex required CRLF line endings and a single-line note, so PRs whose body uses LF (edited via the API or gh CLI) or whose release note spans several lines (e.g. action required followed by a bullet list) failed despite a valid release-note block. This is currently failing on #2195 (LF-only NONE) and #2187 (multi-line action required).

  • Strip \r before matching so both CRLF and LF bodies pass
  • Allow multi-line notes, still requiring at least one non-blank line
  • Remove the stale "template left as-is" check (its text is not in this repository's PR template)
  • Fetch the PR body once

Verified by running the workflow's script locally against the bodies of #2187, #2195 and #2292 (pass) and a body without a block (fail). Same fix as shipwright-io/cli#406, extended for multi-line notes.

Developed with the assistance of Claude (Anthropic); reviewed by the author.

Related Issue

N/A

Type of PR

/kind bug

Submitter Checklist

  • Includes tests if functionality changed/was added
  • Includes docs if changes are user-facing
  • Kind label has been set
  • Release notes block has been filled in, or marked NONE

See the contributor guide
for details on coding conventions, github and prow interactions, and the code review process.

Release Notes

NONE

The release-note regex required CRLF line endings and a single-line
note, so PRs whose body uses LF (created via the API or gh CLI) or whose
note spans several lines (e.g. "action required" followed by a list)
failed even with a valid block. Strip CRs before matching so both styles
are accepted, allow multi-line notes while still requiring at least one
non-blank line, drop the stale template check that no longer matches the
PR template text, and fetch the PR body once.

Signed-off-by: Irving Mondragón <mirvingr@gmail.com>
@pull-request-size pull-request-size Bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Aug 23, 2026
@openshift-ci openshift-ci Bot added release-note-none Label for when a PR does not need a release note kind/bug Categorizes issue or PR as related to a bug. labels Aug 23, 2026
@openshift-ci
openshift-ci Bot requested review from dorzel and karanibm6 August 23, 2026 01:17
@openshift-ci

openshift-ci Bot commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign saschaschwarze0 for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kaizakin

Copy link
Copy Markdown
Member

the draft_release_notes script must be altered a bit. currently it strips away all the newlines and collapsing everything into a single line.

please check
https://github.com/shipwright-io/build/blob/main/.github/draft_release_notes.sh#L98

@kaizakin kaizakin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

if we're supporting bullet points as well? then ig we need to add some logic so the indentations are preserved

@IrvingMg what do you think?

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

Labels

kind/bug Categorizes issue or PR as related to a bug. release-note-none Label for when a PR does not need a release note size/S Denotes a PR that changes 10-29 lines, ignoring generated files.

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

3 participants