Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/trunk' into fix/contact-form-ip-…
Browse files Browse the repository at this point in the history
…field
  • Loading branch information
jeherve committed Jul 17, 2024
2 parents 167a1e6 + f80e0a5 commit dc154ea
Show file tree
Hide file tree
Showing 56 changed files with 573 additions and 288 deletions.
12 changes: 11 additions & 1 deletion .github/files/generate-ci-matrix.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
$matrix = array();

// Add PHP tests.
foreach ( array( '7.0', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3' ) as $php ) {
foreach ( array( '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3' ) as $php ) {
$matrix[] = array(
'name' => "PHP tests: PHP $php WP latest",
'script' => 'test-php',
Expand All @@ -68,6 +68,16 @@
);
}

// TODO: When WordPress 6.5 is no longer supported, this can be removed.
$matrix[] = array(
'name' => 'PHP tests: PHP 7.0 WP previous',
'script' => 'test-php',
'php' => '7.0',
'wp' => 'previous',
'timeout' => 20, // 2023-08-17: Successful runs seem to take up to ~12 minutes.
'force-package-tests' => true,
);

foreach ( array( 'previous', 'trunk' ) as $wp ) {
$phpver = $versions['PHP_VERSION'];
$matrix[] = array(
Expand Down
24 changes: 19 additions & 5 deletions .github/files/setup-wordpress-env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,30 +32,31 @@ echo "::endgroup::"
echo "::group::Preparing WordPress from \"$WP_BRANCH\" branch";
case "$WP_BRANCH" in
trunk)
TAG=trunk
WORDPRESS_TAG=trunk
;;
latest)
TAG=$(php ./tools/get-wp-version.php)
WORDPRESS_TAG=$(php ./tools/get-wp-version.php)
;;
previous)
# We hard-code the version here because there's a time near WP releases where
# we've dropped the old 'previous' but WP hasn't actually released the new 'latest'
TAG=6.4
WORDPRESS_TAG=6.4
;;
*)
echo "Unrecognized value for WP_BRANCH: $WP_BRANCH" >&2
exit 1
;;
esac
git clone --depth=1 --branch "$TAG" git://develop.git.wordpress.org/ "/tmp/wordpress-$WP_BRANCH"
git clone --depth=1 --branch "$WORDPRESS_TAG" git://develop.git.wordpress.org/ "/tmp/wordpress-$WP_BRANCH"
# We need a built version of WordPress to test against, so download that into the src directory instead of what's in wordpress-develop.
rm -rf "/tmp/wordpress-$WP_BRANCH/src"
git clone --depth=1 --branch "$TAG" git://core.git.wordpress.org/ "/tmp/wordpress-$WP_BRANCH/src"
git clone --depth=1 --branch "$WORDPRESS_TAG" git://core.git.wordpress.org/ "/tmp/wordpress-$WP_BRANCH/src"
echo "::endgroup::"

if [[ -n "$GITHUB_ENV" ]]; then
echo "WORDPRESS_DEVELOP_DIR=/tmp/wordpress-$WP_BRANCH" >> "$GITHUB_ENV"
echo "WORDPRESS_DIR=/tmp/wordpress-$WP_BRANCH/src" >> "$GITHUB_ENV"
echo "WORDPRESS_TAG=$WORDPRESS_TAG" >> "$GITHUB_ENV"
fi

# Don't symlink, it breaks when copied later.
Expand Down Expand Up @@ -123,6 +124,19 @@ for PLUGIN in projects/plugins/*/composer.json; do
fi
cd "$BASE"

# Upgrade/downgrade WorDBless if necessary.
if [[ ( "$WP_BRANCH" == 'trunk' || "$WP_BRANCH" == 'previous' ) && "$TEST_SCRIPT" == "test-php" ]]; then
VER=$(composer --format=json --working-dir="$DIR" show | jq -r '.installed[] | select( .name == "roots/wordpress" ) | .version')
if [[ -n "$VER" ]]; then
INSVER=$WORDPRESS_TAG
[[ "$WORDPRESS_TAG" == 'trunk' ]] && INSVER="dev-main as $VER"
echo "Supposed to run tests against WordPress $WORDPRESS_TAG, so setting roots/wordpress and roots/wordpress-no-content to \"$INSVER\""
# Composer seems to sometimes have issues with deleting the wordpress dir on its own, so do it manually first.
rm -rf "$DIR/wordpress"
composer --working-dir="$DIR" require --dev roots/wordpress="$INSVER" roots/wordpress-no-content="$INSVER"
fi
fi

cp -r "$DIR" "/tmp/wordpress-$WP_BRANCH/src/wp-content/plugins/$NAME"
# Plugin dir for tests in WP >= 5.6-beta1
ln -s "/tmp/wordpress-$WP_BRANCH/src/wp-content/plugins/$NAME" "/tmp/wordpress-$WP_BRANCH/tests/phpunit/data/plugins/$NAME"
Expand Down
32 changes: 18 additions & 14 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,14 @@ jobs:
pnpm install
echo "::endgroup::"
# If we're going to be making WorDBless use WP "nightlies", remove the relevant package from Composer's cache to get the latest version.
if [[ "$WP_BRANCH" == 'trunk' && "$TEST_SCRIPT" == "test-php" ]]; then
echo "::group::Clear composer cache for roots/wordpress"
DIR=$(composer config cache-files-dir)
rm -rf "$DIR/roots/wordpress" "$DIR/roots/wordpress-no-content"
echo "::endgroup::"
fi
- name: Detect changed projects
id: changed
run: |
Expand Down Expand Up @@ -105,12 +113,6 @@ jobs:
FORCE_PACKAGE_TESTS: ${{ matrix.force-package-tests && 'true' || 'false' }}
CHANGED: ${{ steps.changed.outputs.projects }}
run: |
# If we're going to be making WorDBless use WP "nightlies", remove the relevant package from Composer's cache to get the latest version.
if [[ "$WP_BRANCH" == 'trunk' && ( "$TEST_SCRIPT" == "test-php" ) ]]; then
DIR=$(composer config cache-files-dir)
rm -rf "$DIR/roots/wordpress"
fi
EXIT=0
mkdir artifacts
for P in composer.json projects/*/*/composer.json; do
Expand Down Expand Up @@ -165,15 +167,17 @@ jobs:
echo 'Platform reqs failed, running `composer update`'
composer --working-dir="$DIR" update
fi
fi
if [[ "$WP_BRANCH" == 'trunk' && "$TEST_SCRIPT" == "test-php" ]]; then
VER=$(composer --format=json --working-dir="$DIR" show | jq -r '.installed[] | select( .name == "roots/wordpress" ) | .version')
if [[ -n "$VER" ]]; then
echo 'Supposed to run tests against WordPress trunk, so upgrading roots/wordpress and roots/wordpress-no-content to dev-main'
# Composer seems to sometimes have issues with deleting the wordpress dir on its own, so do it manually first.
rm -rf "$DIR/wordpress"
composer --working-dir="$DIR" require --dev roots/wordpress="dev-main as $VER" roots/wordpress-no-content="dev-main as $VER"
if [[ "$WP_BRANCH" == 'trunk' || "$WP_BRANCH" == 'previous' ]]; then
VER=$(composer --format=json --working-dir="$DIR" show | jq -r '.installed[] | select( .name == "roots/wordpress" ) | .version')
if [[ -n "$VER" ]]; then
INSVER=$WORDPRESS_TAG
[[ "$WORDPRESS_TAG" == 'trunk' ]] && INSVER="dev-main as $VER"
echo "Supposed to run tests against WordPress $WORDPRESS_TAG, so setting roots/wordpress and roots/wordpress-no-content to \"$INSVER\""
# Composer seems to sometimes have issues with deleting the wordpress dir on its own, so do it manually first.
rm -rf "$DIR/wordpress"
composer --working-dir="$DIR" require --dev roots/wordpress="$INSVER" roots/wordpress-no-content="$INSVER"
fi
fi
fi
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: added


Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ export type AdminSectionBaseProps = {
* The section content
*/
children: React.ReactNode;
className?: string;
};
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.54.3",
"version": "0.54.4-alpha",
"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,5 @@
Significance: patch
Type: fixed
Comment: Fix a test to work with both WP 6.4 and 6.5.


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

Admin Bar: Hotfix the order of the admin menu items for WP 6.6
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Significance: patch
Type: fixed
Comment: Minor image replacement


Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,27 @@ function wpcom_enqueue_admin_bar_assets() {
array(),
Jetpack_Mu_Wpcom::PACKAGE_VERSION
);

/**
* Hotfix the order of the admin menu items due to WP 6.6
* See https://core.trac.wordpress.org/ticket/61615.
*/
$wp_version = get_bloginfo( 'version' );
if ( version_compare( $wp_version, '6.6', '<=' ) && version_compare( $wp_version, '6.6.RC', '>=' ) ) {
wp_add_inline_style(
'wpcom-admin-bar',
<<<CSS
#wpadminbar .quicklinks #wp-admin-bar-top-secondary {
display: flex;
flex-direction: row-reverse;
}
#wpadminbar .quicklinks #wp-admin-bar-top-secondary #wp-admin-bar-search {
order: -1;
}
CSS
);
}
}
add_action( 'admin_bar_menu', 'wpcom_enqueue_admin_bar_assets' );

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,29 @@
display: none !important;
}

/**
* WP logo menu
*/
#wpadminbar #wp-admin-bar-wp-logo>.ab-item .ab-icon:before {
display: flex;
content: "";
width: 20px;
height: 20px;
background-color: currentColor;
// SVG is from https://github.com/Automattic/gridicons/blob/f5b4c69fafc2a395aebce4500cb4f22d7c005745/php/gridicons.php#L380
mask-image: url("data:image/svg+xml;base64,PHN2ZyBjbGFzcz0iZ3JpZGljb24gZ3JpZGljb25zLW15LXNpdGVzIiBoZWlnaHQ9IjI0IiB3aWR0aD0iMjQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmlld0JveD0iMCAwIDI0IDI0Ij48Zz48cGF0aCBkPSJNMTIgMkM2LjQ3NyAyIDIgNi40NzcgMiAxMnM0LjQ3NyAxMCAxMCAxMCAxMC00LjQ3NyAxMC0xMFMxNy41MjMgMiAxMiAyek0zLjUgMTJjMC0xLjIzMi4yNjQtMi40MDIuNzM2LTMuNDU5TDguMjkxIDE5LjY1QTguNSA4LjUgMCAwMTMuNSAxMnptOC41IDguNTAxYy0uODM0IDAtMS42NC0uMTIyLTIuNDAxLS4zNDZsMi41NTEtNy40MTEgMi42MTMgNy4xNThhLjcxOC43MTggMCAwMC4wNjEuMTE3IDguNDk3IDguNDk3IDAgMDEtMi44MjQuNDgyem0xLjE3Mi0xMi40ODZjLjUxMi0uMDI3Ljk3My0uMDgxLjk3My0uMDgxLjQ1OC0uMDU0LjQwNC0uNzI3LS4wNTQtLjcwMSAwIDAtMS4zNzcuMTA4LTIuMjY2LjEwOC0uODM1IDAtMi4yMzktLjEwOC0yLjIzOS0uMTA4LS40NTktLjAyNi0uNTEyLjY3NC0uMDU0LjcwMSAwIDAgLjQzNC4wNTQuODkyLjA4MWwxLjMyNCAzLjYyOS0xLjg2IDUuNTc5LTMuMDk2LTkuMjA4Yy41MTItLjAyNy45NzMtLjA4MS45NzMtLjA4MS40NTgtLjA1NC40MDMtLjcyNy0uMDU1LS43MDEgMCAwLTEuMzc2LjEwOC0yLjI2NS4xMDgtLjE2IDAtLjM0Ny0uMDA0LS41NDctLjAxQTguNDkxIDguNDkxIDAgMDExMiAzLjVjMi4yMTMgMCA0LjIyOC44NDYgNS43NCAyLjIzMi0uMDM3LS4wMDItLjA3Mi0uMDA3LS4xMS0uMDA3LS44MzUgMC0xLjQyNy43MjctMS40MjcgMS41MDkgMCAuNzAxLjQwNCAxLjI5My44MzUgMS45OTQuMzIzLjU2Ni43MDEgMS4yOTMuNzAxIDIuMzQ0IDAgLjcyNy0uMjggMS41NzItLjY0NyAyLjc0OGwtLjg0OCAyLjgzMy0zLjA3Mi05LjEzOHptMy4xMDEgMTEuMzMybDIuNTk2LTcuNTA2Yy40ODUtMS4yMTMuNjQ2LTIuMTgyLjY0Ni0zLjA0NSAwLS4zMTMtLjAyMS0uNjAzLS4wNTctLjg3NEE4LjQ1NSA4LjQ1NSAwIDAxMjAuNSAxMmE4LjQ5MyA4LjQ5MyAwIDAxLTQuMjI3IDcuMzQ3eiIvPjwvZz48L3N2Zz4=");
mask-position: center;
mask-repeat: no-repeat;

@media (max-width: 782px) {
width: 36px;
height: 36px;
margin: 0 8px;
mask-size: cover;
top: 5px;
}
}

/**
* Reader menu
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,14 @@ public function test_comment_text_block_sanitization_sanity_check() {
$comment_content = '<!-- wp:paragraph --><p>test</p><!-- /wp:paragraph --><!-- wp:list --><ul><!-- wp:list-item --><li>1</li><!-- /wp:list-item --><!-- wp:list-item --><li>2</li><!-- /wp:list-item --><!-- wp:list-item --><li>3</li><!-- /wp:list-item --></ul><!-- /wp:list --><!-- wp:quote --><blockquote class="wp-block-quote"><!-- wp:paragraph --><p>something</p><!-- /wp:paragraph --><cite>someone</cite></blockquote><!-- /wp:quote -->';
$filtered_content = preg_replace( '/\R+/', '', Verbum_Block_Utils::render_verbum_blocks( $comment_content ) );

$expected_content = '<p>test</p><ul><li>1</li><li>2</li><li>3</li></ul><blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow"><p>something</p><cite>someone</cite></blockquote>';
$this->assertEquals( $expected_content, $filtered_content );
// Once we drop WP 6.4, we can change this back to assertSame().
$expected_content = $this->logicalOr(
// WP 6.4
$this->identicalTo( '<p>test</p><ul><li>1</li><li>2</li><li>3</li></ul><blockquote class="wp-block-quote"><p>something</p><cite>someone</cite></blockquote>' ),
// WP 6.5+
$this->identicalTo( '<p>test</p><ul><li>1</li><li>2</li><li>3</li></ul><blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow"><p>something</p><cite>someone</cite></blockquote>' )
);
$this->assertThat( $filtered_content, $expected_content );
}

/**
Expand Down
4 changes: 4 additions & 0 deletions projects/packages/jitm/changelog/update-my-jetpack-jitm-css
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: changed

Update margins on jitms in my jetpack
2 changes: 1 addition & 1 deletion projects/packages/jitm/src/class-jitm.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
*/
class JITM {

const PACKAGE_VERSION = '3.1.13';
const PACKAGE_VERSION = '3.1.14-alpha';

/**
* The configuration method that is called from the jetpack-config package.
Expand Down
3 changes: 2 additions & 1 deletion projects/packages/jitm/src/css/jetpack-admin-jitm.scss
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,8 @@ $jp-gray-20: #a7aaad;
.my-jetpack-jitm-card {
.jitm-card {
margin-right: 0;
margin-bottom: 0;
margin-bottom: 1.5rem;
margin-top: 1.5rem;
}
}

Expand Down
Loading

0 comments on commit dc154ea

Please sign in to comment.