Skip to content

Commit

Permalink
Merge branch 'trunk' into fix/spacing-visualizer
Browse files Browse the repository at this point in the history
  • Loading branch information
ajlende committed Sep 3, 2021
2 parents 6cbfc20 + 4e664da commit 792ec91
Show file tree
Hide file tree
Showing 1,284 changed files with 76,089 additions and 46,383 deletions.
7 changes: 6 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,11 @@ module.exports = {
'error',
{
paths: [
{
name: 'framer-motion',
message:
'Please use the Framer Motion API through `@wordpress/components` instead.',
},
{
name: 'lodash',
importNames: [ 'memoize' ],
Expand Down Expand Up @@ -99,7 +104,7 @@ module.exports = {
{
name: '@emotion/css',
message:
'Please use `@emotion/react` and `@emotion/styled` in order to maintain iframe support',
'Please use `@emotion/react` and `@emotion/styled` in order to maintain iframe support. As a replacement for the `cx` function, please use the `useCx` hook defined in `@wordpress/components` instead.',
},
],
},
Expand Down
7 changes: 5 additions & 2 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,11 @@

# Widgets
/packages/edit-widgets @draganescu @talldan @noisysocks @tellthemachines @adamziel @kevin940726
/packages/customize-widgets @noisysocks
/packages/widgets @noisysocks

# Navigation
/packages/edit-navigation @draganescu @talldan @noisysocks @tellthemachines @adamziel @kevin940726 @getdave
/packages/edit-navigation @draganescu @talldan @tellthemachines @adamziel @kevin940726 @getdave

# Full Site Editing
/packages/edit-site
Expand Down Expand Up @@ -122,9 +124,10 @@
# PHP
/lib @timothybjacobs @spacedmonkey
/lib/global-styles.php @timothybjabocs @spacedmonkey @nosolosw
/lib/experimental-default-theme.json @timothybjabocs @spacedmonkey @nosolosw
/lib/theme.json @timothybjabocs @spacedmonkey @nosolosw
/lib/class-wp-theme-json-gutenberg.php @timothybjabocs @spacedmonkey @nosolosw
/lib/class-wp-theme-json-resolver-gutenberg.php @timothybjabocs @spacedmonkey @nosolosw
/lib/full-site-editing @janw-me
/phpunit/class-wp-theme-json-test.php @nosolosw

# Web App
Expand Down
68 changes: 0 additions & 68 deletions .github/ISSUE_TEMPLATE/Bug_report.md

This file was deleted.

72 changes: 72 additions & 0 deletions .github/ISSUE_TEMPLATE/Bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Bug report
description: Report a bug with the WordPress block editor or Gutenberg plugin
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to fill out this bug report! If this is a security issue, please report it in HackerOne instead: https://hackerone.com/wordpress
- type: textarea
attributes:
label: Description
description: Please write a brief description of the bug, including what you expect to happen and what is currently happening.
placeholder: |
Feature '...' is not working properly. I expect '...' to happen, but '...' happens instead
validations:
required: true

- type: textarea
attributes:
label: Step-by-step reproduction instructions
description: Please write the steps needed to reproduce the bug.
placeholder: |
1. Go to '...'
2. Click on '...'
3. Scroll down to '...'
validations:
required: true

- type: textarea
attributes:
label: Screenshots, screen recording, code snippet
description: |
If possible, please upload a screenshot or screen recording which demonstrates the bug. You can use LIEcap to create a GIF screen recording: https://www.cockos.com/licecap/
Tip: You can attach images or log files by clicking this area to highlight it and then dragging files in.
If this bug is to related to a developer API, please share a code snippet that demonstrates the issue. For small snippets paste it directly here, or you can use GitHub Gist to share multiple code files: https://gist.github.com
Please ensure the shared code can be used by a developer to reproduce the issue—ideally it can be copied into a local development environment or executed in a browser console to help debug the issue
validations:
required: false

- type: textarea
attributes:
label: Environment info
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.).
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'
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'
validations:
required: true
2 changes: 1 addition & 1 deletion .github/workflows/end2end-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
- name: Npm install and build
run: |
npm ci
FORCE_REDUCED_MOTION=true npm run build
npm run build
- name: Install WordPress
run: |
Expand Down
22 changes: 22 additions & 0 deletions .github/workflows/performance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ on:
pull_request:
release:
types: [published]
push:
branches: [trunk]

# Cancels all previous workflow runs for pull requests that have not completed.
concurrency:
Expand Down Expand Up @@ -49,3 +51,23 @@ jobs:
IFS=. read -ra WP_VERSION_ARRAY <<< "$WP_VERSION"
WP_MAJOR="${WP_VERSION_ARRAY[0]}.${WP_VERSION_ARRAY[1]}"
./bin/plugin/cli.js perf --ci "wp/$WP_MAJOR" "$PREVIOUS_RELEASE_BRANCH" "$CURRENT_RELEASE_BRANCH" --wp-version "$WP_MAJOR"
- name: Compare performance with base branch
if: github.event_name == 'push'
run: ./bin/plugin/cli.js perf --ci $GITHUB_SHA wp/5.8 --tests-branch $GITHUB_SHA

- uses: actions/github-script@0.3.0
if: github.event_name == 'push'
id: commit-timestamp
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
const commit_details = await github.git.getCommit({owner: context.repo.owner, repo: context.repo.repo, commit_sha: context.sha});
return parseInt((new Date( commit_details.data.author.date ).getTime() / 1000).toFixed(0))
- name: Publish performance results
if: github.event_name == 'push'
env:
COMMITTED_AT: ${{ steps.commit-timestamp.outputs.result }}
CODEHEALTH_PROJECT_TOKEN: ${{ secrets.CODEHEALTH_PROJECT_TOKEN }}
run: ./bin/log-perormance-results.js $CODEHEALTH_PROJECT_TOKEN trunk $GITHUB_SHA wp/5.8 $COMMITTED_AT
7 changes: 3 additions & 4 deletions .github/workflows/rnmobile-android-runner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ concurrency:
jobs:
test:
runs-on: macos-latest
# The false value below disables the test while we investigate a
# foundational error causing failures
if: ${{ false && (github.repository == 'WordPress/gutenberg' || github.event_name == 'pull_request') }}
if: ${{ github.repository == 'WordPress/gutenberg' || github.event_name == 'pull_request' }}
strategy:
matrix:
native-test-name: [gutenberg-editor-initial-html]
Expand All @@ -41,9 +39,10 @@ jobs:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}

- uses: reactivecircus/android-emulator-runner@d2799957d660add41c61a5103e2fbb9e2889eb73 # v2.15.0
- uses: reactivecircus/android-emulator-runner@5de26e4bd23bf523e8a4b7f077df8bfb8e52b50e # v2.19.1
with:
api-level: 28
emulator-build: 7425822 # https://git.io/JE3jX
profile: pixel_xl
script: npm run native test:e2e:android:local ${{ matrix.native-test-name }}

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 @@ -108,4 +108,4 @@ jobs:
npx lerna run build
- name: Running the tests
run: npm run test-unit:native -- --ci --maxWorkers=2 --cacheDirectory="$HOME/.jest-cache"
run: npm run native test -- --ci --maxWorkers=2 --cacheDirectory="$HOME/.jest-cache"
10 changes: 8 additions & 2 deletions .github/workflows/upload-release-to-plugin-repo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,14 @@ jobs:
- name: Commit the Changelog update
run: |
git add changelog.txt
git commit -m "Update Changelog for ${TAG#v}"
git push --set-upstream origin "${{ matrix.branch }}"
# Remove files that are not meant to be commited
# ie. release_notes.txt created on the previous step.
git clean -fd
# Only attempt to commit changelog if it has been modified.
if ! git diff-index --quiet HEAD --; then
git commit -m "Update Changelog for ${TAG#v}"
git push --set-upstream origin "${{ matrix.branch }}"
fi
- name: Upload Changelog artifact
uses: actions/upload-artifact@e448a9b857ee2131e752b06002bf0e093c65e571 # v2.2.2
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ build-types
node_modules
gutenberg.zip
coverage
*-performance-results.json

# Directories/files that may appear in your environment
*.log
Expand Down
19 changes: 18 additions & 1 deletion .vscode/launch-example.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,23 @@
"pathMappings": {
"/var/www/html/wp-content/plugins/gutenberg": "${workspaceRoot}/"
}
},
{
"type": "node",
"request": "launch",
"name": "Debug current e2e test",
"program": "${workspaceRoot}/node_modules/@wordpress/scripts/bin/wp-scripts.js",
"args": [
"test-e2e",
"--config=${workspaceRoot}/packages/e2e-tests/jest.config.js",
"--verbose=true",
"--runInBand",
"--watch",
"${file}"
],
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"trace": "all"
}
]
}
}
53 changes: 53 additions & 0 deletions bin/log-perormance-results.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#!/usr/bin/env node

/**
* External dependencies
*/
const fs = require( 'fs' );
const path = require( 'path' );
const https = require( 'https' );
const [ token, branch, hash, baseHash, timestamp ] = process.argv.slice( 2 );

const performanceResults = JSON.parse(
fs.readFileSync(
path.join( __dirname, '../post-editor-performance-results.json' ),
'utf8'
)
);

const data = new TextEncoder().encode(
JSON.stringify( {
branch,
hash,
baseHash,
timestamp: parseInt( timestamp, 10 ),
metrics: performanceResults[ hash ],
baseMetrics: performanceResults[ baseHash ],
} )
);

const options = {
hostname: 'codehealth.vercel.app',
port: 443,
path: '/api/log?token=' + token,
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Content-Length': data.length,
},
};

const req = https.request( options, ( res ) => {
console.log( `statusCode: ${ res.statusCode }` );

res.on( 'data', ( d ) => {
process.stdout.write( d );
} );
} );

req.on( 'error', ( error ) => {
console.error( error );
} );

req.write( data );
req.end();
3 changes: 2 additions & 1 deletion bin/packages/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,8 @@ stream
console.error( error );
}

if ( ended && ++complete === files.length ) {
++complete;
if ( ended && complete === files.length ) {
workerFarm.end( worker );
}
} )
Expand Down
2 changes: 1 addition & 1 deletion bin/packages/watch.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ function isSourceFile( filename ) {
const relativePath = path.relative( process.cwd(), filename );

return (
/\/src\/.+\.(js|json|scss)$/.test( relativePath ) &&
/\/src\/.+\.(js|json|scss|ts|tsx)$/.test( relativePath ) &&
! [
/\/(benchmark|__mocks__|__tests__|test|storybook|stories)\/.+/,
/.\.(spec|test)\.js$/,
Expand Down
Loading

0 comments on commit 792ec91

Please sign in to comment.