Skip to content

Commit

Permalink
Merge changes published in the Gutenberg plugin "release/16.3" branch
Browse files Browse the repository at this point in the history
  • Loading branch information
gutenbergplugin committed Jul 20, 2023
1 parent bcd13d5 commit 25e1c94
Show file tree
Hide file tree
Showing 528 changed files with 16,243 additions and 6,319 deletions.
118 changes: 1 addition & 117 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,123 +44,7 @@ const restrictedImports = [
},
{
name: 'lodash',
importNames: [
'camelCase',
'capitalize',
'castArray',
'chunk',
'clamp',
'clone',
'cloneDeep',
'compact',
'concat',
'countBy',
'debounce',
'deburr',
'defaults',
'defaultTo',
'delay',
'difference',
'differenceWith',
'dropRight',
'each',
'escape',
'escapeRegExp',
'every',
'extend',
'filter',
'find',
'findIndex',
'findKey',
'findLast',
'first',
'flatMap',
'flatten',
'flattenDeep',
'flow',
'flowRight',
'forEach',
'fromPairs',
'groupBy',
'has',
'identity',
'includes',
'invoke',
'isArray',
'isBoolean',
'isEmpty',
'isEqual',
'isFinite',
'isFunction',
'isMatch',
'isNil',
'isNumber',
'isObject',
'isObjectLike',
'isPlainObject',
'isString',
'isUndefined',
'kebabCase',
'keyBy',
'keys',
'last',
'lowerCase',
'map',
'mapKeys',
'mapValues',
'maxBy',
'memoize',
'merge',
'mergeWith',
'negate',
'noop',
'nth',
'omit',
'omitBy',
'once',
'orderby',
'overEvery',
'partial',
'partialRight',
'pick',
'pickBy',
'random',
'reduce',
'reject',
'repeat',
'reverse',
'setWith',
'size',
'snakeCase',
'some',
'sortBy',
'startCase',
'startsWith',
'stubFalse',
'stubTrue',
'sum',
'sumBy',
'take',
'throttle',
'times',
'toString',
'trim',
'truncate',
'unescape',
'unionBy',
'uniq',
'uniqBy',
'uniqueId',
'uniqWith',
'upperFirst',
'values',
'without',
'words',
'xor',
'zip',
],
message:
'This Lodash method is not recommended. Please use native functionality instead. If using `memoize`, please use `memize` instead.',
message: 'Please use native functionality instead.',
},
{
name: 'reakit',
Expand Down
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@
/packages/compose @ajitbohra
/packages/element @ajitbohra
/packages/notices @ajitbohra
/packages/nux @ajitbohra @peterwilsoncc
/packages/viewport @ajitbohra
/packages/base-styles
/packages/icons
Expand Down
100 changes: 100 additions & 0 deletions .github/workflows/php-changes-detection.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
name: OPTIONAL - Confirm if PHP changes require backporting to WordPress Core

on:
pull_request:
types: [opened, synchronize]
jobs:
detect_php_changes:
name: Detect PHP changes
runs-on: ubuntu-latest
if: ${{ github.repository == 'WordPress/gutenberg' || github.event_name == 'pull_request' }}
steps:
- name: Check out code
uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3.5.0
with:
fetch-depth: 0

- name: Get changed PHP files
id: changed-files-php
uses: tj-actions/changed-files@v37
with:
files: |
*.{php}
lib/**
phpunit/**
- name: List all changed files
if: steps.changed-files-php.outputs.any_changed == 'true'
id: list-changed-php-files
run: |
echo "Changed files:"
formatted_change_list=""
for file in ${{ steps.changed-files-php.outputs.all_changed_files }}; do
echo "$file was changed"
formatted_change_list+="<br>:grey_question: $file"
done
formatted_change_list+="<br>"
echo "formatted_change_list=$formatted_change_list" >> $GITHUB_OUTPUT
- name: Find Comment
uses: peter-evans/find-comment@v2
id: find-comment
with:
issue-number: ${{ github.event.pull_request.number }}
comment-author: 'github-actions[bot]'
body-includes: '<!-- pr-contains-php-changes -->'

- name: Create comment
if: steps.find-comment.outputs.comment-id == '' && steps.changed-files-php.outputs.any_changed == 'true'
uses: peter-evans/create-or-update-comment@v3
with:
issue-number: ${{ github.event.pull_request.number }}
body: |
<!-- pr-contains-php-changes -->
This pull request has changed or added PHP files. Please confirm whether these changes need to be synced to WordPress Core, and therefore featured in the next release of WordPress.
If so, it is recommended to create a [new Trac ticket](https://core.trac.wordpress.org/newticket) and submit a pull request to the [WordPress Core Github repository](https://github.com/WordPress/wordpress-develop) soon after this pull request is merged.
If you're unsure, you can always ask for help in the #core-editor channel in [WordPress Slack](https://make.wordpress.org/chat/).
Thank you! :heart:
<details>
<summary>View changed files</summary>
${{ steps.list-changed-php-files.outputs.formatted_change_list }}
</details>
- name: Update comment
if: steps.find-comment.outputs.comment-id != '' && steps.changed-files-php.outputs.any_changed == 'true'
uses: peter-evans/create-or-update-comment@v3
with:
comment-id: ${{ steps.find-comment.outputs.comment-id }}
issue-number: ${{ github.event.pull_request.number }}
edit-mode: replace
body: |
<!-- pr-contains-php-changes -->
This pull request has changed or added PHP files. Please confirm whether these changes need to be synced to WordPress Core, and therefore featured in the next release of WordPress.
If so, it is recommended to create a [new Trac ticket](https://core.trac.wordpress.org/newticket) and submit a pull request to the [WordPress Core Github repository](https://github.com/WordPress/wordpress-develop) soon after this pull request is merged.
If you're unsure, you can always ask for help in the #core-editor channel in [WordPress Slack](https://make.wordpress.org/chat/).
Thank you! :heart:
<details>
<summary>View changed files</summary>
${{ steps.list-changed-php-files.outputs.formatted_change_list }}
</details>
- name: Update comment
if: steps.find-comment.outputs.comment-id != '' && steps.changed-files-php.outputs.any_changed != 'true'
uses: peter-evans/create-or-update-comment@v3
with:
comment-id: ${{ steps.find-comment.outputs.comment-id }}
issue-number: ${{ github.event.pull_request.number }}
edit-mode: replace
body: |
<!-- pr-contains-php-changes -->
This pull request changed or added PHP files in previous commits, but none have been detected in the latest commit.
Thank you! :heart:
2 changes: 1 addition & 1 deletion .github/workflows/stale-issue-gardening.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
days-before-stale: 180
days-before-close: -1
remove-stale-when-updated: false
stale-issue-label: 'Needs Testing'
stale-issue-label: 'Needs check-in'

steps:
- name: Update issues
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -296,4 +296,4 @@ jobs:
run: npx lerna run build

- name: Running the tests
run: npm run native test -- --ci --maxWorkers=2 --cacheDirectory="$HOME/.jest-cache"
run: npm run test:native -- --ci --maxWorkers=2 --cacheDirectory="$HOME/.jest-cache"
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ yarn.lock
Thumbs.db

# Report generated from jest-junit
test/native/junit.xml
junit.xml

# Local overrides
.wp-env.override.json
Expand Down
19 changes: 16 additions & 3 deletions bin/cherry-pick.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,25 @@ async function fetchPRs() {
const { items } = await GitHubFetch(
`/search/issues?q=is:pr state:closed sort:updated label:"${ LABEL }" repo:WordPress/gutenberg`
);
const PRs = items.map( ( { id, number, title } ) => ( {
const PRs = items.map( ( { id, number, title, pull_request, closed_at } ) => ( {
id,
number,
title,
} ) );
console.log( 'Found the following PRs to cherry-pick: ' );
closed_at,
pull_request,
} ) ).sort( ( a, b ) => {
/*
* `closed_at` and `pull_request.merged_at` are _usually_ the same,
* but let's prefer the latter if it's available.
*/
if ( a?.pull_request?.merged_at && b?.pull_request?.merged_at ) {
return new Date( a?.pull_request?.merged_at ) - new Date( b?.pull_request?.merged_at );
}
return new Date( a.closed_at ) - new Date( b.closed_at );
} );


console.log( 'Found the following PRs to cherry-pick (sorted by closed date in ascending order): ' );
PRs.forEach( ( { number, title } ) =>
console.log( indent( `#${ number }${ title }` ) )
);
Expand Down
4 changes: 2 additions & 2 deletions bin/test-create-block.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ if [ "$expected" -ne "$actual" ]; then
error "Expected $expected files in the project root, but found $actual."
exit 1
fi
expected=6
expected=7
actual=$( find src -maxdepth 1 -type f | wc -l )
if [ "$expected" -ne "$actual" ]; then
error "Expected $expected files in the \`src\` directory, but found $actual."
Expand All @@ -69,7 +69,7 @@ status "Building block..."
../node_modules/.bin/wp-scripts build

status "Verifying build..."
expected=5
expected=7
actual=$( find build -maxdepth 1 -type f | wc -l )
if [ "$expected" -ne "$actual" ]; then
error "Expected $expected files in the \`build\` directory, but found $actual."
Expand Down
Loading

1 comment on commit 25e1c94

@github-actions
Copy link

Choose a reason for hiding this comment

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

Flaky tests detected in 25e1c94.
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.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/5607349539
📝 Reported issues:

Please sign in to comment.