Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[LOC-6168] Fetch plugin updates from WPE servers #183

Merged
merged 5 commits into from
Oct 14, 2024
Merged

Conversation

nickcernis
Copy link
Contributor

@nickcernis nickcernis commented Oct 9, 2024

  • Adds support for the WPE update server. Future updates will be served from WPE infrastructure instead of WP.org.
  • Removes all jobs from Circle CI config that deploy to WP.org. (These will fail due to blocked WPE access, so there is no need to run them.)
  • Adjusts unit and e2e tests to pass. (I deleted one that was passing locally but consistently flaky in Circle because maintaining it seems to be more work than its value at the moment.)
  • Bumps version to 1.7.1.

There is no changelog in this PR because these are written on the GitHub releases page (this repo is public).

I did not add an npm run zip script to this PR like I have for other PRs. Doing so required upgrading the current version of Node.js, which introduces complexity due to archived dependencies (material-ui/core, react-autosize-textarea) not supporting Node 18 without more involved upgrade/migration paths. For now we can grab the zip from Circle.

To test

  1. Create a new site in Local.
  2. Install the transient manager plugin, for example with WP-CLI via Site Shell: wp plugin install --activate transients-manager
  3. Download, install, and activate the Genesis Custom Blocks plugin from this zip via your WP Admin (Plugins → Add New Plugin → Upload Plugin): genesis-custom-blocks.1.6.9.zip (I created the zip by downloading the artifact in Circle, changing the version in the plugin file header to fake an "older" plugin, then rezipping it in macOS.) Do not update the plugin yet when you see an update prompt.
  4. Visit Tools → Transients and click "Delete All". This deletes any cached update_plugins transient you may have that could result in updates coming from WP.org instead of WPE if a plugin update check occurred after you installed but before you activated Genesis Blocks. This is just to accelerate testing (it prevents you having to wait for transients to expire). Customers will not have to do this once upgrading to 1.7.1 of the plugin.
  5. Go to Dashboard → Updates. You should see a pending update for Genesis Custom Blocks:
    genesis-custom-blocks-update-available
  6. Click "Select All" and then "Update Plugins". The update will run and expanding "more details" should show that it was downloaded from WPE:
    genesis-custom-blocks-updated

At this point the Genesis Custom Blocks on your site is the old version without WPE update checking (that is just what's uploaded to the WPE update server at the moment — we will change that when this PR is merged). You will need to delete the plugin and reinstall the one linked above if you want to do further tests.

@nickcernis nickcernis force-pushed the nc/LOC-6168 branch 3 times, most recently from 563f5d7 to 1db0ba6 Compare October 10, 2024 15:55
This plugin can no longer be published on WP.org due to blocked access.
To work with latest WP develop.

- Increase timeout from 100s to 300s. Needed when running locally.
- Use custom insert block method. The current insertBlock method fails
in Circle but we can't upgrade to the latest e2e-test-utils without also
upgrading Node.js, which has cascading side-effects in terms
of dependencies.
- Serve a fake favicon to prevent test failures due to 404s thrown in
the console that make Jest think the test has failed.
This test is intended to check that the editor page still loads if the
user creates a custom field with no fields.

The test passes locally but fails in Circle. Rather than continuing to
tweak it to attempt to appease Circle I opted to delete it.
It seems to have limited  value since (a) it passes right now and
(b) it doesn't seem common that a user will add a custom field
with no fields.
@nickcernis nickcernis marked this pull request as ready for review October 10, 2024 16:52
Copy link

@bgturner bgturner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. I used the log-http-requests plugin to verify that the plugin updates are coming from the correct domain.

Zight 2024-10-10 at 2 37 44 PM jpg

@nickcernis nickcernis merged commit 5b1d8d1 into develop Oct 14, 2024
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants