Skip to content

Commit

Permalink
Merge branch 'trunk' into try/playlist
Browse files Browse the repository at this point in the history
  • Loading branch information
carolinan committed May 12, 2023
2 parents 753982c + d24ac78 commit 5112865
Show file tree
Hide file tree
Showing 590 changed files with 12,253 additions and 5,236 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Expand Up @@ -105,6 +105,7 @@ const restrictedImports = [
'lowerCase',
'map',
'mapKeys',
'mapValues',
'maxBy',
'memoize',
'merge',
Expand Down
6 changes: 3 additions & 3 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
@@ -1,5 +1,5 @@
# Documentation
/docs @ajitbohra @ryanwelcher @juanmaguitar @fabiankaegy
/docs @ajitbohra @ryanwelcher @juanmaguitar @fabiankaegy @ndiego

# Schemas
/schemas/json @ajlende
Expand Down Expand Up @@ -57,7 +57,7 @@
# Tooling
/bin @ntwb @nerrad @ajitbohra
/bin/api-docs @ntwb @nerrad @ajitbohra
/docs/tool @ajitbohra
/docs/tool @ajitbohra @ndiego
/packages/babel-plugin-import-jsx-pragma @ntwb @nerrad @ajitbohra
/packages/babel-plugin-makepot @ntwb @nerrad @ajitbohra
/packages/babel-preset-default @gziolo @ntwb @nerrad @ajitbohra
Expand Down Expand Up @@ -125,7 +125,7 @@
/packages/report-flaky-tests @kevin940726

# wp-env
/packages/env @noahtallen
/packages/env @noahtallen @ObliviousHarmony

# PHP
/lib @spacedmonkey
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/check-components-changelog.yml
Expand Up @@ -42,8 +42,8 @@ jobs:
exit 1
fi
pr_link_pattern="\(\[#${PR_NUMBER}\]\(https://github\.com/WordPress/gutenberg/pull/${PR_NUMBER}\)\)"
pr_link_grep_pattern="(\[#${PR_NUMBER}\](https://github\.com/WordPress/gutenberg/pull/${PR_NUMBER}))"
pr_link_pattern="\[#${PR_NUMBER}\]\(https://github\.com/WordPress/gutenberg/pull/${PR_NUMBER}\)"
pr_link_grep_pattern="\[#${PR_NUMBER}\](https://github\.com/WordPress/gutenberg/pull/${PR_NUMBER})"
unreleased_section=$(sed -n '/^## Unreleased$/,/^## /p' "${changelog_path}")
Expand Down
28 changes: 26 additions & 2 deletions .github/workflows/unit-test.yml
Expand Up @@ -180,11 +180,35 @@ jobs:
- name: Running single site unit tests
if: ${{ ! matrix.multisite }}
run: npm run test:unit:php
run: |
set -o pipefail
npm run test:unit:php | tee phpunit.log
- name: Running multisite unit tests
if: ${{ matrix.multisite }}
run: npm run test:unit:php:multisite
run: |
set -o pipefail
npm run test:unit:php:multisite | tee phpunit.log
# Verifies that PHPUnit actually runs in the first place. We want visibility
# into issues which can cause it to fail silently, so we check the output
# to verify that at least 500 tests have passed. This is an arbitrary
# number, but makes sure a drastic change doesn't happen without us noticing.
- name: Check number of passed tests
run: |
# Note: relies on PHPUnit execution to fail on test failure.
# Extract the number of executed tests from the log file.
if ! num_tests=$(grep -Eo 'OK \([0-9]+ tests' phpunit.log) ; then
if ! num_tests=$(grep -Eo 'Tests: [0-9]+, Assertions:' phpunit.log) ; then
echo "PHPUnit failed or did not run. Check the PHPUnit output in the previous step to debug." && exit 1
fi
fi
# Extract just the number of tests from the string.
num_tests=$(echo "$num_tests" | grep -Eo '[0-9]+')
if [ $num_tests -lt 500 ] ; then
echo "Only $num_tests tests passed, which is much fewer than expected." && exit 1
fi
echo "$num_tests tests passed."
phpcs:
name: PHP coding standards
Expand Down
8 changes: 6 additions & 2 deletions bin/packages/build-worker.js
Expand Up @@ -103,9 +103,13 @@ async function buildCSS( file ) {
'animations',
'z-index',
]
// Editor styles should be excluded from the default CSS vars output.
// Editor and component styles should be excluded from the default CSS vars output.
.concat(
file.includes( 'common.scss' ) || ! file.includes( 'block-library' )
file.includes( 'common.scss' ) ||
! (
file.includes( 'block-library' ) ||
file.includes( 'components' )
)
? [ 'default-custom-properties' ]
: []
)
Expand Down
4 changes: 4 additions & 0 deletions bin/plugin/commands/changelog.js
Expand Up @@ -919,6 +919,10 @@ function getContributorProps( pullRequests ) {
getContributorPropsMarkdownList,
] )( pullRequests );

if ( ! contributorsList ) {
return '';
}

return (
'## First time contributors' +
'\n\n' +
Expand Down
21 changes: 18 additions & 3 deletions bin/plugin/commands/performance.js
Expand Up @@ -3,7 +3,6 @@
*/
const fs = require( 'fs' );
const path = require( 'path' );
const { mapValues } = require( 'lodash' );
const SimpleGit = require( 'simple-git' );

/**
Expand Down Expand Up @@ -475,10 +474,26 @@ async function runPerformanceTests( branches, options ) {
( r ) => r[ branch ][ dataPoint ]
);
} );
const medians = mapValues( resultsByDataPoint, median );
// @ts-ignore
const medians = Object.fromEntries(
Object.entries( resultsByDataPoint ).map(
( [ dataPoint, dataPointResults ] ) => [
dataPoint,
median( dataPointResults ),
]
)
);

// Format results as times.
results[ testSuite ][ branch ] = mapValues( medians, formatTime );
// @ts-ignore
results[ testSuite ][ branch ] = Object.fromEntries(
Object.entries( medians ).map(
( [ dataPoint, dataPointMedian ] ) => [
dataPoint,
formatTime( dataPointMedian ),
]
)
);
}
}

Expand Down
5 changes: 5 additions & 0 deletions bin/plugin/commands/test/changelog.js
Expand Up @@ -485,6 +485,11 @@ describe( 'getContributorProps', () => {
// npm run other:changelog -- --milestone="Gutenberg 11.3"
expect( getContributorProps( pullRequests ) ).toMatchSnapshot();
} );
test( 'do not include first time contributors section if there are not any', () => {
expect(
getContributorProps( pullRequests.slice( 0, 4 ) )
).toMatchInlineSnapshot( `""` );
} );
} );

describe( 'getContributorList', () => {
Expand Down

0 comments on commit 5112865

Please sign in to comment.