Make WordPress Core

Opened 3 years ago

Last modified 5 weeks ago

#54510 reviewing task (blessed)

Add a GitHub Action workflow which alerts contributors if they propose changes to third party files

Reported by: johnbillion's profile johnbillion Owned by: johnbillion's profile johnbillion
Milestone: 6.6 Priority: normal
Severity: normal Version:
Component: Build/Test Tools Keywords: good-first-bug has-patch
Focuses: Cc:


WordPress core includes files from several third party libraries such as ID3, SimplePie, and Requests. Changes to these libraries shouldn't be made directly in core, they should be made upstream.

If a contributor opens a pull request proposing changes to these files it would be great if a comment was automatically posted to the PR explaining that they've proposed changes to a third party library and they should visit the corresponding project's repo for info about contributing to it.

While there's not much we can do about this when a contributor submits a patch to a file in an affected path, it should be possible to do this when a PR is submitted via GitHub. A GitHub Action workflow could use the path keyword to post a comment to the PR whenever a file in an affected path is changed.

There are also files that get copied from Gutenberg and can clobber those in core, I opened to discuss that.

Change History (21)

#1 @desrosj
17 months ago

  • Milestone changed from Awaiting Review to Future Release

I think that this is a great idea. +1.

#2 @johnbillion
14 months ago

  • Keywords good-first-bug added

#3 @abhi3315
12 months ago

Please help me find out what paths (libraries) we should look for in the GitHub action.

I have created the following list for such 3rd party libraries-

  • src/wp-includes/ID3
  • src/wp-includes/IXR
  • src/wp-includes/PHPMailer
  • src/wp-includes/Requests
  • src/wp-includes/SimplePie
  • src/wp-includes/sodium_compat
  • src/wp-includes/Text

Please add more such libraries.

#4 @johnbillion
12 months ago

Let's go with that list for now, we can always add to it at a later date.

We've already got the "Welcome New Contributors" workflow which can post a comment on a PR, it should be a good starting point for this new workflow.

Edit: Actually maybe not, that action is specific to new contributors.

Last edited 12 months ago by johnbillion (previous) (diff)

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

12 months ago

  • Keywords has-patch added; needs-patch removed

Trac ticket: 54510

#6 @abhi3315
12 months ago

@johnbillion Please review the PR

Check the demo comment here

If no third-party files are changed then the job will be skipped.

#7 @johnbillion
10 months ago

  • Milestone changed from Future Release to 6.4
  • Owner set to johnbillion
  • Status changed from new to reviewing

#8 @JeffPaul
9 months ago

As this wouldn't be adding a file to the distributed software or even affecting a part of the build, it seems like this could be converted from an enhancement to a task... yeah?

#9 @swissspidy
8 months ago

  • Milestone changed from 6.4 to 6.5

#10 @swissspidy
4 months ago

  • Type changed from enhancement to task (blessed)

#11 @swissspidy
4 months ago

  • Keywords needs-refresh added
  • Milestone changed from 6.5 to 6.6

It would be useful if the comment would point users to the correct repositories for updating third-party files, e.g. link to the Requests repo if modifying Requests files. Or if modifying block files, point to the Gutenberg repo.

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

5 weeks ago

  • Keywords needs-refresh removed

szepeviktor commented on PR #6544:

5 weeks ago

@johnbillion This new workflow does not start.
Maybe because "on" event != event_name

szepeviktor commented on PR #6544:

5 weeks ago

@johnbillion I would simply use GH CLI:

@johnbillion commented on PR #6544:

5 weeks ago

I'm getting to use the same approach as in the other workflows so we don't have too many different implementations of the same thing:

szepeviktor commented on PR #6544:

5 weeks ago

All right! Ditch the one short command line.

@johnbillion commented on PR #6544:

5 weeks ago

I think the permissions issue is due to this being a PR from a fork.

szepeviktor commented on PR #6544:

5 weeks ago

this being a PR from a fork.

You could add && ! github.event.pull_request.head.repo.fork

szepeviktor commented on PR #6544:

5 weeks ago

Instead of escaped backticks you could write: <code>src/wp-includes/Text\</code>

Note: See TracTickets for help on using tickets.