Skip to content

Conversation

@balagan73
Copy link
Contributor

#976

  • Add AI generated PRs to release notes.

@balagan73
Copy link
Contributor Author

curl_close is deprecated, close is handled automatically in php > 8.0

@balagan73 balagan73 requested a review from AronNovak January 29, 2026 09:34
}
preg_match_all('!#([0-9]+)!', $pr->body, $issue_matches);
$preg_pattern = '!#([0-9]+)!';
if (isset($pr->user->type) && $pr->user->type === 'Bot') {
Copy link
Member

@amitaibu amitaibu Jan 29, 2026

Choose a reason for hiding this comment

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

There is a link on the PR to the original issue (on AI and human PRs as well)

Image

Copy link
Member

Choose a reason for hiding this comment

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

So can we remove this block of code, and look for the link. As also devs will be encouraged to drop the #123 in the body text

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@amitaibu Getting the issue number now via graphQL call, as it is not available via Rest API. I did not remove the existing function, but left it as a fallback if the Development section is not filled out.

@balagan73 balagan73 linked an issue Jan 29, 2026 that may be closed by this pull request
@balagan73 balagan73 requested a review from amitaibu January 29, 2026 12:34
Copy link
Collaborator

@mariano-dagostino mariano-dagostino left a comment

Choose a reason for hiding this comment

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

I think there is a bug when pulling the name of the pr. Tried this in another project and this is what I see:

- Autocomplete: Subject, country, city facet doesn't display [1.5h] (#2602)
  - Fix autocomplete when the same word appears multiple times (#2620)
  - Remove city from autocomplete search results (#2613)
  - Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> (#2610)

In the last case, the PR had a different name but requesting the review from copilot made the title of the PR incorrect.

Copy link
Collaborator

@mariano-dagostino mariano-dagostino left a comment

Choose a reason for hiding this comment

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

@balagan73 Thanks looks good for me. I tried in another project with correct results this time.

I added a few comments to some places where I see we can simplify the code.

]);

$ch = curl_init('https://api.github.com/graphql');
curl_setopt($ch, CURLOPT_USERAGENT, 'Drupal Starter Release Notes Generator');
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we need this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Same thing we have at line 252.

Comment on lines +344 to +350
foreach ($linked_issues as $linked_issue) {
// Only include issues from the same repository.
$issue_repo = $linked_issue['repository']['name'] ?? '';
$issue_owner = $linked_issue['repository']['owner']['login'] ?? '';
if ($issue_repo !== $repo || $issue_owner !== $owner) {
continue;
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

I wonder if this check is really necessary as the graphql already specifies the repo.

Copy link
Contributor Author

@balagan73 balagan73 Feb 3, 2026

Choose a reason for hiding this comment

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

Most probably not, but as an edge case linked issues can be in a different repo. I think it doesn't hurt to have this extra check.

}

$preg_pattern = '!#([0-9]+)!';
if (isset($pr->user->type) && $pr->user->type === 'Bot') {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I wonder if the Bot check here is really necessary. As this is a fallback method maybe we should check the preg_pattern first and if no result check the second preg_patter.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point.

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.

Add AI generated PRs to release notes

4 participants