Skip to content

Commit

Permalink
Merge branch 'trunk' into update/revise-lightbox-ui
Browse files Browse the repository at this point in the history
  • Loading branch information
michalczaplinski committed Sep 6, 2023
2 parents 6951a86 + dc8b7c8 commit 92b084f
Show file tree
Hide file tree
Showing 805 changed files with 13,761 additions and 12,299 deletions.
3 changes: 1 addition & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ module.exports = {
'packages/e2e-test-utils-playwright/**/*.[tj]s',
],
extends: [
'plugin:eslint-plugin-playwright/playwright-test',
'plugin:@wordpress/eslint-plugin/test-playwright',
'plugin:@typescript-eslint/base',
],
parserOptions: {
Expand All @@ -308,7 +308,6 @@ module.exports = {
rules: {
'@wordpress/no-global-active-element': 'off',
'@wordpress/no-global-get-selection': 'off',
'playwright/no-page-pause': 'error',
'no-restricted-syntax': [
'error',
{
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/performance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,13 @@ jobs:
- name: Compare performance with base branch
if: github.event_name == 'push'
# The base hash used here need to be a commit that is compatible with the current WP version
# The current one is 34af5829ac9edb31833167ff6a3b51bea982999c and it needs to be updated every WP major release.
# The current one is bd2a881101727b03b0be09382b34841af5a3c03e and it needs to be updated every WP major release.
# It is used as a base comparison point to avoid fluctuation in the performance metrics.
run: |
WP_VERSION=$(awk -F ': ' '/^Tested up to/{print $2}' readme.txt)
IFS=. read -ra WP_VERSION_ARRAY <<< "$WP_VERSION"
WP_MAJOR="${WP_VERSION_ARRAY[0]}.${WP_VERSION_ARRAY[1]}"
./bin/plugin/cli.js perf $GITHUB_SHA 34af5829ac9edb31833167ff6a3b51bea982999c --tests-branch $GITHUB_SHA --wp-version "$WP_MAJOR"
./bin/plugin/cli.js perf $GITHUB_SHA bd2a881101727b03b0be09382b34841af5a3c03e --tests-branch $GITHUB_SHA --wp-version "$WP_MAJOR"
- name: Compare performance with custom branches
if: github.event_name == 'workflow_dispatch'
Expand All @@ -95,7 +95,7 @@ jobs:
CODEHEALTH_PROJECT_TOKEN: ${{ secrets.CODEHEALTH_PROJECT_TOKEN }}
run: |
COMMITTED_AT=$(git show -s $GITHUB_SHA --format="%cI")
./bin/log-performance-results.js $CODEHEALTH_PROJECT_TOKEN trunk $GITHUB_SHA 34af5829ac9edb31833167ff6a3b51bea982999c $COMMITTED_AT
./bin/log-performance-results.js $CODEHEALTH_PROJECT_TOKEN trunk $GITHUB_SHA bd2a881101727b03b0be09382b34841af5a3c03e $COMMITTED_AT
- name: Archive debug artifacts (screenshots, HTML snapshots)
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
Expand Down
20 changes: 19 additions & 1 deletion .github/workflows/publish-npm-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,31 +30,49 @@ jobs:
environment: WordPress packages
steps:
- name: Checkout (for CLI)
if: ${{ github.event.inputs.release_type != 'wp' }}
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
with:
path: cli
ref: trunk

- name: Checkout (for publishing)
if: ${{ github.event.inputs.release_type != 'wp' }}
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
with:
path: publish
# Later, we switch this branch in the script that publishes packages.
ref: trunk
token: ${{ secrets.GUTENBERG_TOKEN }}

- name: Checkout (for publishing WP major version)
if: ${{ github.event.inputs.release_type == 'wp' && github.event.inputs.wp_version }}
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
with:
path: publish
ref: wp/${{ github.event.inputs.wp_version }}
token: ${{ secrets.GUTENBERG_TOKEN }}

- name: Configure git user name and email (for publishing)
run: |
cd publish
git config user.name "Gutenberg Repository Automation"
git config user.email [email protected]
- name: Setup Node.js
if: ${{ github.event.inputs.release_type != 'wp' }}
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
with:
node-version-file: 'cli/.nvmrc'
registry-url: 'https://registry.npmjs.org'

- name: Setup Node.js (for WP major version)
if: ${{ github.event.inputs.release_type == 'wp' && github.event.inputs.wp_version }}
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
with:
node-version-file: 'publish/.nvmrc'
registry-url: 'https://registry.npmjs.org'

- name: Publish development packages to npm ("next" dist-tag)
if: ${{ github.event.inputs.release_type == 'development' }}
run: |
Expand All @@ -73,7 +91,7 @@ jobs:
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Publish packages to npm for WP major ("wp/${{ github.event.inputs.wp_version || 'X.Y' }}" dist-tag)
- name: Publish packages to npm for WP major version ("wp/${{ github.event.inputs.wp_version || 'X.Y' }}" dist-tag)
if: ${{ github.event.inputs.release_type == 'wp' && github.event.inputs.wp_version }}
run: |
cd publish
Expand Down
15 changes: 3 additions & 12 deletions bin/cherry-pick.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -118,19 +118,10 @@ async function fetchPRs() {
id,
number,
title,
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 );
} );

} ) )
.filter( ( { pull_request } ) => !! pull_request?.merged_at )
.sort( ( a, b ) => new Date( a?.pull_request?.merged_at ) - new Date( b?.pull_request?.merged_at ) );

console.log( 'Found the following PRs to cherry-pick (sorted by closed date in ascending order): ' );
PRs.forEach( ( { number, title } ) =>
Expand Down
4 changes: 2 additions & 2 deletions bin/plugin/commands/changelog.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ const LABEL_TYPE_MAPPING = {
'[Type] Project Management': 'Tools',
'[Package] Scripts': 'Tools',
'[Type] Build Tooling': 'Tools',
'Automated Testing': 'Tools',
'[Type] Automated Testing': 'Tools',
'[Package] Dependency Extraction Webpack Plugin': 'Tools',
'[Type] Code Quality': 'Code Quality',
'[Type] Accessibility (a11y)': 'Accessibility',
Expand Down Expand Up @@ -128,7 +128,7 @@ const LABEL_FEATURE_MAPPING = {
'New Block': 'Block Library',
'[Package] E2E Tests': 'Testing',
'[Package] E2E Test Utils': 'Testing',
'Automated Testing': 'Testing',
'[Type] Automated Testing': 'Testing',
'CSS Styling': 'CSS & Styling',
'developer-docs': 'Documentation',
'[Type] Developer Documentation': 'Documentation',
Expand Down
1 change: 1 addition & 0 deletions bin/plugin/commands/packages.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ async function runNpmReleaseBranchSyncStep( pluginReleaseBranch, config ) {
*/
await repo
.raw( 'rm', '-r', '.' )
.fetch( 'origin', pluginReleaseBranch, [ '--depth=1' ] )
.raw( 'checkout', `origin/${ pluginReleaseBranch }`, '--', '.' );

const { commit: commitHash } = await repo.commit(
Expand Down
2 changes: 1 addition & 1 deletion bin/plugin/commands/test/__snapshots__/changelog.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ exports[`getChangelog verify that the changelog is properly formatted 1`] = `
### Performance
- Add search performance measure and make other measures more stable. ([33848](https://github.com/WordPress/gutenberg/pull/33848))
- Avoid double parsing the content when loading the editor. ([33727](https://github.com/WordPress/gutenberg/pull/33727))
#### Block Library
Expand Down Expand Up @@ -170,7 +171,6 @@ exports[`getChangelog verify that the changelog is properly formatted 1`] = `
- Scripts: Update webpack to v5 (try 2). ([33818](https://github.com/WordPress/gutenberg/pull/33818))
#### Testing
- Add search performance measure and make other measures more stable. ([33848](https://github.com/WordPress/gutenberg/pull/33848))
- E2E: Block Hierarchy Navigation wait for the column to be highlighted. ([33721](https://github.com/WordPress/gutenberg/pull/33721))
Expand Down
Loading

0 comments on commit 92b084f

Please sign in to comment.