Make WordPress Core

Opened 3 years ago

Last modified 10 days 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: Future Release Priority: normal
Severity: normal Version:
Component: Build/Test Tools Keywords: good-first-bug has-patch
Focuses: Cc:

Description

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 https://github.com/WordPress/gutenberg/issues/36868 to discuss that.

Change History (23)

#1 @desrosj
21 months ago

  • Milestone changed from Awaiting Review to Future Release

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

#2 @johnbillion
18 months ago

  • Keywords good-first-bug added

#3 @abhi3315
16 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
16 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 16 months ago by johnbillion (previous) (diff)

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


16 months ago
#5

  • Keywords has-patch added; needs-patch removed

Trac ticket: 54510

#6 @abhi3315
16 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
14 months ago

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

#8 @JeffPaul
13 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
12 months ago

  • Milestone changed from 6.4 to 6.5

#10 @swissspidy
8 months ago

  • Type changed from enhancement to task (blessed)

#11 @swissspidy
8 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 months ago
#12

  • Keywords needs-refresh removed

szepeviktor commented on PR #6544:


5 months ago
#13

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

szepeviktor commented on PR #6544:


5 months ago
#15

@johnbillion I would simply use GH CLI: https://cli.github.com/manual/gh_pr_comment

@johnbillion commented on PR #6544:


5 months ago
#16

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: https://github.com/WordPress/wordpress-develop/blob/trunk/.github/workflows/pull-request-comments.yml#L165

szepeviktor commented on PR #6544:


5 months ago
#17

All right! Ditch the one short command line.

@johnbillion commented on PR #6544:


5 months ago
#18

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

szepeviktor commented on PR #6544:


5 months ago
#19

this being a PR from a fork.

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

szepeviktor commented on PR #6544:


5 months ago
#21

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

#22 @desrosj
3 months ago

  • Milestone changed from 6.6 to 6.7

This is not critical for 6.6, and still needs some review. Punting to 6.7.

#23 @johnbillion
10 days ago

  • Milestone changed from 6.7 to Future Release
Note: See TracTickets for help on using tickets.