Skip to content

Commit

Permalink
Merge branch 'trunk' into add/duotone-unset
Browse files Browse the repository at this point in the history
Conflicts:
	packages/block-editor/src/hooks/duotone.js
  • Loading branch information
Alex Lende committed May 13, 2022
2 parents cd3c685 + 5c08da0 commit 87b3459
Show file tree
Hide file tree
Showing 1,125 changed files with 23,405 additions and 23,816 deletions.
4 changes: 4 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ insert_final_newline = true
trim_trailing_whitespace = true
indent_style = tab

[*.{yml,yaml}]
indent_style = space
indent_size = 2

[*.{gradle,java,kt}]
indent_style = space

Expand Down
13 changes: 9 additions & 4 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ const majorMinorRegExp =
*/
const developmentFiles = [
'**/benchmark/**/*.js',
'**/@(__mocks__|__tests__|test)/**/*.js',
'**/@(storybook|stories)/**/*.js',
'**/@(__mocks__|__tests__|test)/**/*.[tj]s?(x)',
'**/@(storybook|stories)/**/*.[tj]s?(x)',
'packages/babel-preset-default/bin/**/*.js',
];

Expand Down Expand Up @@ -249,15 +249,20 @@ module.exports = {
'no-restricted-syntax': [
'error',
{
selector: 'CallExpression[callee.name="$"]',
selector: 'CallExpression[callee.property.name="$"]',
message:
'`$` is discouraged, please use `locator` instead',
},
{
selector: 'CallExpression[callee.name="$$"]',
selector: 'CallExpression[callee.property.name="$$"]',
message:
'`$$` is discouraged, please use `locator` instead',
},
{
selector:
'CallExpression[callee.object.name="page"][callee.property.name="waitForTimeout"]',
message: 'Prefer page.locator instead.',
},
],
},
},
Expand Down
37 changes: 12 additions & 25 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
# Documentation
/docs @ajitbohra @mkaz @ryanwelcher @juanmaguitar
/docs @ajitbohra @ryanwelcher @juanmaguitar

# Schemas
/schemas @mkaz
/schemas/json @ajlende @mkaz
/schemas/json @ajlende

# Data
/packages/api-fetch @nerrad @mmtr
Expand All @@ -15,14 +14,13 @@
# Blocks
/packages/block-library @ajitbohra
/packages/block-library/src/gallery @geriux
/packages/block-library/src/social-links @mkaz
/packages/block-library/src/social-link @mkaz
/packages/block-library/src/navigation @tellthemachines
/packages/block-library/src/navigation-link @tellthemachines
/packages/block-library/src/navigation-submenu @tellthemachines
/packages/block-library/src/page-list @tellthemachines
/packages/block-library/src/comment-template @michalczaplinski
/packages/block-library/src/comments-query-loop @michalczaplinski
/packages/block-library/src/comments @michalczaplinski
/packages/block-library/src/table-of-contents @ZebulanStanphill

# Duotone
/lib/block-supports/duotone.php @ajlende
Expand Down Expand Up @@ -60,17 +58,17 @@

# Tooling
/bin @ntwb @nerrad @ajitbohra
/bin/api-docs @ntwb @nerrad @ajitbohra @oandregal
/docs/tool @ajitbohra @oandregal
/bin/api-docs @ntwb @nerrad @ajitbohra
/docs/tool @ajitbohra
/packages/babel-plugin-import-jsx-pragma @ntwb @nerrad @ajitbohra
/packages/babel-plugin-makepot @ntwb @nerrad @ajitbohra
/packages/babel-preset-default @gziolo @ntwb @nerrad @ajitbohra
/packages/browserslist-config @ntwb @nerrad @ajitbohra
/packages/create-block @gziolo @mkaz @ryanwelcher
/packages/create-block-tutorial-template @gziolo @mkaz @ryanwelcher
/packages/create-block @gziolo @ryanwelcher
/packages/create-block-tutorial-template @gziolo @ryanwelcher
/packages/custom-templated-path-webpack-plugin @ntwb @nerrad @ajitbohra
/packages/dependency-extraction-webpack-plugin @gziolo
/packages/docgen @oandregal
/packages/docgen
/packages/e2e-test-utils @ntwb @nerrad @ajitbohra
/packages/e2e-tests @ntwb @nerrad @ajitbohra
/packages/eslint-plugin @gziolo @ntwb @nerrad @ajitbohra
Expand Down Expand Up @@ -120,9 +118,9 @@
/packages/plugins @gziolo @adamsilverstein

# Rich Text
/packages/format-library @ellatrix @cameronvoell
/packages/rich-text @ellatrix @cameronvoell
/packages/block-editor/src/components/rich-text @ellatrix @cameronvoell
/packages/format-library @ellatrix @fluiddot
/packages/rich-text @ellatrix @fluiddot
/packages/block-editor/src/components/rich-text @ellatrix @fluiddot

# Project Management
/.github
Expand All @@ -133,18 +131,7 @@

# PHP
/lib @timothybjacobs @spacedmonkey
/lib/compat/wordpress-5.9/kses.php @timothybjacobs @spacedmonkey @oandregal
/lib/compat/wordpress-5.9/theme.json @timothybjacobs @spacedmonkey @oandregal
/lib/compat/wordpress-6.0/theme-i18n.json @timothybjacobs @spacedmonkey @oandregal
/lib/compat/wordpress-5.9/class-wp-theme-json-gutenberg.php @timothybjacobs @spacedmonkey @oandregal
/lib/compat/wordpress-5.9/class-wp-theme-json-resolver-gutenberg.php @timothybjacobs @spacedmonkey @oandregal
/lib/experimental/class-wp-rest-block-editor-settings-controller.php @timothybjacobs @spacedmonkey @geriux
/phpunit/class-wp-theme-json-test.php @oandregal

# Web App
/packages/admin-manifest @ellatrix
/lib/pwa.php @ellatrix
/lib/service-worker.js @ellatrix

# Native
/packages/components/src/mobile/global-styles-context @geriux
Expand Down
20 changes: 10 additions & 10 deletions .github/ISSUE_TEMPLATE/Bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ body:
Feature '...' is not working properly. I expect '...' to happen, but '...' happens instead
validations:
required: true

- type: textarea
attributes:
label: Step-by-step reproduction instructions
Expand Down Expand Up @@ -42,31 +42,31 @@ body:
description: |
Please list what Gutenberg version you are using. If you aren't using Gutenberg, please note that it's not installed.
placeholder: |
- WordPress version, Gutenberg version, and active Theme you are using.
- Browser(s) are you seeing the problem on.
- Device you are using and operating system (e.g. "Desktop with Windows 10", "iPhone with iOS 14", etc.).
- WordPress version, Gutenberg version, and active Theme you are using.
- Browser(s) are you seeing the problem on.
- Device you are using and operating system (e.g. "Desktop with Windows 10", "iPhone with iOS 14", etc.).
validations:
required: false

- type: dropdown
id: existing
attributes:
label: Please confirm that you have searched existing issues in the repo.
description: You can do this by searching https://github.com/WordPress/gutenberg/issues and making sure the bug is not related to another plugin.
multiple: true
options:
- 'Yes'
- 'No'
- 'Yes'
- 'No'
validations:
required: true

- type: dropdown
id: plugins
attributes:
label: Please confirm that you have tested with all plugins deactivated except Gutenberg.
multiple: true
options:
- 'Yes'
- 'No'
- 'Yes'
- 'No'
validations:
required: true
123 changes: 58 additions & 65 deletions .github/report-flaky-tests/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ const metaData = {
let issue;

if ( reportedIssue ) {
let body = reportedIssue.body;
const body = reportedIssue.body;
const meta = metaData.get( body );

if ( isTrunk ) {
Expand All @@ -88,35 +88,39 @@ const metaData = {
}
}

let testResultsList = body
.slice(
body.indexOf( TEST_RESULTS_LIST.open ) +
TEST_RESULTS_LIST.open.length,
body.indexOf( TEST_RESULTS_LIST.close )
)
/**
* Split the text from:
* ```
* <!-- __TEST_RESULT__ --> Test result 1 <!-- /__TEST_RESULT__ -->
* ...
* <!-- __TEST_RESULT__ --> Test result 2 <!-- /__TEST_RESULT__ -->
* <!-- __TEST_RESULT__ --> Test result 3 <!-- /__TEST_RESULT__ -->
* ```
*
* into:
* ```
* [
* '<!-- __TEST_RESULT__ --> Test result 1 <!-- /__TEST_RESULT__ -->',
* '<!-- __TEST_RESULT__ --> Test result 2 <!-- /__TEST_RESULT__ -->',
* '<!-- __TEST_RESULT__ --> Test result 3 <!-- /__TEST_RESULT__ -->',
* ]
* ```
*/
.split(
new RegExp(
`(?<=${ TEST_RESULT.close })\n(?:\.\.\.\n)?(?=${ TEST_RESULT.open })`
)
);
let testResultsList =
body.includes( TEST_RESULTS_LIST.open ) &&
body.includes( TEST_RESULTS_LIST.close )
? body
.slice(
body.indexOf( TEST_RESULTS_LIST.open ) +
TEST_RESULTS_LIST.open.length,
body.indexOf( TEST_RESULTS_LIST.close )
)
/**
* Split the text from:
* ```
* <!-- __TEST_RESULT__ --> Test result 1 <!-- /__TEST_RESULT__ -->
* ...
* <!-- __TEST_RESULT__ --> Test result 2 <!-- /__TEST_RESULT__ -->
* <!-- __TEST_RESULT__ --> Test result 3 <!-- /__TEST_RESULT__ -->
* ```
*
* into:
* ```
* [
* '<!-- __TEST_RESULT__ --> Test result 1 <!-- /__TEST_RESULT__ -->',
* '<!-- __TEST_RESULT__ --> Test result 2 <!-- /__TEST_RESULT__ -->',
* '<!-- __TEST_RESULT__ --> Test result 3 <!-- /__TEST_RESULT__ -->',
* ]
* ```
*/
.split(
new RegExp(
`(?<=${ TEST_RESULT.close })\n+(?:\.\.\.\n+)?(?=${ TEST_RESULT.open })`
)
)
: [];
// GitHub issues has character limits on issue's body,
// so we only preserve the first and the 9 latest results.
if ( testResultsList.length > 10 ) {
Expand All @@ -127,25 +131,26 @@ const metaData = {
];
}

// Reconstruct the body with the description + previous errors + new error.
body =
renderIssueDescription( { meta, testTitle, testPath } ) +
[
TEST_RESULTS_LIST.open,
...testResultsList,
renderTestErrorMessage( {
testRunner,
testPath,
testResults,
} ),
TEST_RESULTS_LIST.close,
].join( '\n' );
// Concat the test results list with the latest test results.
const formattedTestResults = [
...testResultsList,
formatTestResults( {
testRunner,
testPath,
testResults,
} ),
].join( '\n' );

const response = await octokit.rest.issues.update( {
...github.context.repo,
issue_number: reportedIssue.number,
state: 'open',
body,
body: renderIssueBody( {
meta,
testTitle,
testPath,
formattedTestResults,
} ),
} );

issue = response.data;
Expand All @@ -166,10 +171,9 @@ const metaData = {
title: issueTitle,
body: renderIssueBody( {
meta,
testRunner,
testTitle,
testPath,
testResults,
formattedTestResults: formatTestResults( testResults ),
} ),
labels: [ label ],
} );
Expand Down Expand Up @@ -235,18 +239,10 @@ function getIssueTitle( testTitle ) {

function renderIssueBody( {
meta,
testRunner,
testTitle,
testPath,
testResults,
formattedTestResults,
} ) {
return (
renderIssueDescription( { meta, testTitle, testPath } ) +
renderTestResults( { testRunner, testPath, testResults } )
);
}

function renderIssueDescription( { meta, testTitle, testPath } ) {
return `${ metaData.render( meta ) }
**Flaky test detected. This is an auto-generated issue by GitHub Actions. Please do NOT edit this manually.**
Expand All @@ -260,17 +256,13 @@ ${ testTitle }
\`${ meta.failedTimes } / ${ meta.totalCommits + meta.failedTimes }\` runs
## Errors
`;
}

function renderTestResults( { testRunner, testPath, testResults } ) {
return `${ TEST_RESULTS_LIST.open }
${ renderTestErrorMessage( { testRunner, testPath, testResults } ) }
${ TEST_RESULTS_LIST.open }
${ formattedTestResults }
${ TEST_RESULTS_LIST.close }
`;
}

function renderTestResults( { testRunner, testResults, testPath } ) {
function formatTestErrorMessage( { testRunner, testResults, testPath } ) {
switch ( testRunner ) {
case '@playwright/test': {
// Could do a slightly better formatting than this.
Expand All @@ -297,7 +289,7 @@ function renderTestResults( { testRunner, testResults, testPath } ) {
}
}

function renderTestErrorMessage( { testRunner, testPath, testResults } ) {
function formatTestResults( { testRunner, testPath, testResults } ) {
const date = new Date().toISOString();
// It will look something like this without formatting:
// ▶ [2021-08-31T16:15:19.875Z] Test passed after 2 failed attempts on trunk
Expand All @@ -310,7 +302,7 @@ function renderTestErrorMessage( { testRunner, testPath, testResults } ) {
</summary>
\`\`\`
${ renderTestResults( { testRunner, testPath, testResults } ) }
${ formatTestErrorMessage( { testRunner, testPath, testResults } ) }
\`\`\`
</details>${ TEST_RESULT.close }`;
}
Expand All @@ -336,6 +328,7 @@ function stripAnsi( string ) {
'(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))',
].join( '|' ),
'g'
)
),
''
);
}
Loading

0 comments on commit 87b3459

Please sign in to comment.