Skip to content

Automated Testing: Request reviews using review routing automation - #86677

Merged
aduth merged 8 commits into
trunkfrom
update/review-routing-request-reviews
Nov 13, 2026
Merged

aduth merged 8 commits into
trunkfrom
update/review-routing-request-reviews

Conversation

@aduth

@aduth aduth commented Nov 11, 2026 •

Copy link
Copy Markdown
Member

What?

Updates the review routing automation added in #86449 to trigger real requested reviews, replacing CODEOWNERS entries for the components team (Edit: CODEOWNERS is unchanged for now, as this will be additive for now pending further testing).

Why?

See #86325's "Why?" for a full rationale of what this is working toward.

This stage does the effective replacement for how we use CODEOWNERS today for the components team.

Future iterations will still continue to refine the routing, in response to observed false negatives and false positives. Additionally, I'd like to improve visibility of how reviews are assigned, such as part of the "PR Meta" comment explaining which rule matched a reviewer and with what score / threshold.

How?

  • Extends the review-routing.yml workflow with a new step to assign review.
  • Updates @wordpress/review-routing-tools so that it can simultaneously output both markdown and JSON, so that the markdown can be used in the workflow summary, while the JSON data used in the review assignment logic.
  • Removes @wordpress/gutenberg-components from CODEOWNERS entries. Edit: CODEOWNERS is unchanged for now, as this will be additive for now pending further testing

Note that if anyone would prefer to remain as CODEOWNERS, it's completely reasonable to keep individuals in the CODEOWNERS. Just let me know and I'll add you!

Testing Instructions

This pull request will be used for demonstration.

  • c6ce075 temporarily adds pull_request event trigger so the workflow updates are run in the context of this branch. Verify that no reviews are requested, since this pull request is not especially relevant for components team review.
  • A subsequent commit will lower the threshold of one of the rules to a very low value to ensure that any pull request (including this one) will match, at which point it's expected that review will be requested.

Use of AI Tools

Researched and implemented in coordination with Claude Code + Opus 5.5, with some manual edits to comment text.

@aduth aduth added the [Type] Automated Testing Testing infrastructure changes impacting the execution of end-to-end (E2E) and/or unit tests. label Nov 11, 2026
@github-actions

github-actions Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

🤖 PR meta 🤖

Preview in WordPress Playground Preview in Storybook

🎉 Props

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: aduth <aduth@git.wordpress.org>
Co-authored-by: ciampo <mciampini@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.


Props Bot commands

You can trigger Props Bot actions by commenting on this PR:

  • @propsbot add <username> to give props to a GitHub user. Requires write access.
  • @propsbot remove <username> to leave a user out of the props. Requires write access.
  • @propsbot refresh to refresh this list. Adding the props-bot label works too.

Updated as activity occurs, without notifying anyone named here. Add the props-bot label to refresh.

📦 Bundle size

Size Change: 0 B

Total Size: 8.64 MB

968fde5 Run

⚡ Performance

Show the results

Client side metrics exclude the server response time.

front-end-block-theme

Metric c152464 trunk % Change
timeToFirstByte 38.7 ms +7.88% -3.62% 35.45 ms +14.1% -2.96% 9.17%
largestContentfulPaint 64 ms +6.25% -3.13% 60 ms +0% -6.67% 6.67%
lcpMinusTtfb 25.65 ms +15.98% -10.92% 21.75 ms +10.8% -3.91% 17.93%
wpBeforeTemplate 19.69 ms +17.32% -3.81% 18.23 ms +16.62% -2.41% 8.01%
wpTemplate 15.07 ms +4.11% -2.85% 13.9 ms +6.62% -3.96% 8.42%
wpTotal 35.26 ms +8.31% -3.46% 32.41 ms +14.32% -3.64% 8.79%
wpMemoryUsage 7.72 MB +0% -0% 7.68 MB +0% -0% 0.51%
wpDbQueries 16 +0% -0% 16 +0% -0% 0%

front-end-classic-theme

Metric c152464 trunk % Change
timeToFirstByte 32.25 ms +6.51% -4.03% 29.6 ms +7.09% -1.52% 8.95%
largestContentfulPaint 60 ms +6.67% -3.33% 56 ms +3.57% -0% 7.14%
lcpMinusTtfb 27.4 ms +5.84% -5.66% 26.45 ms +3.4% -8.13% 3.59%
wpBeforeTemplate 17.22 ms +9.35% -1.74% 16.14 ms +3.41% -1.3% 6.69%
wpTemplate 11.68 ms +8.9% -5.74% 10.63 ms +3.2% -5.83% 9.88%
wpTotal 29.25 ms +8.44% -3.38% 26.94 ms +5.75% -1.52% 8.57%
wpMemoryUsage 6.41 MB +0% -0% 6.37 MB +0% -0% 0.63%
wpDbQueries 13 +0% -0% 13 +0% -0% 0%

media-processing

Metric c152464 trunk % Change
mediaProcessingJpeg 232.91 ms +6.82% -2.27% 230.24 ms +0.65% -2.48% 1.16%
mediaProcessingAvif 3812.42 ms +0.62% -1.18% 3801.64 ms +0.38% -1.65% 0.28%
mediaProcessingJpegToAvif 2609.29 ms +1.29% -0.85% 2578.02 ms +0.85% -0.52% 1.21%

media-upload

Metric c152464 trunk % Change
jpegUploadProcessing 1453.66 ms +1.88% -1.16% 1441.55 ms +2.29% -0.35% 0.84%
pngUploadProcessing 204.06 ms +3.99% -8.25% 202.16 ms +7.04% -3.94% 0.94%
largeJpegUploadProcessing 1434.3 ms +1.7% -0.4% 1447 ms +0.39% -0.54% -0.88%
multipleImageUploadProcessing 1510.3 ms +1.86% -0.82% 1489.93 ms +2.46% -0.19% 1.37%

post-editor

Metric c152464 trunk % Change
serverResponse 312.45 ms +5.74% -7.74% 329.79 ms +3.14% -11.24% -5.26%
firstPaint 328.31 ms +14.22% -11.24% 335.94 ms +9.48% -4.05% -2.27%
domContentLoaded 639.82 ms +13.66% -1.02% 663.1 ms +0.82% -2.2% -3.51%
loaded 640.7 ms +13.69% -1.04% 664.01 ms +0.81% -2.19% -3.51%
firstContentfulPaint 359.85 ms +14.31% -0.86% 370.84 ms +2.57% -2.46% -2.96%
firstBlock 1709.08 ms +9.46% -1.11% 1748.88 ms +1.97% -2.38% -2.28%
type 17.29 ms +5.78% -15.1% 16.09 ms +5.72% -8.58% 7.46%
typeWithoutInspector 14.75 ms +4.75% -7.39% 15.01 ms +4.4% -6.46% -1.73%
typeWithTopToolbar 19.39 ms +3.66% -7.89% 19.71 ms +2.23% -8.52% -1.62%
typeContainer 7.08 ms +15.11% -8.05% 6.99 ms +13.88% -5.58% 1.29%
focus 96.02 ms +2.94% -4.61% 100.19 ms +2.4% -9.28% -4.16%
firstFocus 190.06 ms +0% -0% 201.56 ms +0% -0% -5.71%
selectAll 322.39 ms +2.1% -1.94% 308.21 ms +2.08% -0.11% 4.6%
undo 26.04 ms +9.41% -8.68% 25.68 ms +4.95% -6.62% 1.4%
listViewOpen 67.55 ms +8.16% -12.07% 60.78 ms +22.36% -3.6% 11.14%
inserterOpen 33.15 ms +13.06% -8.39% 34.69 ms +9.66% -4.53% -4.44%
inserterHover 10.22 ms +8.12% -7.05% 10.35 ms +10.14% -9.57% -1.26%
inserterSearch 6.93 ms +8.51% -2.02% 7.13 ms +5.33% -9.12% -2.81%
loadPatterns 507.57 ms +8.72% -3.28% 559.88 ms +4.23% -3.89% -9.34%
wpTotal 303.81 ms +5.45% -7.94% 321.14 ms +3.24% -11.55% -5.4%
wpMemoryUsage 14.78 MB +0% -0% 14.74 MB +0% -0% 0.27%
wpDbQueries 55 +0% -0% 55 +0% -0% 0%

site-editor

Metric c152464 trunk % Change
serverResponse 472.74 ms +0.86% -8.78% 470.97 ms +0.22% -1.89% 0.38%
firstPaint 404.15 ms +13.93% -2.97% 415.37 ms +12.86% -4.87% -2.7%
domContentLoaded 839.91 ms +3.46% -2.15% 827.91 ms +0.58% -0.44% 1.45%
loaded 840.8 ms +3.48% -2.16% 828.92 ms +0.58% -0.41% 1.43%
firstContentfulPaint 475.5 ms +6.25% -1.37% 467.65 ms +1.53% -1.17% 1.68%
firstBlock 2548.01 ms +5.08% -1.34% 2552.19 ms +0.48% -1.02% -0.16%
type 16.27 ms +10.88% -5.65% 17.29 ms +16.08% -9.77% -5.9%
navigate 118.26 ms +3.58% -2.99% 119.49 ms +1.66% -1.71% -1.03%
loadPatterns 1273.26 ms +16.72% -10.36% 1386.75 ms +2.66% -12.86% -8.18%
loadPages 943.09 ms +4.28% -1.75% 949.42 ms +2.12% -1.73% -0.67%
wpTotal 463.19 ms +0.89% -8.98% 460.72 ms +0.34% -1.75% 0.54%
wpMemoryUsage 12.79 MB +0% -0% 12.75 MB +0% -0% 0.31%
wpDbQueries 45 +0% -0% 45 +0% -0% 0%

968fde5 Run

🏁 Flaky tests

Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

Undo restores the post selection when another synced entity is loaded (RTC WebSocket) in /test/e2e/specs/editor/collaboration/collaboration-undo-redo.spec.ts, passed after 1 failed attempt.
Error: expect(received).toMatchObject(expected)

- Expected  - 2
+ Received  + 2

  Object {
    "attributeKey": "content",
    "blockIndex": 0,
    "content": "abcdef",
-   "endOffset": 3,
-   "offset": 3,
+   "endOffset": 6,
+   "offset": 6,
  }

Call Log:
- Timeout 5000ms exceeded while waiting on the predicate
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/collaboration/collaboration-undo-redo.spec.ts:363:5
Undo restores the post selection when another synced entity is loaded in /test/e2e/specs/editor/collaboration/collaboration-undo-redo.spec.ts, passed after 1 failed attempt.
Error: expect(received).toMatchObject(expected)

- Expected  - 2
+ Received  + 2

  Object {
    "attributeKey": "content",
    "blockIndex": 0,
    "content": "abcdef",
-   "endOffset": 3,
-   "offset": 3,
+   "endOffset": 2,
+   "offset": 2,
  }

Call Log:
- Timeout 5000ms exceeded while waiting on the predicate
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/collaboration/collaboration-undo-redo.spec.ts:363:5
does not select blocks in the canvas preview when editing from the sidebar in /test/e2e/specs/site-editor/navigation-sidebar-list-view.spec.js, passed after 1 failed attempt.
Error: expect(locator).toBeFocused() failed

Locator: getByRole('combobox', { name: 'Search or type URL' })
Expected: focused
Timeout: 5000ms
Error: element(s) not found

Call log:
  - Expect "toBeFocused" getByRole('combobox', { name: 'Search or type URL' }) with timeout 5000ms
  - waiting for getByRole('combobox', { name: 'Search or type URL' })

    at LinkControl.useLinkControlSearch (/home/runner/work/gutenberg/gutenberg/test/e2e/specs/site-editor/navigation-sidebar-list-view.spec.js:416:47)
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/site-editor/navigation-sidebar-list-view.spec.js:179:21

968fde5 Run

For demonstration with changes in pull request
Repository policies have configured review-routing.yml to restrict events it can run. This is so it can run pull_request_target, but it is not configured to run pull_request, so it fails to start up. We can work around this temporarily by creating a second, temporary workflow that uses the pull_request event, with the workflow contents otherwise identical.
Let's keep this additive for now
Cannot assign teams for now, do individual opt-in for now until we can be sure it's working
@aduth
aduth force-pushed the update/review-routing-request-reviews branch from 8214d29 to 724f663 Compare November 11, 2026 18:34
@aduth

aduth commented Nov 11, 2026

Copy link
Copy Markdown
Member Author

Testing this showed a problem: The default GITHUB_TOKEN doesn't have permissions to read or assign teams, so we can't assign teams like @WordPress/gutenberg-components with this token. We need a token that has these permissions, which is something I'm following-up in parallel to explore a custom GitHub App.

In the meantime, the token can request individuals. And so I'd like to pivot to a more conservative approach: Keep CODEOWNERS as-is for now, and then individuals can opt-in to the review routing approach.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The contents of this file are identical to review-routing.yml, except using the pull_request event instead of pull_request_target. pull_request runs using the code of this branch, which is necessary to demonstrate the changes. Because review-routing.yml is now part of a repository policy that allows it to use the pull_request_target event workflow but does not allow it to use the pull_request event, trying to add pull_request to the existing workflow will cause it to fail to start (example, cc @johnbillion ).

@aduth

aduth commented Nov 11, 2026 •

Copy link
Copy Markdown
Member Author

In the meantime, the token can request individuals. And so I'd like to pivot to a more conservative approach: Keep CODEOWNERS as-is for now, and then individuals can opt-in to the review routing approach.

Question for those in @WordPress/gutenberg-components : Would anyone like to pilot this along with me? 🙂 In the short-term it may mean more notifications for pull requests that are relevant within our domain but not covered by CODEOWNERS (e.g. #86451 scores). But I plan to move quite quickly to substituting for CODEOWNERS, which should reduce some other notifications.

It would also help with testing this pull request, since the workflow successfully requested reviewers with the demonstration changes, but I can't be requested as a reviewer of my own pull request.

Feel free to reply or leave a 👍 reaction if you'd like to be added.

@aduth aduth changed the title Automated Testing: Replace components CODEOWNERS with review routing automation Automated Testing: Request reviews using review routing automation Nov 11, 2026
@github-actions
github-actions Bot requested a review from ciampo November 12, 2026 13:00
@aduth

aduth commented Nov 12, 2026

Copy link
Copy Markdown
Member Author

The review routing appears to be working:

image

See score summary: https://github.com/WordPress/gutenberg/actions/runs/43223043500?pr=86677

Rule Reviewers Probability Threshold Decision
design-system-api aduth, ciampo 0.06 0.70 No request
design-system-bespoke-ui aduth, ciampo 0.03 0.70 No request
design-system-docs aduth, ciampo 0.08 0.70 No request
design-system-maintenance aduth, ciampo 0.08 0.01 Request review
design-system-migration aduth, ciampo 0.02 0.70 No request
design-system-patterns aduth, ciampo 0.03 0.80 No request
design-system-style-sync aduth, ciampo 0.17 0.80 No request
design-system-tokens aduth, ciampo 0.09 0.80 No request
design-system-tooling aduth, ciampo 0.13 0.70 No request

Now I'll back out the temporary changes.

@ciampo ciampo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM 🚀

Let's try this out

@aduth
aduth merged commit fd35272 into trunk Nov 13, 2026
87 checks passed
@aduth
aduth deleted the update/review-routing-request-reviews branch November 13, 2026 14:36
@github-actions github-actions Bot added this to the Gutenberg 24.5 milestone Nov 13, 2026
@aduth

aduth commented Nov 16, 2026

Copy link
Copy Markdown
Member Author

Some findings after running this for a few days (largely over the weekend). Overall, this seems to be working pretty well.

Routing matches where CODEOWNERS wouldn't:

There was one false positive: #84428. In this case, the feature for copying blocks may have been confused with the design system's "Copy to Clipboard" pattern. We might need to be more specific about these patterns applying to UI components. There's maybe also a risk of conflation of the word "pattern" with the block patterns feature.

CODEOWNERS matches that routing did not match:

Some of these could be borderline, since some like #86887 can have real impact on UI component behavior.

Both CODEOWNERS and routing agree:

#86886 is a dependency update, but it also includes some logic changes around focus handling, which would explain why it was flagged where other dependency updates were not.

Action items:

  • Clearer language around patterns applying to design system UI components usage
  • Adjust dependency updates language to accept more where there's an expected behavior change

@ciampo

ciampo commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

Considering it's an early iteration, it's working really well!

@aduth

aduth commented Nov 18, 2026 •

Copy link
Copy Markdown
Member Author

One thing I'm noticing is that the design-system-migration rule matches pretty frequently on pull requests that we may not necessarily need to be involved with (e.g. #77670). Part of this is expected, since the rule can broadly be interpreted as "does the pull request use components" and most every pull request will be. We may be able to scale this back over time once we've gained a clearer picture of how new components fare, particularly in contrast with their equivalents in @wordpress/components. Some of it could also be improved with specifics of the phrasing, like "in place of another component" cueing on the sort of component substitution happening in #77670. Some of this could also have to do with certain components in @wordpress/components feeling less part of the design system and more editor-specific (ToolsPanel in the case of #77760), so maybe we could exempt specific components from matching.

Edit: #86952 being another example of "start to use a component of the design system" hitting any usage of components.

Vedant-Gandhi pushed a commit to Vedant-Gandhi/gutenberg that referenced this pull request Nov 30, 2026
…ordPress#86677)

* Automated Testing: Add requested review to review routing

* TEMPORARY: Add pull_request event to review routing workflow

For demonstration with changes in pull request

* TEMPORARY: Lower threshold to guarantee requested review

For demonstration

* TEMPORARY: Add duplicate workflow for pull_request demo

Repository policies have configured review-routing.yml to restrict events it can run. This is so it can run pull_request_target, but it is not configured to run pull_request, so it fails to start up. We can work around this temporarily by creating a second, temporary workflow that uses the pull_request event, with the workflow contents otherwise identical.

* Restore CODEOWNERS to original state

Let's keep this additive for now

* Assign self as reviewer for design system work

Cannot assign teams for now, do individual opt-in for now until we can be sure it's working

* Automated Testing: Add ciampo as reviewer for design system routing

* Remove temporary changes

Co-authored-by: aduth <aduth@git.wordpress.org>
Co-authored-by: ciampo <mciampini@git.wordpress.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Type] Automated Testing Testing infrastructure changes impacting the execution of end-to-end (E2E) and/or unit tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants