Skip to content

Commit

Permalink
Merge branch 'trunk' into update/remove-performance-menu-item
Browse files Browse the repository at this point in the history
  • Loading branch information
lsl committed Jan 22, 2025
2 parents 64465ee + c153c70 commit 49a863d
Show file tree
Hide file tree
Showing 813 changed files with 7,294 additions and 6,119 deletions.
8 changes: 8 additions & 0 deletions .github/renovate.json5
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,14 @@
matchPackageNames: [ 'docker/**' ],
},

// Separate this from 'monorepo:wordpress' while it's still considered unstable.
{
groupName: '@wordpress/dataviews',
matchPackageNames: [ '@wordpress/dataviews' ],
separateMajorMinor: false,
prPriority: 1,
},

// 🤷
{
groupName: 'Instant Search Dependency Updates',
Expand Down
144 changes: 144 additions & 0 deletions .github/workflows/wpcloud.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
name: WPCloud Unit Testing for WPCOMSH

on:
pull_request:
push:
branches: ['trunk', '*/branch-*']
concurrency:
group: wpcloud-wpcomsh
cancel-in-progress: false
# Concurrency is set up to make sure we can only run one WPCloud testing job at the same time.

jobs:
build:
name: Install the Monorepo and build wpcomsh
runs-on: ubuntu-latest
outputs:
wpcomsh: ${{ steps.changed.outputs.wpcomsh }}
steps:
- uses: actions/checkout@v4

# For pull requests, list-changed-projects.sh needs the merge base.
# But it doesn't have to be checked out.
- name: Deepen to merge base
if: github.event_name == 'pull_request'
uses: ./.github/actions/deepen-to-merge-base
with:
checkout: false

- name: Setup tools
uses: ./.github/actions/tool-setup
- name: Monorepo install
run: |
echo "::group::Pnpm"
pnpm install
echo "::endgroup::"
- name: Detect if wpcomsh has changed
id: changed
run: |
CHANGED="$(EXTRA=test .github/files/list-changed-projects.sh)"
WPCOMSH_CHANGED="$(jq --argjson changed "$CHANGED" -n '$changed | has( "plugins/wpcomsh" ) ')"
echo "wpcomsh=${WPCOMSH_CHANGED}" >> "$GITHUB_OUTPUT"
- name: Build wpcomsh
if: steps.changed.outputs.wpcomsh == 'true'
run: |
find . -path ./.github -prune -o -type f -print | sort > /tmp/before.txt
echo "::group::Installing and building wpcomsh"
pnpm jetpack build -v --deps plugins/wpcomsh
echo "::endgroup::"
# We only want to save the files that were actually created or changed.
# But we can't just list them for actions/cache/save, "Argument list too long".
# So instead we delete all the unchanged files so we can tell actions/cache/save
# to save everything that's left.
git -c core.quotepath=off diff --name-only | sort > /tmp/changed.txt
if [[ -s /tmp/changed.txt ]]; then
grep -F -x -v -f /tmp/changed.txt /tmp/before.txt > /tmp/remove.txt
else
cp /tmp/before.txt /tmp/remove.txt
fi
xargs -d '\n' rm < /tmp/remove.txt
find . -type d -empty -delete
- name: Save wpcomsh build cache
if: steps.changed.outputs.wpcomsh == 'true'
id: wpcomsh-build-cache-save
uses: actions/cache/save@v4
with:
path: |
.
!./.github/
key: ${{ github.sha }}
deploy:
name: Run PHPUnit on the WPCloud test site
runs-on: ubuntu-latest
needs: build
if: needs.build.outputs.wpcomsh == 'true'
steps:
- uses: actions/checkout@v4

- name: Restore wpcomsh build cache
id: wpcomsh-build-cache
uses: actions/cache/restore@v4
with:
path: |
.
!./.github/
key: ${{ github.sha }}
fail-on-cache-miss: true

- name: Setup tools
uses: ./.github/actions/tool-setup

- name: Install monorepo
run: |
pnpm install
- name: Configure Github to be able to SSH to the Atomic site
run: |
echo "::group::Intializing"
mkdir -vp ~/.ssh/
chmod -v 700 ~/.ssh
touch ~/.ssh/id_site
touch ~/.ssh/known_hosts
touch ~/.ssh/config
chmod 600 ~/.ssh/id_site
chmod 600 ~/.ssh/known_hosts
chmod 600 ~/.ssh/config
echo "$SSH_KEY" > ~/.ssh/id_site
echo "wrote ~/.ssh/id_site"
echo "$SSH_KNOWN_HOSTS" > ~/.ssh/known_hosts
echo "wrote ~/.ssh/known_hosts"
echo "Host jpwpcomsh" > ~/.ssh/config
echo " Hostname sftp.wp.com" >> ~/.ssh/config
echo " User wpcom-jetpackisbestpack-default-237778992" >> ~/.ssh/config
echo " IdentityFile ~/.ssh/id_site" >> ~/.ssh/config
echo " IdentitiesOnly yes" >> ~/.ssh/config
echo "::endgroup::"
echo "::group::Transferring wpcomsh to the testing server"
ssh jpwpcomsh "wp dereferenced freshen > /dev/null 2>&1"
ssh jpwpcomsh "rm -rf /tmp/old-* > /dev/null 2>&1"
pnpm jetpack rsync wpcomsh jpwpcomsh:~/htdocs/wp-content/mu-plugins
scp -r projects/plugins/wpcomsh/bin jpwpcomsh:/srv/htdocs/wp-content/mu-plugins/wpcomsh
scp -r projects/plugins/wpcomsh/tests jpwpcomsh:/srv/htdocs/wp-content/mu-plugins/wpcomsh/
scp projects/plugins/wpcomsh/phpunit.xml.dist jpwpcomsh:/srv/htdocs/wp-content/mu-plugins/wpcomsh/
echo "::engroup::"
echo "::group::execution"
ssh jpwpcomsh "~/htdocs/github-action-handler.sh" || CODE=$?
echo "::endgroup::"
echo "::group::teardown"
rm -rvf ~/.ssh/
echo "::endgroup::"
echo "Exiting with exit code $CODE"
exit $CODE
env:
SSH_KEY: ${{ secrets.UPDATEJETPACKSTAGING_SSH_KEY }}
SSH_KNOWN_HOSTS: ${{ secrets.UPDATEJETPACKSTAGING_SSH_KNOWN_HOSTS }}
22 changes: 21 additions & 1 deletion .phan/stubs/wpcom-stubs.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* `bin/teamcity-builds/jetpack-stubs/stub-defs.php` and regenerate the stubs
* by triggering the Jetpack Staging → Update WPCOM Stubs job in TeamCity.
*
* Stubs automatically generated from WordPress.com commit b97a8d79ff4f32395c77389fb22c900517a9d1a1.
* Stubs automatically generated from WordPress.com commit c22dbf3bcf2334f7010cf491a7817654b95c54fe.
*/

namespace {
Expand Down Expand Up @@ -252,6 +252,18 @@ function header_js()
function global_css()
{
}
class WPCOM_External_Connections
{
/**
* @return WPCOM_External_Connections
*/
static function init()
{
}
public function get_external_services_list($type = \false, $blog_id = \false)
{
}
}
class WPCOM_Google_Sheets_Helper
{
/**
Expand Down Expand Up @@ -1451,6 +1463,14 @@ function prompt_without_blocks($prompt_html)
function assign_current_user(string $experiment_name): ?string
{
}
/**
* @param string $experiment_name
* @param \WP_User $user
* @return string|null
*/
function assign_given_user(string $experiment_name, \WP_User $user): ?string
{
}
}
namespace JITM {
class Engine
Expand Down
15 changes: 0 additions & 15 deletions .pnpm-patches/@[email protected]

This file was deleted.

18 changes: 18 additions & 0 deletions .pnpm-patches/@[email protected]
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Hack for https://github.com/WordPress/gutenberg/issues/67897

diff --git a/package.json b/package.json
index 9df754abc5e871d61e726aa84c92e079db5d6c60..9a0db897aeb3eb15b4a1767da4cd7ef7acef88d7 100644
--- a/package.json
+++ b/package.json
@@ -23,11 +23,9 @@
"npm": ">=8.19.2"
},
"main": "build/index.js",
- "module": "build-module/index.js",
"exports": {
".": {
"types": "./build-types/index.d.ts",
- "import": "./build-module/index.js",
"default": "./build/index.js"
},
"./wp": {
13 changes: 12 additions & 1 deletion .pnpmfile.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,25 @@ function fixDeps( pkg ) {

// Missing dep or peer dep on react.
// https://github.com/WordPress/gutenberg/issues/55171
// https://github.com/WordPress/gutenberg/issues/68694
if (
pkg.name === '@wordpress/icons' &&
( pkg.name === '@wordpress/icons' || pkg.name === '@wordpress/upload-media' ) &&
! pkg.dependencies?.react &&
! pkg.peerDependencies?.react
) {
pkg.peerDependencies.react = '^18';
}

// Missing dep or peer dep on @babel/runtime and react
// https://github.com/WordPress/gutenberg/issues/68694
if (
pkg.name === '@wordpress/upload-media' &&
! pkg.dependencies?.[ '@babel/runtime' ] &&
! pkg.peerDependencies?.[ '@babel/runtime' ]
) {
pkg.peerDependencies[ '@babel/runtime' ] = '^7';
}

// Missing dep or peer dep.
// https://github.com/actions/toolkit/issues/1684
if (
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"packageManager": "[email protected]",
"pnpm": {
"patchedDependencies": {
"@wordpress/dataviews@4.10.0": ".pnpm-patches/@wordpress__dataviews@4.10.0.patch"
"@wordpress/dataviews@4.12.0": ".pnpm-patches/@wordpress__dataviews@4.12.0.patch"
}
}
}
Loading

0 comments on commit 49a863d

Please sign in to comment.