Make WordPress Core

Opened 3 months ago

Closed 3 months ago

Last modified 3 months ago

#62817 closed feature request (fixed)

Automatically close pull requests when referenced ticket is fixed

Reported by: desrosj's profile desrosj Owned by: desrosj's profile desrosj
Milestone: 6.8 Priority: normal
Severity: normal Version:
Component: Build/Test Tools Keywords: has-patch
Focuses: Cc:

Description

There are currently over 2,000 open pull requests on GitHub for wordpress-develop. Many of these were likely left open after a fix was merged into SVN.

There should be a GitHub Action that parses commit messages for fixed ticket numbers and searches all open pull requests for references to that ticket in the description. This is documented as a requirement in the handbook for using GitHub for contributing. These tickets should be closed with a comment detailing why it was closed.

Change History (12)

This ticket was mentioned in PR #8139 on WordPress/wordpress-develop by @desrosj.


3 months ago
#1

This introduces a workflow that finds pull requests referencing any fixed tickets in commit messages.

Trac ticket: https://core.trac.wordpress.org/ticket/62817

@desrosj commented on PR #8139:


3 months ago
#2

This is difficult to test, however I've tested pretty extensively in my fork.

#3 @desrosj
3 months ago

I've attached a pull request that accomplishes this on push events.

In the future, this could be expanded to check recently closed tickets on Trac that don't have an associated commit. For example, ones that are closed as wontfix (props @johnbillion for that idea).

Props should also go to @davidbaumwald for listening to me and giving feedback when I initially played around with this idea 2-3 years ago.

Last edited 3 months ago by desrosj (previous) (diff)

@peterwilsoncc commented on PR #8139:


3 months ago
#4

I think the GitHub link in the comment will need to use the full URL for the trac integration in order to show links.

But let me test to be sure:
Trac reference via r prefix: r59656
Trac prefix linked: r59656
GH Hash only: ab4b4eb55d14feb74d34647c7aa4eb370dbd87a8
GH Link: https://github.com/WordPress/wordpress-develop/commit/ab4b4eb55d14feb74d34647c7aa4eb370dbd87a8

If I am not confused by how the integration works, this should show up as https://core.trac.wordpress.org/ticket/62817#comment:4

@swissspidy commented on PR #8139:


3 months ago
#5

I think the GitHub link in the comment will need to use the full URL for the trac integration in order to show links.

You mean the full link to the commit hash, not just ${{ github.sha }}?

@desrosj commented on PR #8139:


3 months ago
#6

Testing one other GH commit link format:

GH Link: ab4b4eb55d14feb74d34647c7aa4eb370dbd87a8

#7 @desrosj
3 months ago

  • Owner set to desrosj
  • Resolution set to fixed
  • Status changed from new to closed

In 59661:

Build/Test Tools: Auto-close linked PRs on GitHub.

There are currently ~2,000 open pull requests on GitHub for wordpress-develop. Many of these were for testing changes that have already been merged.

To help prevent orphaned pull requests, this new workflow will search for any pull requests referencing the Fixed Trac tickets as noted in the commit message and close them out. For now, this only happens for push events.

Props peterwilsoncc, swissspidy, johnbillion, davidbaumwald.
Fixes #62817.

@desrosj commented on PR #8139:


3 months ago
#9

@peterwilsoncc It looks like the comment did not make its way to Trac. I think that is likely due to the fact that we're ignoring comments from the GitHub Actions bot to avoid the playground and other comments from being posted on Trac tickets.

I think this is probably fine, but wanted to make sure there are no strong feelings otherwise.

@johnbillion commented on PR #8139:


3 months ago
#10

I think that's preferable! Saves unnecessary noise on the ticket.

#11 @desrosj
3 months ago

Let's continue the discussion for previously closed tickets on #61887.

@peterwilsoncc commented on PR #8139:


3 months ago
#12

@desrosj Yes, I'm fine with that too.

Note: See TracTickets for help on using tickets.