Streamline Core sync workflow by improving coding standards linting and automation #59786
Replies: 3 comments 10 replies
-
The perfect scenario is that linting and code styles should be handled automatically by the tooling. It shouldn't fall on the reviewers to take a look at this. We should focus the reviews on the actual feature, testing, and architecture. We already do this for most code style things (almost 100% in JS code) but we still have some gaps on the php side, so let's to close these gaps. A good first step could be to enable the PHP Docs Linting on the Gutenberg repo (potentially before Core). |
Beta Was this translation helpful? Give feedback.
-
I'm going to answer my own question:
When I write PHP code in the Gutenberg repo linting should enforce the same coding standards as required when I submit the patch to sync the changes to WP Core. A few example that commonly come up:
The linter should be an aid to ensuring that any PHP code in Gutenberg Then when I come to sync the changes to WP Core:
Bottom line: the experience should feel seamless with automation guiding me towards ensuring that no human should need to spend their valuable time requesting changes to align with coding standards. All reviews should be focused on architecture or code decisions. |
Beta Was this translation helpful? Give feedback.
-
First time I'm seeing this discussion. SInce this affects core just as much as it affects Gutenberg, have you considered bringing up this topic in core dev chat or in a make/core blog post? |
Beta Was this translation helpful? Give feedback.
-
During releases (and possibly elsewhere), identifying and fixing coding standards issues when syncing Gutenberg changes to WP Core are costing contributors a lot of time.
This is primarily down to the fact that we have two repositories (Gutenberg and WP Core) and thus standards can easily become misaligned between the two.
I believe that manually identifying and resolving these inconsistencies in individual PRs is a misuse of contributor time which could be better spent reviewing more impactful issues surrounding code structure/architecture.
That isn't in any way to downplay the importance of coding standards, but rather to observe that these kinds of issues should be either:
Example of problem
As an example, for a given sub-release of WP Core (for example an Release Candidate release), Editor Tech leads must:
@wordpress/*
packages.All of this takes time, despite the levels of automation increasing with every release.
If, at the final step of reviewing the Core PR, coding standards issues are identified then a fix must be made upstream in the Gutenberg repo, before this entire package release process must be repeated.
Accounting for time taken for reviews and tests to pass, this process is extremely laborious and costly (both in terms of time and effort). This can lead to release timings being compromised.
This exact issue was flagged by @youknowriad during the 6.5 release:
Current Status
My (somewhat incomplete) understanding of the current state of the issue is:
Existing efforts
Questions
As co-Core Editor Tech for 6.5, I'm raising this discussion in the hope it can act as a point of focus to allow us to improve the situation for future releases.
I'd like to start things off by encouraging us to answer a few fundamental questions:
Beta Was this translation helpful? Give feedback.
All reactions