Skip to content

Commit

Permalink
Merge branch 'trunk' of personal.github.com:WordPress/gutenberg into …
Browse files Browse the repository at this point in the history
…add/social-icon-color-border-spacing-support
  • Loading branch information
akasunil committed Aug 9, 2024
2 parents 0d025ce + 266361a commit f7eaf6a
Show file tree
Hide file tree
Showing 882 changed files with 18,722 additions and 28,728 deletions.
6 changes: 6 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -292,9 +292,15 @@ module.exports = {
...[
'CheckboxControl',
'ComboboxControl',
'DimensionControl',
'FocalPointPicker',
'RangeControl',
'SearchControl',
'SelectControl',
'TextControl',
'TextareaControl',
'ToggleControl',
'ToggleGroupControl',
'TreeSelect',
].map( ( componentName ) => ( {
selector: `JSXOpeningElement[name.name="${ componentName }"]:not(:has(JSXAttribute[name.name="__nextHasNoMarginBottom"]))`,
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/build-plugin-zip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ jobs:
show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}

- name: Use desired version of Node.js
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
with:
node-version-file: '.nvmrc'
check-latest: true
Expand Down 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@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: gutenberg-plugin

- name: Download Release Notes Artifact
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: release-notes

Expand Down Expand Up @@ -333,7 +333,7 @@ jobs:
git config user.email gutenberg@wordpress.org
- name: Setup Node.js
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
with:
node-version-file: 'main/.nvmrc'
registry-url: 'https://registry.npmjs.org'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/bundle-size.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}

- name: Use desired version of Node.js
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
with:
node-version-file: '.nvmrc'
check-latest: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check-backport-changelog.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Verify Core Backport Changlog
name: Verify Core Backport Changelog

on:
pull_request:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/end2end-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ jobs:
ref: trunk
show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}

- uses: actions/download-artifact@v4.1.7
- uses: actions/download-artifact@v4.1.8
# Don't fail the job if there isn't any flaky tests report.
continue-on-error: true
with:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/performance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,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 9725060a5b18904c6cc5fdbe4b06fbde7419e02c and it needs to be updated every WP major release.
# The current one is 5f4c9c853b15092ed885d5280edefb973c37d9e9 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 9725060a5b18904c6cc5fdbe4b06fbde7419e02c --tests-branch $GITHUB_SHA --wp-version "$WP_MAJOR"
./bin/plugin/cli.js perf $GITHUB_SHA 5f4c9c853b15092ed885d5280edefb973c37d9e9 --tests-branch $GITHUB_SHA --wp-version "$WP_MAJOR"
- name: Compare performance with custom branches
if: github.event_name == 'workflow_dispatch'
Expand All @@ -101,7 +101,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 9725060a5b18904c6cc5fdbe4b06fbde7419e02c $COMMITTED_AT
./bin/log-performance-results.js $CODEHEALTH_PROJECT_TOKEN trunk $GITHUB_SHA 5f4c9c853b15092ed885d5280edefb973c37d9e9 $COMMITTED_AT
- name: Archive debug artifacts (screenshots, HTML snapshots)
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish-npm-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,15 @@ jobs:
- name: Setup Node.js
if: ${{ github.event.inputs.release_type != 'wp' }}
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
with:
node-version-file: 'cli/.nvmrc'
registry-url: 'https://registry.npmjs.org'
check-latest: true

- name: Setup Node.js (for WP major version)
if: ${{ github.event.inputs.release_type == 'wp' && github.event.inputs.wp_version }}
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
with:
node-version-file: 'publish/.nvmrc'
registry-url: 'https://registry.npmjs.org'
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 @@ -18,7 +18,7 @@ jobs:
show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}

- name: Use desired version of Node.js
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
with:
node-version-file: '.nvmrc'
check-latest: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/rnmobile-ios-runner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
with:
show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}

- uses: ruby/setup-ruby@3783f195e29b74ae398d7caca108814bbafde90e # v1.180.1
- uses: ruby/setup-ruby@50ba3386b050ad5b97a41fcb81240cbee1d1821f # v1.188.0
with:
# `.ruby-version` file location
working-directory: packages/react-native-editor/ios
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/static-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}

- name: Use desired version of Node.js
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
with:
node-version-file: '.nvmrc'
check-latest: true
Expand Down
31 changes: 23 additions & 8 deletions .github/workflows/sync-backport-changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,33 @@ on:
push:
branches:
- trunk
issues:
types: [labeled]

jobs:
sync-backport-changelog:
name: Sync Core Backport Issue
runs-on: ubuntu-latest
if: >
github.event_name == 'push' ||
(
github.event_name == 'issues' &&
github.event.action == 'labeled' &&
github.event.label.name == '🤖 Sync Backport Changelog'
)
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
fetch-depth: 2 # Fetch the last two commits to compare changes
- name: Check for changes in backport-changelog
if: github.event_name == 'push'
run: |
git diff --quiet HEAD^ HEAD -- backport-changelog || echo "changes=true" >> $GITHUB_OUTPUT
if git diff --quiet HEAD^ HEAD -- backport-changelog; then
echo "skip_sync=true" >> "$GITHUB_ENV"
fi
- name: Sync Issue
if: env.changes == 'true'
if: ${{ ! env.skip_sync }}
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
with:
script: |
Expand Down Expand Up @@ -52,18 +65,20 @@ jobs:
const endDelimiter = '<!-- END TRUNK BACKPORT CHANGELOG -->';
const autoGeneratedContent = `${startDelimiter}\n${processedChangelog}\n${endDelimiter}`;
const regex = new RegExp(`${startDelimiter}[\\s\\S]*${endDelimiter}`);
const existingBody = latestIssue.body ?? '';
let newBody;
if (regex.test(latestIssue.body)) {
const regex = new RegExp(`${startDelimiter}[\\s\\S]*${endDelimiter}`);
if (regex.test(existingBody)) {
// If delimiters exist, replace the content between them
newBody = latestIssue.body.replace(regex, autoGeneratedContent);
newBody = existingBody.replace(regex, autoGeneratedContent);
} else {
// If delimiters don't exist, append the new content at the end
newBody = `${latestIssue.body}\n\n${autoGeneratedContent}`;
newBody = `${existingBody}\n\n${autoGeneratedContent}`;
}
if (newBody.trim() !== latestIssue.body.trim()) {
if (newBody.trim() !== existingBody.trim()) {
await github.rest.issues.update({
owner: context.repo.owner,
repo: context.repo.repo,
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ jobs:
# dependency versions are installed and cached.
##
- name: Set up PHP
uses: shivammathur/setup-php@2e947f1f6932d141d076ca441d0e1e881775e95b # v2.31.0
uses: shivammathur/setup-php@c541c155eee45413f5b09a52248675b1a2575231 # v2.31.1
with:
php-version: '${{ matrix.php }}'
ini-file: development
Expand All @@ -217,7 +217,7 @@ jobs:
custom-cache-suffix: $(/bin/date -u --date='last Mon' "+%F")

- name: Download built JavaScript assets
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: build-assets
path: ./build
Expand Down Expand Up @@ -295,7 +295,7 @@ jobs:
show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}

- name: Set up PHP
uses: shivammathur/setup-php@2e947f1f6932d141d076ca441d0e1e881775e95b # v2.31.0
uses: shivammathur/setup-php@c541c155eee45413f5b09a52248675b1a2575231 # v2.31.1
with:
php-version: '7.4'
coverage: none
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@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
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@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: changelog trunk
path: ${{ github.event.release.name }}
Expand Down
10 changes: 9 additions & 1 deletion .stylelintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@
"at-rule-empty-line-before": null,
"at-rule-no-unknown": null,
"comment-empty-line-before": null,
"declaration-property-value-allowed-list": [
{
"flex-direction": "/^(?!(row|column)-reverse).*$/"
},
{
"message": "Avoid the flex-direction reverse values. For accessibility reasons, visual, reading, and DOM order must match. Only use the reverse values when they do not affect reading order, meaning, and interaction."
}
],
"declaration-property-value-disallowed-list": [
{
"/.*/": [ "/--wp-components-color-/" ]
Expand All @@ -18,7 +26,7 @@
"property-disallowed-list": [
[ "order" ],
{
"message": "Avoid the order property. For accessibility reasons, visual, reading, and DOM order must match. Only use the order property when it does not affect reading order, meaning, and interaction"
"message": "Avoid the order property. For accessibility reasons, visual, reading, and DOM order must match. Only use the order property when it does not affect reading order, meaning, and interaction."
}
],
"rule-empty-line-before": null,
Expand Down
4 changes: 4 additions & 0 deletions backport-changelog/6.6/7088.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
https://github.com/WordPress/wordpress-develop/pull/7088

* https://github.com/WordPress/gutenberg/pull/63918

3 changes: 3 additions & 0 deletions backport-changelog/6.6/7097.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
https://github.com/WordPress/wordpress-develop/pull/7097

* https://github.com/WordPress/gutenberg/pull/63980
3 changes: 3 additions & 0 deletions backport-changelog/6.7/7020.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
https://github.com/WordPress/wordpress-develop/pull/7020

* https://github.com/WordPress/gutenberg/pull/63470
4 changes: 4 additions & 0 deletions backport-changelog/6.7/7137.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
https://github.com/WordPress/wordpress-develop/pull/7137

* https://github.com/WordPress/gutenberg/pull/64192
* https://github.com/WordPress/gutenberg/pull/64328
63 changes: 55 additions & 8 deletions backport-changelog/readme.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,63 @@
# Core Backport Changelog

Any PR that makes changes to be backported to [core](https://github.com/WordPress/wordpress-develop) should log a core PR here. It's possible to have multiple Gutenberg PRs link to a single core backport PR. The core backport PR can remain open as long as wanted/needed. The entries are sorted by core release (in folders), and each entry should be an md file with the core PR number as the file name, and the link to the Gutenberg PR in the file content. The file content should start with the core PR URL, followed by a Markdown list of Gutenberg PRs (see example). Files are used to avoid rebase conflicts.
If you've changed or added files to the Gutenberg plugin, you'll need to confirm whether the changes are to be backported to [WordPress Core](https://github.com/WordPress/wordpress-develop), and therefore featured in the next release of WordPress.

If you think a file path is wrongly flagged as needing a core backport PR, you can add it to the list of exceptions in `.github/workflows/check-backport-changelog.yml`.
On open Gutenberg PRs, changes to certain files are flagged as requiring backporting to WordPress Core, for example, PHP files in `/lib` and PHP unit tests.

## Example
These changes must have a corresponding Core PR before they can be merged to Gutenberg trunk.

To create a Core PR, first 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).

The Core PR can remain open as long as is required.

For more information on how to create a Core PR, see the [WordPress Core Handbook](https://make.wordpress.org/core/handbook/contribute/git/github-pull-requests-for-code-review/).

## How to add a Core Backport PR to the changelog

After you create Core PR, you'll need to create a corresponding markdown file, and place it within the appropriate release subdirectory.

The filename is the Core PR number.

For example, if your Core PR number is `1234` and is slated to be part of the WordPress 6.9 release, the filename will be `1234.md`, and will be placed in the `/backport-changelog/6.9` directory.

The content of the markdown file should be the Github URL of the Core PR, followed by a list of Gutenberg PR Github URLs whose changes are backported in the Core PR.

A single Core PR may contain changes from one or multiple Gutenberg PRs.

### Examples

Let's say the next WordPress release is 6.9. You have two Gutenberg PRs — `1111` and `2222` — whose changes are backported in a single Core PR, number `1234`.

First you would create a file named `1234.md` in the `/6.9` folder.

If the `/6.9` folder doesn't exist, create it.

Then you would add the following content to your new file:

Path: `{wp-release-number-x.x}/{core-pr-number}.md`, e.g. `6.6/1234.md`.
File content:
```md
https://github.com/WordPress/wordpress-develop/pull/{core-pr-number}
https://github.com/WordPress/wordpress-develop/pull/1234

* https://github.com/WordPress/gutenberg/pull/{first-gb-pr-number}
* https://github.com/WordPress/gutenberg/pull/{second-gb-pr-number}
* https://github.com/WordPress/gutenberg/pull/1111
* https://github.com/WordPress/gutenberg/pull/2222
```

If `1234.md` already exists, you would add the Gutenberg PRs to the list in the existing file.

## Why use individual files?

For the backport changelog, Gutenberg uses individual files as opposed to a single changelog file to avoid rebase conflicts.

## Exceptions

Some Gutenberg PRs may be flagged as needing a core backport PR when they don't, for example when the PR contains minor comment changes, or the changes already exist in Core.

For individual PRs, there are two Github labels that can be used to exclude a PR from the backport changelog CI check:

- `Backport from WordPress Core` - Indicates that the PR is a backport from WordPress Core and doesn't need a Core PR.
- `No Core Sync Required` - Indicates that any changes do not need to be synced to WordPress Core.

If there are specific file or directory changes that should **never** be flagged as requiring a Core backport PR, you can add it to the list of exceptions in [.github/workflows/check-backport-changelog.yml](https://github.com/WordPress/gutenberg/tree/trunk/.github/workflows/check-backport-changelog.yml).

## Where to get help

If you're unsure, you can always ask the Gutenberg Core team for help on the Gutenberg PR `@WordPress/gutenberg-core` or via the #core-editor channel in [WordPress Slack](https://make.wordpress.org/chat/).
Loading

0 comments on commit f7eaf6a

Please sign in to comment.