Skip to content

Commit

Permalink
Merge branch 'trunk' into try/56668-hide-template-parts-hint-theme-pr…
Browse files Browse the repository at this point in the history
…eview
  • Loading branch information
carolinan committed Mar 5, 2024
2 parents 6547af3 + 64fb8dd commit 536663c
Show file tree
Hide file tree
Showing 530 changed files with 10,529 additions and 6,348 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ module.exports = {
},
rules: {
'jest/expect-expect': 'off',
'react/jsx-boolean-value': 'error',
'@wordpress/dependency-group': 'error',
'@wordpress/is-gutenberg-plugin': 'error',
'@wordpress/react-no-unsafe-timeout': 'error',
Expand Down
16 changes: 8 additions & 8 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/packages/interactivity/docs @juanmaguitar

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

# Data
/packages/api-fetch @nerrad @mmtr
Expand All @@ -18,13 +18,13 @@
/packages/block-library/src/comment-template @michalczaplinski
/packages/block-library/src/comments @michalczaplinski
/packages/block-library/src/table-of-contents @ZebulanStanphill
/packages/block-library/src/image @artemiomorales @michalczaplinski
/packages/block-library/src/image @artemiomorales @michalczaplinski

# Duotone
/lib/block-supports/duotone.php @ajlende
/packages/block-editor/src/components/duotone-control @ajlende
/packages/block-editor/src/hooks/duotone.js @ajlende
/packages/components/src/duotone-picker @ajlende
/lib/block-supports/duotone.php
/packages/block-editor/src/components/duotone-control
/packages/block-editor/src/hooks/duotone.js
/packages/components/src/duotone-picker

# Editor
/packages/annotations @atimmer
Expand Down Expand Up @@ -82,7 +82,7 @@
/packages/scripts @gziolo @ntwb @nerrad @ajitbohra @ryanwelcher
/packages/stylelint-config @ntwb
/test/e2e @kevin940726 @Mamaduka
/test/php/gutenberg-coding-standards @anton-vlasenko
/test/php/gutenberg-coding-standards @anton-vlasenko

# UI Components
/packages/components @ajitbohra
Expand Down Expand Up @@ -125,7 +125,7 @@
/packages/block-editor/src/components/rich-text @ellatrix @fluiddot @dcalhoun

# Project Management
/.github
/.github @desrosj
/packages/project-management-automation
/packages/report-flaky-tests @kevin940726

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build-plugin-zip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -270,12 +270,12 @@ jobs:
run: echo "version=$(echo $VERSION | cut -d / -f 3 | sed 's/-rc./ RC/' )" >> $GITHUB_OUTPUT

- name: Download Plugin Zip Artifact
uses: actions/download-artifact@eaceaf801fd36c7dee90939fad912460b18a1ffe # v4.1.2
uses: actions/download-artifact@87c55149d96e628cc2ef7e6fc2aab372015aec85 # v4.1.3
with:
name: gutenberg-plugin

- name: Download Release Notes Artifact
uses: actions/download-artifact@eaceaf801fd36c7dee90939fad912460b18a1ffe # v4.1.2
uses: actions/download-artifact@87c55149d96e628cc2ef7e6fc2aab372015aec85 # v4.1.3
with:
name: release-notes

Expand Down
6 changes: 1 addition & 5 deletions .github/workflows/end2end-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,6 @@ jobs:
run: |
npm run wp-env start
- name: Running the tests
run: |
npx wp-scripts test-e2e --config=./packages/e2e-tests/jest.config.js --cacheDirectory="$HOME/.jest-cache"
- name: Archive debug artifacts (screenshots, HTML snapshots)
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
if: always()
Expand Down Expand Up @@ -120,7 +116,7 @@ jobs:
ref: trunk
show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}

- uses: actions/[email protected].2
- uses: actions/[email protected].3
id: download_artifact
# Don't fail the job if there isn't any flaky tests report.
continue-on-error: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/php-changes-detection.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:

- name: Get changed PHP files
id: changed-files-php
uses: tj-actions/changed-files@90a06d6ba9543371ab4df8eeca0be07ca6054959 # v42.0.2
uses: tj-actions/changed-files@800a2825992141ddde1a8bca8ad394cec34d3188 # v42.0.5
with:
files: |
*.{php}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pull-request-automation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
check-latest: true

- name: Cache NPM packages
uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0
uses: actions/cache@ab5e6d0c87105b4c9c2047343972218f562e4319 # v4.0.1
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/rnmobile-android-runner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
uses: ./.github/setup-node

- name: Restore tests setup cache
uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0
uses: actions/cache@ab5e6d0c87105b4c9c2047343972218f562e4319 # v4.0.1
with:
path: |
~/.appium
Expand All @@ -50,7 +50,7 @@ jobs:
uses: gradle/actions/setup-gradle@ec92e829475ac0c2315ea8f9eced72db85bb337a # v3.0.0

- name: AVD cache
uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0
uses: actions/cache@ab5e6d0c87105b4c9c2047343972218f562e4319 # v4.0.1
id: avd-cache
with:
path: |
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/rnmobile-ios-runner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
uses: ./.github/setup-node

- name: Restore tests setup cache
uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0
uses: actions/cache@ab5e6d0c87105b4c9c2047343972218f562e4319 # v4.0.1
with:
path: |
~/.appium
Expand All @@ -50,15 +50,15 @@ jobs:
run: find package-lock.json packages/react-native-editor/ios packages/react-native-aztec/ios packages/react-native-bridge/ios -type f -print0 | sort -z | xargs -0 shasum | tee ios-checksums.txt

- name: Restore build cache
uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0
uses: actions/cache@ab5e6d0c87105b4c9c2047343972218f562e4319 # v4.0.1
with:
path: |
packages/react-native-editor/ios/build/GutenbergDemo/Build/Products/Release-iphonesimulator/GutenbergDemo.app
packages/react-native-editor/ios/build/WDA
key: ${{ runner.os }}-ios-build-${{ matrix.xcode }}-${{ matrix.device }}-${{ hashFiles('ios-checksums.txt') }}

- name: Restore pods cache
uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0
uses: actions/cache@ab5e6d0c87105b4c9c2047343972218f562e4319 # v4.0.1
with:
path: |
packages/react-native-editor/ios/Pods
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ jobs:
# dependency versions are installed and cached.
##
- name: Set up PHP
uses: shivammathur/setup-php@6d7209f44a25a59e904b1ee9f3b0c33ab2cd888d # v2.29.0
uses: shivammathur/setup-php@a4e22b60bbb9c1021113f2860347b0759f66fe5d # v2.30.0
with:
php-version: '${{ matrix.php }}'
ini-file: development
Expand All @@ -144,7 +144,7 @@ jobs:
# Since Composer dependencies are installed using `composer update` and no lock file is in version control,
# passing a custom cache suffix ensures that the cache is flushed at least once per week.
- name: Install Composer dependencies
uses: ramsey/composer-install@83af392bf5f031813d25e6fe4cd626cdba9a2df6 # v2.2.0
uses: ramsey/composer-install@57532f8be5bda426838819c5ee9afb8af389d51a # v3.0.0
with:
custom-cache-suffix: $(/bin/date -u --date='last Mon' "+%F")

Expand Down Expand Up @@ -225,7 +225,7 @@ jobs:
show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}

- name: Set up PHP
uses: shivammathur/setup-php@6d7209f44a25a59e904b1ee9f3b0c33ab2cd888d # v2.29.0
uses: shivammathur/setup-php@a4e22b60bbb9c1021113f2860347b0759f66fe5d # v2.30.0
with:
php-version: '7.4'
coverage: none
Expand All @@ -238,15 +238,15 @@ jobs:
run: echo "date=$(/bin/date -u --date='last Mon' "+%F")" >> $GITHUB_OUTPUT

- name: Cache PHPCS scan cache
uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0
uses: actions/cache@ab5e6d0c87105b4c9c2047343972218f562e4319 # v4.0.1
with:
path: .cache/phpcs.json
key: ${{ runner.os }}-date-${{ steps.get-date.outputs.date }}-phpcs-cache-${{ hashFiles('**/composer.json', 'phpcs.xml.dist') }}

# Since Composer dependencies are installed using `composer update` and no lock file is in version control,
# passing a custom cache suffix ensures that the cache is flushed at least once per week.
- name: Install Composer dependencies
uses: ramsey/composer-install@83af392bf5f031813d25e6fe4cd626cdba9a2df6 # v2.2.0
uses: ramsey/composer-install@57532f8be5bda426838819c5ee9afb8af389d51a # v3.0.0
with:
custom-cache-suffix: ${{ steps.get-date.outputs.date }}

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/upload-release-to-plugin-repo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ jobs:
sed -i "s/$STABLE_TAG_PLACEHOLDER/Stable tag: $VERSION/g" ./trunk/readme.txt
- name: Download Changelog Artifact
uses: actions/download-artifact@eaceaf801fd36c7dee90939fad912460b18a1ffe # v4.1.2
uses: actions/download-artifact@87c55149d96e628cc2ef7e6fc2aab372015aec85 # v4.1.3
with:
name: changelog trunk
path: trunk
Expand Down Expand Up @@ -247,7 +247,7 @@ jobs:
sed -i "s/$STABLE_TAG_PLACEHOLDER/Stable tag: $VERSION/g" "$VERSION/readme.txt"
- name: Download Changelog Artifact
uses: actions/download-artifact@eaceaf801fd36c7dee90939fad912460b18a1ffe # v4.1.2
uses: actions/download-artifact@87c55149d96e628cc2ef7e6fc2aab372015aec85 # v4.1.3
with:
name: changelog trunk
path: ${{ github.event.release.name }}
Expand Down
61 changes: 45 additions & 16 deletions bin/api-docs/gen-block-lib-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,29 +148,58 @@ function getSourceFromFile( filename ) {
*/
function readBlockJSON( filename ) {
const blockjson = require( filename );

const {
name,
category,
supports,
attributes,
parent,
ancestor,
__experimental,
allowedBlocks,
} = blockjson;
const sourcefile = getSourceFromFile( filename );
const supportsList =
blockjson.supports !== undefined
? processObjWithInnerKeys( augmentSupports( blockjson.supports ) )
: [];
const attributes = getTruthyKeys( blockjson.attributes );
const parent = blockjson.parent
? '\n' + `- **Parent:** ${ blockjson.parent.join( ', ' ) }`
: '';
const experimental = blockjson.__experimental
? '\n' + `- **Experimental:** ${ blockjson.__experimental }`
: '';
const blockInfoList = [ `- **Name:** ${ name }` ];

if ( __experimental ) {
blockInfoList.push( `- **Experimental:** ${ __experimental }` );
}
if ( category?.length > 0 ) {
blockInfoList.push( `- **Category:** ${ category }` );
}
if ( parent?.length > 0 ) {
blockInfoList.push( `- **Parent:** ${ parent.join( ', ' ) }` );
}
if ( ancestor?.length > 0 ) {
blockInfoList.push( `- **Ancestor:** ${ ancestor.join( ', ' ) }` );
}
if ( allowedBlocks?.length > 0 ) {
blockInfoList.push(
`- **Allowed Blocks:** ${ allowedBlocks.join( ', ' ) }`
);
}
if ( supports ) {
blockInfoList.push(
`- **Supports:** ${ processObjWithInnerKeys(
augmentSupports( supports )
)
.sort()
.join( ', ' ) }`
);
}
const truthyAttributes = getTruthyKeys( attributes );
if ( truthyAttributes.length ) {
blockInfoList.push(
`- **Attributes:** ${ truthyAttributes.sort().join( ', ' ) }`
);
}

return `
## ${ blockjson.title }
${ blockjson.description } ([Source](${ sourcefile }))
- **Name:** ${ blockjson.name }${ experimental }
- **Category:** ${ blockjson.category }${ parent }
- **Supports:** ${ supportsList.sort().join( ', ' ) }
- **Attributes:** ${ attributes.sort().join( ', ' ) }
${ blockInfoList.join( '\n' ) }
`;
}

Expand Down
17 changes: 17 additions & 0 deletions bin/cherry-pick.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import readline from 'readline';
import { spawnSync } from 'node:child_process';

const LABEL = process.argv[ 2 ] || 'Backport to WP Beta/RC';
const BACKPORT_COMPLETED_LABEL = 'Backported to WP Core';
const BRANCH = getCurrentBranch();
const GITHUB_CLI_AVAILABLE = spawnSync( 'gh', [ 'auth', 'status' ] )
?.stdout?.toString()
Expand Down Expand Up @@ -334,6 +335,11 @@ function reportSummaryNextSteps( successes, failures ) {
nextSteps.push( 'Push this branch' );
nextSteps.push( 'Go to each of the cherry-picked Pull Requests' );
nextSteps.push( `Remove the ${ LABEL } label` );

if ( LABEL === 'Backport to WP Beta/RC' ) {
nextSteps.push( `Add the "${ BACKPORT_COMPLETED_LABEL }" label` );
}

nextSteps.push( 'Request a backport to wordpress-develop if required' );
nextSteps.push( 'Comment, say that PR just got cherry-picked' );
}
Expand Down Expand Up @@ -363,6 +369,17 @@ function GHcommentAndRemoveLabel( pr ) {
try {
cli( 'gh', [ 'pr', 'comment', number, '--body', comment ] );
cli( 'gh', [ 'pr', 'edit', number, '--remove-label', LABEL ] );

if ( LABEL === 'Backport to WP Beta/RC' ) {
cli( 'gh', [
'pr',
'edit',
number,
'--add-label',
BACKPORT_COMPLETED_LABEL,
] );
}

console.log( `✅ ${ number }: ${ comment }` );
} catch ( e ) {
console.log( `❌ ${ number }. ${ comment } ` );
Expand Down
Loading

0 comments on commit 536663c

Please sign in to comment.