Skip to content

Commit eb4c754

Browse files
authored
Merge branch 'WordPress:trunk' into trunk
2 parents 614bd74 + efa4b01 commit eb4c754

File tree

590 files changed

+27017
-14203
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

590 files changed

+27017
-14203
lines changed

.github/workflows/end2end-test.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,8 @@ jobs:
8888
npm run wp-env start
8989
9090
- name: Run the tests
91+
env:
92+
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
9193
run: |
9294
xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- npm run test:e2e:playwright -- --shard=${{ matrix.part }}/${{ matrix.totalParts }}
9395

bin/plugin/commands/changelog.js

Lines changed: 33 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -114,15 +114,17 @@ const LABEL_FEATURE_MAPPING = {
114114
'[Feature] Raw Handling': 'Block Editor',
115115
'[Package] Edit Post': 'Post Editor',
116116
'[Package] Icons': 'Icons',
117-
'[Package] Block Editor': 'Block Editor',
117+
'[Package] Block editor': 'Block Editor',
118118
'[Package] Block library': 'Block Library',
119119
'[Package] Editor': 'Post Editor',
120+
'[Package] Edit Site': 'Site Editor',
120121
'[Package] Edit Widgets': 'Widgets Editor',
121122
'[Package] Widgets Customizer': 'Widgets Editor',
122123
'[Package] Components': 'Components',
123124
'[Package] Block Library': 'Block Library',
124125
'[Package] Rich text': 'Block Editor',
125126
'[Package] Data': 'Data Layer',
127+
'[Package] Commands': 'Commands',
126128
'[Block] Legacy Widget': 'Widgets Editor',
127129
'REST API Interaction': 'REST API',
128130
'New Block': 'Block Library',
@@ -220,9 +222,18 @@ function getTypesByLabels( labels ) {
220222
...new Set(
221223
labels
222224
.filter( ( label ) =>
223-
Object.keys( LABEL_TYPE_MAPPING ).includes( label )
225+
Object.keys( LABEL_TYPE_MAPPING )
226+
.map( ( currentLabel ) => currentLabel.toLowerCase() )
227+
.includes( label.toLowerCase() )
224228
)
225-
.map( ( label ) => LABEL_TYPE_MAPPING[ label ] )
229+
.map( ( label ) => {
230+
const lowerCaseLabel =
231+
Object.keys( LABEL_TYPE_MAPPING ).find(
232+
( key ) => key.toLowerCase() === label.toLowerCase()
233+
) || label;
234+
235+
return LABEL_TYPE_MAPPING[ lowerCaseLabel ];
236+
} )
226237
),
227238
];
228239
}
@@ -236,11 +247,24 @@ function getTypesByLabels( labels ) {
236247
* @return {string[]} Feature candidates.
237248
*/
238249
function mapLabelsToFeatures( labels ) {
239-
return labels
240-
.filter( ( label ) =>
241-
Object.keys( LABEL_FEATURE_MAPPING ).includes( label )
242-
)
243-
.map( ( label ) => LABEL_FEATURE_MAPPING[ label ] );
250+
return [
251+
...new Set(
252+
labels
253+
.filter( ( label ) =>
254+
Object.keys( LABEL_FEATURE_MAPPING )
255+
.map( ( currentLabel ) => currentLabel.toLowerCase() )
256+
.includes( label.toLowerCase() )
257+
)
258+
.map( ( label ) => {
259+
const lowerCaseLabel =
260+
Object.keys( LABEL_FEATURE_MAPPING ).find(
261+
( key ) => key.toLowerCase() === label.toLowerCase()
262+
) || label;
263+
264+
return LABEL_FEATURE_MAPPING[ lowerCaseLabel ];
265+
} )
266+
),
267+
];
244268
}
245269

246270
/**
@@ -1070,4 +1094,5 @@ async function getReleaseChangelog( options ) {
10701094
getChangelog,
10711095
getUniqueByUsername,
10721096
skipCreatedByBots,
1097+
mapLabelsToFeatures,
10731098
};

bin/plugin/commands/performance.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ async function runTestSuite( testSuite, testRunnerDir, runKey ) {
8787
testRunnerDir,
8888
{
8989
...process.env,
90+
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: '1',
9091
WP_ARTIFACTS_PATH: ARTIFACTS_PATH,
9192
RESULTS_ID: runKey,
9293
}

bin/plugin/commands/test/__snapshots__/changelog.js.snap

Lines changed: 191 additions & 133 deletions
Large diffs are not rendered by default.

bin/plugin/commands/test/changelog.js

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import {
1919
getChangelog,
2020
getContributorProps,
2121
getContributorsList,
22+
mapLabelsToFeatures,
2223
} from '../changelog';
2324
import _pullRequests from './fixtures/pull-requests.json';
2425
import botPullRequestFixture from './fixtures/bot-pull-requests.json';
@@ -312,18 +313,35 @@ describe( 'sortGroup', () => {
312313
} );
313314

314315
describe( 'getTypesByLabels', () => {
315-
it( 'returns all normalized type candidates by type prefix', () => {
316+
it( 'returns all normalized type candidates by type prefix. it is case insensitive', () => {
316317
const result = getTypesByLabels( [
317318
'[Type] Regression',
318319
'[Type] Bug',
319320
'[Package] Blocks',
320-
'[Type] Performance',
321+
'[Type] performance',
321322
] );
322323

323324
expect( result ).toEqual( [ 'Bug Fixes', 'Performance' ] );
324325
} );
325326
} );
326327

328+
describe( 'mapLabelsToFeatures', () => {
329+
it( 'returns all normalized feature candidates by feature prefix. it is case insensitive', () => {
330+
const result = mapLabelsToFeatures( [
331+
'[Package] Commands',
332+
'[Package] Block Library',
333+
'[Feature] Link Editing',
334+
'[Feature] block Multi Selection',
335+
] );
336+
337+
expect( result ).toEqual( [
338+
'Commands',
339+
'Block Library',
340+
'Block Editor',
341+
] );
342+
} );
343+
} );
344+
327345
describe( 'getTypesByTitle', () => {
328346
it.each( [
329347
[ 'Fix Typography panel rendering from style hooks' ],
@@ -473,7 +491,7 @@ describe( 'getFormattedItemDescription', () => {
473491
describe( 'getChangelog', () => {
474492
test( 'verify that the changelog is properly formatted', () => {
475493
// The fixture with the list of pull requests was generated by running the following command:
476-
// npm run other:changelog -- --milestone="Gutenberg 11.3"
494+
// npm run other:changelog -- --milestone="Gutenberg 16.8"
477495
// The response from the `fetchAllPullRequests` call in the `getChangelog` method was stored in the JSON file.
478496
expect( getChangelog( pullRequests ) ).toMatchSnapshot();
479497
} );

0 commit comments

Comments
 (0)