Skip to content

[fix] Update the re pattern for the release notes section#62

Merged
tdcmeehan merged 1 commit intoprestodb:masterfrom
yhwang:fix-release-note-task
Mar 27, 2026
Merged

[fix] Update the re pattern for the release notes section#62
tdcmeehan merged 1 commit intoprestodb:masterfrom
yhwang:fix-release-note-task

Conversation

@yhwang
Copy link
Copy Markdown
Member

@yhwang yhwang commented Mar 26, 2026

Since the description may contain the Summary by Sourcery at the end, adjust the re pattern to accommondate this situation. The negative lookahead (?!\nSummary by) only stops when it encounters "\nSummary by". If that pattern doesn't exist, it continues to the end just like the old pattern.

@yhwang yhwang requested review from a team as code owners March 26, 2026 21:27
@sourcery-ai
Copy link
Copy Markdown

sourcery-ai bot commented Mar 26, 2026

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Adjusts the regex used to extract release notes so that it stops before an optional trailing "Summary by Sourcery" section and adds a regression test with a new fixture covering this scenario.

Class diagram for updated release note pattern in GenerateReleaseNotesTask

classDiagram
    class GenerateReleaseNotesTask {
        <<task>>
        - static Pattern IGNORED_COMMITS_PATTERN
        # static Pattern NO_RELEASE_NOTE_PATTERN
        # static Pattern RELEASE_NOTE_PATTERN
        - static Pattern HEADER_PATTERN
        + void execute()
        + String extractReleaseNotes(String commitMessage)
    }

    class TestCheckReleaseNotesTask {
        <<test>>
        + void testReleaseNotesWithTrailingSummary()
        + void testNoReleaseNotes()
        + void testValidReleaseNotes()
    }

    class Pattern {
        <<java_util_regex>>
        + matcher(String input) Matcher
    }

    GenerateReleaseNotesTask --> Pattern : uses
    TestCheckReleaseNotesTask --> GenerateReleaseNotesTask : tests
Loading

File-Level Changes

Change Details Files
Refine release note extraction pattern to ignore trailing "Summary by" content.
  • Update RELEASE_NOTE_PATTERN to require a newline after the header before capturing content.
  • Use a tempered dot/negative lookahead so matching stops before a line starting with "Summary by" if present.
  • Preserve multiline and dotall behavior so the pattern still captures multi-line release notes when no summary is present.
presto-release-tools/src/main/java/com/facebook/presto/release/tasks/GenerateReleaseNotesTask.java
Extend tests to cover release notes with trailing content.
  • Register a new release-notes test fixture that includes trailing content after the release notes section.
  • Ensure CheckReleaseNotesTask treats the new fixture as valid, confirming the updated regex behavior.
presto-release-tools/src/test/java/com/facebook/presto/release/tasks/TestCheckReleaseNotesTask.java
presto-release-tools/src/test/resources/release-notes-test/pr/release_notes_with_trailing_content.txt

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Copy Markdown

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey - I've left some high level feedback:

  • The updated RELEASE_NOTE_PATTERN now hard-requires a newline after == release note(s)? == (\w*\n), whereas the previous pattern also handled content that continued on the same line; consider making the newline optional so existing one-line release note formats continue to match.
  • The new regex with the negative lookahead for \nSummary by is quite dense; consider extracting the pattern into a named constant or adding a brief code comment explaining the intent (stop capture before the Summary by Sourcery footer while still consuming to EOF if absent) to aid future maintainers.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The updated `RELEASE_NOTE_PATTERN` now hard-requires a newline after `== release note(s)? ==` (`\w*\n`), whereas the previous pattern also handled content that continued on the same line; consider making the newline optional so existing one-line release note formats continue to match.
- The new regex with the negative lookahead for `\nSummary by` is quite dense; consider extracting the pattern into a named constant or adding a brief code comment explaining the intent (stop capture before the `Summary by Sourcery` footer while still consuming to EOF if absent) to aid future maintainers.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Since the description may contain the `Summary by Sourcery` at the end,
adjust the re pattern to accommondate this situation.
The negative lookahead (?!\nSummary by) only stops when it encounters
"\nSummary by". If that pattern doesn't exist, it continues to the end
just like the old pattern.

Signed-off-by: Yihong Wang <yh.wang@ibm.com>
@yhwang yhwang force-pushed the fix-release-note-task branch from a039d0e to f4600dd Compare March 26, 2026 21:37
@yhwang
Copy link
Copy Markdown
Member Author

yhwang commented Mar 26, 2026

Hey - I've left some high level feedback:

  • The updated RELEASE_NOTE_PATTERN now hard-requires a newline after == release note(s)? == (\w*\n), whereas the previous pattern also handled content that continued on the same line; consider making the newline optional so existing one-line release note formats continue to match.
  • The new regex with the negative lookahead for \nSummary by is quite dense; consider extracting the pattern into a named constant or adding a brief code comment explaining the intent (stop capture before the Summary by Sourcery footer while still consuming to EOF if absent) to aid future maintainers.

addressed these two items in the changes.

@yhwang
Copy link
Copy Markdown
Member Author

yhwang commented Mar 26, 2026

cc @tdcmeehan

@steveburnett
Copy link
Copy Markdown

Here's another, different failure:

https://github.com/prestodb/presto/actions/runs/23629090536/job/68824276560?pr=27422

Bad release notes for PR #0: expect section header, found [Differential Revision: D97920227]

in prestodb/presto#27422

@steveburnett
Copy link
Copy Markdown

Also affecting
prestodb/presto#27266

@tdcmeehan tdcmeehan merged commit 89c4f72 into prestodb:master Mar 27, 2026
2 checks passed
@yhwang yhwang deleted the fix-release-note-task branch March 27, 2026 17:22
@yhwang
Copy link
Copy Markdown
Member Author

yhwang commented Mar 27, 2026

@tdcmeehan, not sure what the next step is?
Have a new version of the presto-release-tools, publish, and update the dep of the presto repo?

@tdcmeehan
Copy link
Copy Markdown
Contributor

Yes, @unidevel can help

@unidevel
Copy link
Copy Markdown
Contributor

Sure, let me publish presto-release-tools first.

@unidevel
Copy link
Copy Markdown
Contributor

Failed, due to the maven central publising limitation, we can't publish this as executable jars.

 - Failed to process deployment: Error on building manifests: Unable to parse archive Details: Executable bundles are not supported. For Spring Boot applications, see: https://docs.spring.io/spring-boot/gradle-plugin/packaging.html#packaging-executable.configuring.launch-script

@unidevel
Copy link
Copy Markdown
Contributor

I will add a PR to publish executable jars to github, and we can then update related script to download it from github.

@unidevel
Copy link
Copy Markdown
Contributor

Created PR #63

unidevel added a commit to prestodb/presto that referenced this pull request Mar 31, 2026
#27466)

## Description
1. presto-release-tools can not be fetched due to maven central
publishing limitation
2. check maven central publishing requirements
3. add required `<name>` field to presto-lance 

## Motivation and Context
Depends on PRs:
- prestodb/presto-release-tools#65
- prestodb/presto-release-tools#64
- prestodb/presto-release-tools#63
- prestodb/presto-release-tools#62

## Impact
CI

## Test Plan
Tested with:
1. release note check action:
https://github.com/prestodb/presto/actions/runs/23815800338/job/69414865062?pr=27466
2. maven central publishing requirements check:
https://github.com/unix280/presto/actions/runs/23812452401/job/69402863222#step:8:76
3. Prepare release action in presto =>
https://github.com/unix280/presto/actions/runs/23812844511
4. Release notes PR => unix280#52
5. Release notes missing list file =>
https://github.com/unix280/presto/blob/release-notes-0.297/release-notes-missing-0.297.md

## Contributor checklist

- [ ] Please make sure your submission complies with our [contributing
guide](https://github.com/prestodb/presto/blob/master/CONTRIBUTING.md),
in particular [code
style](https://github.com/prestodb/presto/blob/master/CONTRIBUTING.md#code-style)
and [commit
standards](https://github.com/prestodb/presto/blob/master/CONTRIBUTING.md#commit-standards).
- [ ] PR description addresses the issue accurately and concisely. If
the change is non-trivial, a GitHub Issue is referenced.
- [ ] Documented new properties (with its default value), SQL syntax,
functions, or other functionality.
- [ ] If release notes are required, they follow the [release notes
guidelines](https://github.com/prestodb/presto/wiki/Release-Notes-Guidelines).
- [ ] Adequate tests were added if applicable.
- [ ] CI passed.
- [ ] If adding new dependencies, verified they have an [OpenSSF
Scorecard](https://securityscorecards.dev/#the-checks) score of 5.0 or
higher (or obtained explicit TSC approval for lower scores).

## Release Notes
Please follow [release notes
guidelines](https://github.com/prestodb/presto/wiki/Release-Notes-Guidelines)
and fill in the release notes below.

```
== NO RELEASE NOTE ==
```

## Summary by Sourcery

Update CI and release scripts to retrieve presto-release-tools from
GitHub releases using a configurable version instead of Maven Central.

CI:
- Change release-notes-check workflow to download the
presto-release-tools executable directly from GitHub releases and run it
from a temporary path.
- Make the release-notes-check workflow use a configurable
RELEASE_TOOLS_VERSION with a default of 0.13.

Deployment:
- Update release preparation workflow and release-notes script to use a
configurable RELEASE_TOOLS_VERSION (default 0.13) and fetch
presto-release-tools from GitHub releases instead of Maven.

Chores:
- Align release tooling version and retrieval method across CI workflows
and release scripts.
bibith4 pushed a commit to bibith4/presto that referenced this pull request Apr 1, 2026
prestodb#27466)

## Description
1. presto-release-tools can not be fetched due to maven central
publishing limitation
2. check maven central publishing requirements
3. add required `<name>` field to presto-lance 

## Motivation and Context
Depends on PRs:
- prestodb/presto-release-tools#65
- prestodb/presto-release-tools#64
- prestodb/presto-release-tools#63
- prestodb/presto-release-tools#62

## Impact
CI

## Test Plan
Tested with:
1. release note check action:
https://github.com/prestodb/presto/actions/runs/23815800338/job/69414865062?pr=27466
2. maven central publishing requirements check:
https://github.com/unix280/presto/actions/runs/23812452401/job/69402863222#step:8:76
3. Prepare release action in presto =>
https://github.com/unix280/presto/actions/runs/23812844511
4. Release notes PR => unix280#52
5. Release notes missing list file =>
https://github.com/unix280/presto/blob/release-notes-0.297/release-notes-missing-0.297.md

## Contributor checklist

- [ ] Please make sure your submission complies with our [contributing
guide](https://github.com/prestodb/presto/blob/master/CONTRIBUTING.md),
in particular [code
style](https://github.com/prestodb/presto/blob/master/CONTRIBUTING.md#code-style)
and [commit
standards](https://github.com/prestodb/presto/blob/master/CONTRIBUTING.md#commit-standards).
- [ ] PR description addresses the issue accurately and concisely. If
the change is non-trivial, a GitHub Issue is referenced.
- [ ] Documented new properties (with its default value), SQL syntax,
functions, or other functionality.
- [ ] If release notes are required, they follow the [release notes
guidelines](https://github.com/prestodb/presto/wiki/Release-Notes-Guidelines).
- [ ] Adequate tests were added if applicable.
- [ ] CI passed.
- [ ] If adding new dependencies, verified they have an [OpenSSF
Scorecard](https://securityscorecards.dev/#the-checks) score of 5.0 or
higher (or obtained explicit TSC approval for lower scores).

## Release Notes
Please follow [release notes
guidelines](https://github.com/prestodb/presto/wiki/Release-Notes-Guidelines)
and fill in the release notes below.

```
== NO RELEASE NOTE ==
```

## Summary by Sourcery

Update CI and release scripts to retrieve presto-release-tools from
GitHub releases using a configurable version instead of Maven Central.

CI:
- Change release-notes-check workflow to download the
presto-release-tools executable directly from GitHub releases and run it
from a temporary path.
- Make the release-notes-check workflow use a configurable
RELEASE_TOOLS_VERSION with a default of 0.13.

Deployment:
- Update release preparation workflow and release-notes script to use a
configurable RELEASE_TOOLS_VERSION (default 0.13) and fetch
presto-release-tools from GitHub releases instead of Maven.

Chores:
- Align release tooling version and retrieval method across CI workflows
and release scripts.
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.

4 participants