Skip to content

Commit

Permalink
Merge branch 'trunk' into remove/boost/state/pagination-component
Browse files Browse the repository at this point in the history
  • Loading branch information
dilirity committed Sep 19, 2023
2 parents 02584d3 + 24b4c87 commit 8d06ee0
Show file tree
Hide file tree
Showing 97 changed files with 3,060 additions and 715 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: minor
Type: added

Added support for GitHub Enterprise by replacing github.com with a dynamic variable
9 changes: 5 additions & 4 deletions projects/github-actions/push-to-mirrors/push-to-mirrors.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
# - BUILD_BASE: Path to the build directory, which contains "mirrors.txt" and directories for each repo to mirror to.
# - GITHUB_ACTOR: GitHub username for the commit being mirrored.
# - GITHUB_REF: Git ref being mirrored from, e.g. "refs/heads/main". Must begin with "refs/heads/".
# - GITHUB_SERVER_URL: The URL of the GitHub server. For example: https://github.com
#
# Other:
# - API_TOKEN_GITHUB: Personal access token to use when accessing GitHub.
Expand Down Expand Up @@ -40,7 +41,7 @@ fi

if [[ -z "$COMMIT_MESSAGE" ]]; then
MONOREPO_COMMIT_MESSAGE=$(cd "${SOURCE_DIR:-.}" && git show -s --format=%B $GITHUB_SHA)
COMMIT_MESSAGE=$( printf "%s\n\nCommitted via a GitHub action: https://github.com/%s/actions/runs/%s\n" "$MONOREPO_COMMIT_MESSAGE" "$GITHUB_REPOSITORY" "$GITHUB_RUN_ID" )
COMMIT_MESSAGE=$( printf "%s\n\nCommitted via a GitHub action: %s/%s/actions/runs/%s\n" "$MONOREPO_COMMIT_MESSAGE" "$GITHUB_SERVER_URL" "$GITHUB_REPOSITORY" "$GITHUB_RUN_ID" )
fi
COMMIT_ORIGINAL_AUTHOR="${GITHUB_ACTOR} <${GITHUB_ACTOR}@users.noreply.github.com>"

Expand Down Expand Up @@ -69,9 +70,9 @@ while read -r GIT_SLUG; do

# Initialize the directory as a git repo, and set the remote
git init -b "$BRANCH" .
git remote add origin "https://github.com/${GIT_SLUG}"
git remote add origin "${GITHUB_SERVER_URL}/${GIT_SLUG}"
if [[ -n "$API_TOKEN_GITHUB" ]]; then
git config --local http.https://github.com/.extraheader "AUTHORIZATION: basic $(printf "x-access-token:%s" "$API_TOKEN_GITHUB" | base64)"
git config --local http.${GITHUB_SERVER_URL}/.extraheader "AUTHORIZATION: basic $(printf "x-access-token:%s" "$API_TOKEN_GITHUB" | base64)"
fi

# Check if a remote exists for that mirror.
Expand Down Expand Up @@ -104,7 +105,7 @@ while read -r GIT_SLUG; do
{ [[ -z "$CI" ]] || git push origin "$BRANCH"; } # Only do the actual push from the GitHub Action
then
git show --pretty= --src-prefix="a/$GIT_SLUG/" --dst-prefix="b/$GIT_SLUG/" >> "$BUILD_BASE/changes.diff"
echo "https://github.com/$GIT_SLUG/commit/$(git rev-parse HEAD)"
echo "${GITHUB_SERVER_URL}/$GIT_SLUG/commit/$(git rev-parse HEAD)"
echo "Completed $GIT_SLUG"
else
echo "::error::Commit of ${GIT_SLUG} failed"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: minor
Type: added

Added support for GitHub Enterprise by replacing github.com with a dynamic variable
2 changes: 1 addition & 1 deletion projects/github-actions/required-review/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "required-review",
"version": "3.1.0",
"version": "3.2.0-alpha",
"description": "Check that a Pull Request has reviews from required teams.",
"main": "index.js",
"author": "Automattic",
Expand Down
2 changes: 1 addition & 1 deletion projects/github-actions/required-review/src/reporter.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ async function status( state, description ) {
repo: repo,
sha: github.context.payload.pull_request.head.sha,
state: state,
target_url: `https://github.com/${ owner }/${ repo }/actions/runs/${ github.context.runId }`,
target_url: `${ github.context.serverUrl }/${ owner }/${ repo }/actions/runs/${ github.context.runId }`,
description: description,
context: core.getInput( 'status', { required: true } ),
};
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: fixed

Only allow selectable image types for Social attached media
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { __ } from '@wordpress/i18n';
import { Icon, closeSmall } from '@wordpress/icons';
import classNames from 'classnames';
import { isVideo } from '../../hooks/use-media-restrictions';
import { SELECTABLE_IMAGE_TYPES } from '../../hooks/use-media-restrictions/restrictions';
import VideoPreview from '../video-preview';
import styles from './styles.module.scss';

Expand Down Expand Up @@ -124,6 +125,7 @@ export default function MediaPicker( {
<ThemeProvider>
<MediaUploadCheck>
<MediaUpload
allowedTypes={ SELECTABLE_IMAGE_TYPES }
title={ buttonLabel }
onSelect={ onUpdateMedia }
render={ setMediaRender }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ const VIDEOPRESS = 'video/videopress';
const allowedImageTypes = [ 'image/jpeg', 'image/jpg', 'image/png' ];
const facebookImageTypes = allowedImageTypes.concat( [
'image/gif',
'image/tiff',
'image/tif',
// We do not support tiff image, because Wordpress Core cannot display it.
// 'image/tiff',
// 'image/tif',
'image/bmp',
] );
const facebookVideoTypes = [
Expand Down Expand Up @@ -155,9 +156,23 @@ export const PHOTON_CONVERTIBLE_TYPES = [
'image/png',
'image/jpeg',
'image/jpg',
'image/tiff',
'image/tif',
// We do not support tiff image, because Wordpress Core cannot display it.
// 'image/tiff',
// 'image/tif',
'image/heic',
'image/heif',
'image/webp',
];

/**
* These are the types that can be selected in the media picker.
* Contains all the allowed types, plus the Photon convertible types.
*/
export const SELECTABLE_IMAGE_TYPES = [
...new Set( [
...allowedImageTypes,
...facebookImageTypes,
...mastodonImageTypes,
...PHOTON_CONVERTIBLE_TYPES,
] ),
];
4 changes: 3 additions & 1 deletion projects/packages/codesniffer/Jetpack-Compat-74/ruleset.xml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@
<exclude name="PHPCompatibility.Constants.NewConstants.tidy_tag_timeFound" />
<exclude name="PHPCompatibility.Constants.NewConstants.tidy_tag_trackFound" />
<exclude name="PHPCompatibility.Constants.NewConstants.tidy_tag_videoFound" />
<exclude name="PHPCompatibility.FunctionDeclarations.NewArrowFunction.Found" />
<exclude name="PHPCompatibility.FunctionDeclarations.NewExceptionsFromToString.Found" />
<exclude name="PHPCompatibility.FunctionDeclarations.NewExceptionsFromToString.ThrowsTagFoundInDocblock" />
<exclude name="PHPCompatibility.FunctionNameRestrictions.NewMagicMethods.__serializeFound" />
Expand All @@ -76,10 +75,13 @@
<exclude name="PHPCompatibility.FunctionUse.RequiredToOptionalFunctionParameters.array_merge_recursive_array_s__to_mergeMissing" />
<exclude name="PHPCompatibility.IniDirectives.NewIniDirectives.ffi_enableFound" />
<exclude name="PHPCompatibility.IniDirectives.NewIniDirectives.ffi_preloadFound" />
<exclude name="PHPCompatibility.IniDirectives.NewIniDirectives.mbstring_regex_retry_limitFound" />
<exclude name="PHPCompatibility.IniDirectives.NewIniDirectives.opcache_cache_idFound" />
<exclude name="PHPCompatibility.IniDirectives.NewIniDirectives.opcache_preloadFound" />
<exclude name="PHPCompatibility.IniDirectives.NewIniDirectives.opcache_preload_userFound" />
<exclude name="PHPCompatibility.IniDirectives.NewIniDirectives.unserialize_max_depthFound" />
<exclude name="PHPCompatibility.IniDirectives.NewIniDirectives.zend_exception_ignore_argsFound" />
<exclude name="PHPCompatibility.Keywords.NewKeywords.t_fnFound" />
<exclude name="PHPCompatibility.Miscellaneous.NewPHPOpenTagEOF.Found" />
<exclude name="PHPCompatibility.Numbers.NewNumericLiteralSeparator.Found" />
<exclude name="PHPCompatibility.Operators.NewOperators.t_coalesce_equalFound" />
Expand Down
21 changes: 21 additions & 0 deletions projects/packages/codesniffer/Jetpack-Compat-80/ruleset.xml
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,30 @@
<exclude name="PHPCompatibility.FunctionUse.RequiredToOptionalFunctionParameters.imageopenpolygon_num_pointsMissing" />
<exclude name="PHPCompatibility.FunctionUse.RequiredToOptionalFunctionParameters.imagepolygon_num_pointsMissing" />
<exclude name="PHPCompatibility.IniDirectives.NewIniDirectives.com_dotnet_versionFound" />
<exclude name="PHPCompatibility.IniDirectives.NewIniDirectives.opcache_jit_bisect_limitFound" />
<exclude name="PHPCompatibility.IniDirectives.NewIniDirectives.opcache_jit_blacklist_root_traceFound" />
<exclude name="PHPCompatibility.IniDirectives.NewIniDirectives.opcache_jit_blacklist_side_traceFound" />
<exclude name="PHPCompatibility.IniDirectives.NewIniDirectives.opcache_jit_buffer_sizeFound" />
<exclude name="PHPCompatibility.IniDirectives.NewIniDirectives.opcache_jit_debugFound" />
<exclude name="PHPCompatibility.IniDirectives.NewIniDirectives.opcache_jitFound" />
<exclude name="PHPCompatibility.IniDirectives.NewIniDirectives.opcache_jit_hot_funcFound" />
<exclude name="PHPCompatibility.IniDirectives.NewIniDirectives.opcache_jit_hot_loopFound" />
<exclude name="PHPCompatibility.IniDirectives.NewIniDirectives.opcache_jit_hot_returnFound" />
<exclude name="PHPCompatibility.IniDirectives.NewIniDirectives.opcache_jit_hot_side_exitFound" />
<exclude name="PHPCompatibility.IniDirectives.NewIniDirectives.opcache_jit_max_exit_countersFound" />
<exclude name="PHPCompatibility.IniDirectives.NewIniDirectives.opcache_jit_max_loop_unrollsFound" />
<exclude name="PHPCompatibility.IniDirectives.NewIniDirectives.opcache_jit_max_polymorphic_callsFound" />
<exclude name="PHPCompatibility.IniDirectives.NewIniDirectives.opcache_jit_max_recursive_callsFound" />
<exclude name="PHPCompatibility.IniDirectives.NewIniDirectives.opcache_jit_max_recursive_returnsFound" />
<exclude name="PHPCompatibility.IniDirectives.NewIniDirectives.opcache_jit_max_root_tracesFound" />
<exclude name="PHPCompatibility.IniDirectives.NewIniDirectives.opcache_jit_max_side_tracesFound" />
<exclude name="PHPCompatibility.IniDirectives.NewIniDirectives.opcache_jit_prof_thresholdFound" />
<exclude name="PHPCompatibility.IniDirectives.NewIniDirectives.pm_status_listenFound" />
<exclude name="PHPCompatibility.IniDirectives.NewIniDirectives.zend_exception_string_param_max_lenFound" />
<exclude name="PHPCompatibility.Interfaces.NewInterfaces.domchildnodeFound" />
<exclude name="PHPCompatibility.Interfaces.NewInterfaces.domparentnodeFound" />
<exclude name="PHPCompatibility.Interfaces.NewInterfaces.stringableFound" />
<exclude name="PHPCompatibility.Keywords.NewKeywords.t_matchFound" />
<exclude name="PHPCompatibility.Operators.NewOperators.t_nullsafe_object_operatorFound" />
<exclude name="PHPCompatibility.Syntax.NewInterpolatedStringDereferencing.Found" />
<exclude name="PHPCompatibility.Syntax.NewMagicConstantDereferencing.Found" />
Expand Down
11 changes: 11 additions & 0 deletions projects/packages/codesniffer/Jetpack-Compat-81/ruleset.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@
<exclude name="PHPCompatibility.Classes.NewClasses.fibererrorFound" />
<exclude name="PHPCompatibility.Classes.NewClasses.fiberFound" />
<exclude name="PHPCompatibility.Classes.NewClasses.intldatepatterngeneratorFound" />
<exclude name="PHPCompatibility.Classes.NewClasses.reflectionenumbackedcaseFound" />
<exclude name="PHPCompatibility.Classes.NewClasses.reflectionenumFound" />
<exclude name="PHPCompatibility.Classes.NewClasses.reflectionenumunitcaseFound" />
<exclude name="PHPCompatibility.Classes.NewClasses.reflectionfiberFound" />
<exclude name="PHPCompatibility.Classes.NewClasses.reflectionintersectiontypeFound" />
<exclude name="PHPCompatibility.Classes.NewFinalConstants.Found" />
<exclude name="PHPCompatibility.Classes.NewReadonlyProperties.Found" />
<exclude name="PHPCompatibility.Classes.NewReadonlyProperties.FoundInConstructor" />
Expand Down Expand Up @@ -36,7 +40,10 @@
<exclude name="PHPCompatibility.Constants.NewConstants.so_donttruncFound" />
<exclude name="PHPCompatibility.Constants.NewConstants.so_markFound" />
<exclude name="PHPCompatibility.Constants.NewConstants.so_wantmoreFound" />
<exclude name="PHPCompatibility.Constants.NewConstants.t_ampersand_followed_by_var_or_varargFound" />
<exclude name="PHPCompatibility.Constants.NewConstants.t_ampersand_not_followed_by_var_or_varargFound" />
<exclude name="PHPCompatibility.Constants.NewConstants.tcp_defer_acceptFound" />
<exclude name="PHPCompatibility.Constants.NewConstants.t_enumFound" />
<exclude name="PHPCompatibility.Constants.NewConstants.t_readonlyFound" />
<exclude name="PHPCompatibility.FunctionDeclarations.NewParamTypeDeclarations.IntersectionTypeFound" />
<exclude name="PHPCompatibility.FunctionDeclarations.NewReturnTypeDeclarations.IntersectionTypeFound" />
Expand All @@ -46,6 +53,7 @@
<exclude name="PHPCompatibility.FunctionUse.NewFunctionParameters.hash_init_optionsFound" />
<exclude name="PHPCompatibility.FunctionUse.NewFunctionParameters.hash_optionsFound" />
<exclude name="PHPCompatibility.FunctionUse.NewFunctions.array_is_listFound" />
<exclude name="PHPCompatibility.FunctionUse.NewFunctions.enum_existsFound" />
<exclude name="PHPCompatibility.FunctionUse.NewFunctions.fdatasyncFound" />
<exclude name="PHPCompatibility.FunctionUse.NewFunctions.fsyncFound" />
<exclude name="PHPCompatibility.FunctionUse.NewFunctions.imageavifFound" />
Expand Down Expand Up @@ -77,6 +85,9 @@
<exclude name="PHPCompatibility.InitialValue.NewNewInInitializers.constFound" />
<exclude name="PHPCompatibility.InitialValue.NewNewInInitializers.defaultFound" />
<exclude name="PHPCompatibility.InitialValue.NewNewInInitializers.staticvarFound" />
<exclude name="PHPCompatibility.Interfaces.NewInterfaces.backedenumFound" />
<exclude name="PHPCompatibility.Interfaces.NewInterfaces.unitenumFound" />
<exclude name="PHPCompatibility.Keywords.NewKeywords.t_enumFound" />
<exclude name="PHPCompatibility.Numbers.NewExplicitOctalNotation.Found" />
<exclude name="PHPCompatibility.ParameterValues.NewArrayMergeRecursiveWithGlobalsVar.Found" />
<exclude name="PHPCompatibility.ParameterValues.NewHashAlgorithms.murmur3aFound" />
Expand Down
Loading

0 comments on commit 8d06ee0

Please sign in to comment.