Skip to content

Commit

Permalink
Merge branch 'trunk' into fix/map-block-selection
Browse files Browse the repository at this point in the history
  • Loading branch information
coder-karen authored Aug 26, 2024
2 parents 39edec1 + 0e4843d commit 05c938f
Show file tree
Hide file tree
Showing 218 changed files with 964 additions and 561 deletions.
4 changes: 2 additions & 2 deletions .github/files/build-reminder-comment/get-check-comments.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ async function getCheckComments( github, owner, repo, number, testCommentIndicat
issue_number: +number,
per_page: 100,
} ) ) {
response.data.map( comment => {
for ( const comment of response.data ) {
if ( comment.body.includes( testCommentIndicator ) ) {
testCommentIDs.push( comment.id );
}
} );
}
}

cache[ cacheKey ] = testCommentIDs;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Significance: patch
Type: fixed
Comment: Fix `array-callback-return` eslint sniff. Should be no change to functionality.


Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: fixed

WPCOM Commit Reminder rask: Fix detection of existing reminder comment.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ async function getLabelsToAdd( octokit, owner, repo, number, isDraft, isRevert )

debug( 'add-labels: Loop through all files modified in this PR and add matching labels.' );

files.map( file => {
for ( const file of files ) {
// Projects.
const project = file.match( /^projects\/(?<ptype>[^/]*)\/(?<pname>[^/]*)\// );
if ( project && project.groups.ptype && project.groups.pname ) {
Expand Down Expand Up @@ -273,7 +273,7 @@ async function getLabelsToAdd( octokit, owner, repo, number, isDraft, isRevert )
if ( anyTestFile ) {
keywords.add( '[Tests] Includes Tests' );
}
} );
}

// The Image CDN was previously named "Photon".
// If we're touching that package, let's add the Photon label too
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,14 +157,14 @@ async function getCheckComment( octokit, owner, repo, number ) {
debug( `check-description: Looking for a previous comment from this task in our PR.` );

const comments = await getComments( octokit, owner, repo, number );
comments.map( comment => {
for ( const comment of comments ) {
if (
comment.user.login === 'github-actions[bot]' &&
comment.body.includes( '**Thank you for your PR!**' )
) {
commentID = comment.id;
}
} );
}

return commentID;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,15 @@ async function cleanLabels( payload, octokit ) {
labelsToRemoveFromPr
) }`
);
labelsToRemoveFromPr.map( name => {
for ( const name of labelsToRemoveFromPr ) {
debug( `clean-labels: removing the ${ name } label from PR #${ number }` );
octokit.rest.issues.removeLabel( {
owner: ownerLogin,
repo,
issue_number: number,
name,
} );
} );
}
}

module.exports = cleanLabels;
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ async function getListComment( issueComments ) {

debug( `gather-support-references: Looking for a previous comment from this task in our issue.` );

issueComments.map( comment => {
for ( const comment of issueComments ) {
if (
comment.user.login === 'github-actions[bot]' &&
comment.body.includes( '**Support References**' )
Expand All @@ -27,7 +27,7 @@ async function getListComment( issueComments ) {
body: comment.body,
};
}
} );
}

return commentInfo;
}
Expand Down Expand Up @@ -71,18 +71,18 @@ async function getIssueReferences( octokit, owner, repo, number, issueComments )
}

debug( `gather-support-references: Getting references from comments.` );
issueComments.map( comment => {
for ( const comment of issueComments ) {
if (
comment.user.login !== 'github-actions[bot]' ||
! comment.body.includes( '**Support References**' )
) {
ticketReferences.push( ...comment.body.matchAll( referencesRegexP ) );
}
} );
}

// Let's build a array with unique and correct support IDs, formatted properly.
const correctedSupportIds = new Set();
ticketReferences.map( reference => {
for ( const reference of ticketReferences ) {
let supportId = reference[ 0 ];

// xxx-zen is the preferred format for tickets.
Expand All @@ -98,7 +98,7 @@ async function getIssueReferences( octokit, owner, repo, number, issueComments )
}

correctedSupportIds.add( supportId );
} );
}

return [ ...correctedSupportIds ];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ async function getMatticBotComment( octokit, owner, repo, number ) {
debug( `wpcom-commit-reminder: Looking for a comment from Matticbot on this PR.` );

const comments = await getComments( octokit, owner.login, repo, number );
comments.map( comment => {
for ( const comment of comments ) {
if (
comment.user.login === 'matticbot' &&
comment.body.includes( 'This PR has changes that must be merged to WordPress.com' )
) {
commentBody = comment.body;
}
} );
}

return commentBody;
}
Expand All @@ -45,14 +45,14 @@ async function hasReminderComment( octokit, owner, repo, number ) {
debug( `wpcom-commit-reminder: Looking for a previous comment from this task in our PR.` );

const comments = await getComments( octokit, owner.login, repo, number );
comments.map( comment => {
for ( const comment of comments ) {
if (
comment.user.login === 'github-actions[bot]' &&
comment.body.includes( 'Great news! One last step' )
) {
return true;
}
} );
}

return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ async function getComments( octokit, owner, repo, number ) {
issue_number: +number,
per_page: 100,
} ) ) {
response.data.map( comment => {
for ( const comment of response.data ) {
issueComments.push( comment );
} );
}
}

cache[ cacheKey ] = issueComments;
Expand Down
4 changes: 2 additions & 2 deletions projects/github-actions/repo-gardening/src/utils/get-files.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ async function getFiles( octokit, owner, repo, number ) {
pull_number: +number,
per_page: 100,
} ) ) {
response.data.map( file => {
for ( const file of response.data ) {
fileList.push( file.filename );
if ( file.previous_filename ) {
fileList.push( file.previous_filename );
}
} );
}
}

cache[ cacheKey ] = fileList;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ const getLabels = require( './labels/get-labels' );
async function getPluginNames( octokit, owner, repo, number ) {
const plugins = [];
const labels = await getLabels( octokit, owner, repo, number );
labels.map( label => {
for ( const label of labels ) {
const plugin = label.match( /^\[Plugin\]\s(?<pluginName>[^/]*)$/ );
if ( plugin && plugin.groups.pluginName ) {
plugins.push( plugin.groups.pluginName.replace( /\s+/, '-' ).toLowerCase() );
}
} );
}

return plugins;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ async function getLabels( octokit, owner, repo, number ) {
issue_number: +number,
per_page: 100,
} ) ) {
response.data.map( label => {
for ( const label of response.data ) {
labelList.push( label.name );
} );
}
}

cache[ cacheKey ] = labelList;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,20 @@ const { getInput } = require( '@actions/core' );
async function hasManySupportReferences( issueComments ) {
const referencesThreshhold = getInput( 'reply_to_customers_threshold' );

let isWidelySpreadIssue = false;
issueComments.map( comment => {
for ( const comment of issueComments ) {
if (
comment.user.login === 'github-actions[bot]' &&
comment.body.includes( '**Support References**' )
) {
// Count the number of to-do items in the comment.
const countReferences = comment.body.split( '- [ ] ' ).length - 1;
if ( countReferences >= parseInt( referencesThreshhold ) ) {
isWidelySpreadIssue = true;
return true;
}
}
} );
}

return isWidelySpreadIssue;
return false;
}

module.exports = hasManySupportReferences;
5 changes: 5 additions & 0 deletions projects/js-packages/analytics/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

### This is a list detailing changes for the Jetpack RNA Analytics package releases.

## [0.1.31] - 2024-08-23
### Changed
- Updated package dependencies. [#39004]

## [0.1.30] - 2024-08-21
### Changed
- Internal updates.
Expand Down Expand Up @@ -120,6 +124,7 @@
### Added
- Initial release of jetpack-api package.

[0.1.31]: https://github.com/Automattic/jetpack-analytics/compare/v0.1.30...v0.1.31
[0.1.30]: https://github.com/Automattic/jetpack-analytics/compare/v0.1.29...v0.1.30
[0.1.29]: https://github.com/Automattic/jetpack-analytics/compare/v0.1.28...v0.1.29
[0.1.28]: https://github.com/Automattic/jetpack-analytics/compare/v0.1.27...v0.1.28
Expand Down

This file was deleted.

2 changes: 1 addition & 1 deletion projects/js-packages/analytics/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@automattic/jetpack-analytics",
"version": "0.1.31-alpha",
"version": "0.1.31",
"description": "Jetpack Analytics Package",
"homepage": "https://github.com/Automattic/jetpack/tree/HEAD/projects/js-packages/analytics/#readme",
"bugs": {
Expand Down
5 changes: 5 additions & 0 deletions projects/js-packages/base-styles/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.6.30] - 2024-08-23
### Changed
- Updated package dependencies. [#39004]

## [0.6.29] - 2024-08-15
### Changed
- Updated package dependencies. [#38662]
Expand Down Expand Up @@ -301,6 +305,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Updated package dependencies.
- Use Node 16.7.0 in tooling. This shouldn't change the behavior of the code itself.

[0.6.30]: https://github.com/Automattic/jetpack-base-styles/compare/0.6.29...0.6.30
[0.6.29]: https://github.com/Automattic/jetpack-base-styles/compare/0.6.28...0.6.29
[0.6.28]: https://github.com/Automattic/jetpack-base-styles/compare/0.6.27...0.6.28
[0.6.27]: https://github.com/Automattic/jetpack-base-styles/compare/0.6.26...0.6.27
Expand Down

This file was deleted.

2 changes: 1 addition & 1 deletion projects/js-packages/base-styles/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@automattic/jetpack-base-styles",
"version": "0.6.30-alpha",
"version": "0.6.30",
"description": "Jetpack components base styles",
"homepage": "https://github.com/Automattic/jetpack/tree/HEAD/projects/js-packages/base-styles/#readme",
"bugs": {
Expand Down
5 changes: 5 additions & 0 deletions projects/js-packages/boost-score-api/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.1.36] - 2024-08-23
### Changed
- Updated package dependencies. [#39004]

## [0.1.35] - 2024-08-21
### Changed
- Internal updates.
Expand Down Expand Up @@ -155,6 +159,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
- Create package for the boost score bar API [#30781]

[0.1.36]: https://github.com/Automattic/jetpack-boost-score-api/compare/v0.1.35...v0.1.36
[0.1.35]: https://github.com/Automattic/jetpack-boost-score-api/compare/v0.1.34...v0.1.35
[0.1.34]: https://github.com/Automattic/jetpack-boost-score-api/compare/v0.1.33...v0.1.34
[0.1.33]: https://github.com/Automattic/jetpack-boost-score-api/compare/v0.1.32...v0.1.33
Expand Down

This file was deleted.

2 changes: 1 addition & 1 deletion projects/js-packages/boost-score-api/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@automattic/jetpack-boost-score-api",
"version": "0.1.36-alpha",
"version": "0.1.36",
"description": "A package to get the Jetpack Boost score of a site",
"homepage": "https://github.com/Automattic/jetpack/tree/HEAD/projects/js-packages/boost-score-api/#readme",
"bugs": {
Expand Down
5 changes: 5 additions & 0 deletions projects/js-packages/components/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

### This is a list detailing changes for the Jetpack RNA Components package releases.

## [0.55.10] - 2024-08-23
### Changed
- Internal updates.

## [0.55.9] - 2024-08-21
### Fixed
- Revert recent SVG image optimizations. [#38981]
Expand Down Expand Up @@ -1133,6 +1137,7 @@
### Changed
- Update node version requirement to 14.16.1

[0.55.10]: https://github.com/Automattic/jetpack-components/compare/0.55.9...0.55.10
[0.55.9]: https://github.com/Automattic/jetpack-components/compare/0.55.8...0.55.9
[0.55.8]: https://github.com/Automattic/jetpack-components/compare/0.55.7...0.55.8
[0.55.7]: https://github.com/Automattic/jetpack-components/compare/0.55.6...0.55.7
Expand Down

This file was deleted.

2 changes: 1 addition & 1 deletion projects/js-packages/components/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@automattic/jetpack-components",
"version": "0.55.10-alpha",
"version": "0.55.10",
"description": "Jetpack Components Package",
"author": "Automattic",
"license": "GPL-2.0-or-later",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: fixed

Fix: Handle uncaught exception for images with empty or no src attributes.
Loading

0 comments on commit 05c938f

Please sign in to comment.