-
Notifications
You must be signed in to change notification settings - Fork 3
PLANET-7686: Upgrade WP Stateless to version 4.1.3
#335
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
Conversation
- From version 3.4.1 to 4.1.3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello @mardelnet, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
Summary of Changes
This pull request upgrades the wp-stateless
plugin dependency in composer.json
from version 3.4.1
to 4.1.3
. This update likely includes new features, bug fixes, and performance improvements provided by the newer version of the plugin.
Highlights
- Dependency Upgrade: The
wp-stateless
plugin has been upgraded from version3.4.1
to4.1.3
in thecomposer.json
file.
Changelog
- composer.json
- Upgraded
wpackagist-plugin/wp-stateless
from version3.4.1
to4.1.3
.
- Upgraded
Using Gemini Code Assist
The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.
Invoking Gemini
You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command>
or @gemini-code-assist <command>
. Below is a summary of the supported commands.
Feature | Command | Description |
---|---|---|
Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
Help | /gemini help |
Displays a list of available commands. |
Customization
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/
folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments to provide feedback.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
Trivia time!
What is Composer, and what problem does it solve?
Click here for the answer
Composer is a dependency management tool for PHP. It allows you to declare the libraries your project depends on and it will manage (install/update) them for you.
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
The pull request updates the wp-stateless
plugin version in the composer.json
file. This is a straightforward update, and the change appears correct.
Merge Readiness
The pull request updates a dependency version. Given the limited scope of the change, it seems appropriate for merging, assuming that the update has been tested and verified to be compatible with the project. I am unable to directly approve the pull request, and users should have others review and approve this code before merging.
4.1.3
4.1.3
Regarding WP-Stateless - Gravity Forms Addon, IMO we should use it along with a WP_STATELESS_COMPATIBILITY_GF constant. |
Thanks, @sagarsdeshmukh |
Nice job @mardelnet 🎉 I have tested the new version of WP-Stateless on my local environment as well as the following test environments: The new version of the WP-Stateless plugin is working as expected. No issues were encountered during testing.
|
Thank you so much, @sagarsdeshmukh
Can you please explain how to do this? I've no experience in adding or editing CLI commands.
How do you suggest doing this? PHP I suppose, right?
I'm adding @comzeradd to this conversation to discuss how to action in this last point. |
With every deployment, post-deploy scripts are executed—such as migration script or the 'Disable Attachment Pages' script.
Yes, that's right. The code below might be helpful -
|
- From version 3.4.1 to 4.1.3
- Add post-deploy script
…ithub.com/greenpeace/planet4-base into PLANET-7686_upgrade-wp-stateless-to-4.1.x
Thanks @sagarsdeshmukh !
The post-deploy script was added. Can you please check it?
I am not completely sure whether adding this would be a good idea for 2 reasons: editors can hide the message by simply clicking the close button (it doesn't re-appear on page reload) and the CSS code will hide any other future message related to migrations in WP Stateless. What do you think? |
#!/bin/bash | ||
|
||
echo "Perform WP-Stateless data optimization..." | ||
wp stateless migrate |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This command lists a optimization id/records
$ npx wp-env run cli wp stateless migrate
+----------------+------------------------------------+---------+--------------+
| id | description | status | message |
+----------------+------------------------------------+---------+--------------+
| 20240423174109 | Optimize Compatibility Files | Skipped | Not required |
| 20240219175240 | Update data for Google Cloud files | Pending | Ready to run |
+----------------+------------------------------------+---------+--------------+
We need to provide params with above command,
when we run npx wp-env run cli wp stateless -help
on local -
usage: wp stateless migrate [<id|auto>] [--force] [--progress=<val>] [--email=<val>] [--yes] [--url=<val>]
or: wp stateless reset_cache_control [--url=<val>]
or: wp stateless sync <type> [--url=<val>] [--start=<val>] [--limit=<val>] [--end=<val>] [--batch=<val>] [--batches=<val>] [--b] [--log] [--o] [--order=<val>]
or: wp stateless upgrade <type> [--url=<val>] [--start=<val>] [--limit=<val>] [--end=<val>] [--batch=<val>] [--batches=<val>] [--b] [--log] [--o]
I tried below command on local which works for me -
wp stateless migrate auto [email protected] --yes
here --yes
skip confirmation(ref.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Should we use Nikos' email or is there a way to add the website admin's email?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess by default it will pick the website admin's email, but if we want to track the status during release process its good to add Nikos mail id.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, @sagarsdeshmukh
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the command required for the upgrade? I deployed the branch on a test instance and the process times out because it takes a lot of time to finish.
We could upgrade the plugin and then I could manually trigger the migrate command outside of CircleCI
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice catch @comzeradd
In that case, manually triggering the migrate command will be better (I just removed it).
Perhaps we should let the NROs know of that beforehand so they don't do the same.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's something to be done in the master theme, right @comzeradd?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I think it makes more sense to be in the theme
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Adjust post-deploy script
@sagarsdeshmukh @comzeradd |
Testing the PR locally seems to work fine. But I'm getting a notice about the GF Add-on that may be confusing for NRO admins, thinking that the connection with GF is broken. So I think that may it's better to also install the add-on on this PR to have it in place on releasing this upgrade. |
8162496
to
3154e4d
Compare
Thanks @comzeradd |
tasks/post-deploy/09-wp-stateless.sh
Outdated
wp plugin activate wp-stateless-gravity-forms-addon | ||
|
||
echo "Perform WP-Stateless data optimization..." | ||
wp stateless migrate auto [email protected] --yes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The script is not executable, failing to run. You can change that with:
chmod +x 09-wp-stateless.sh
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
3154e4d
to
135461f
Compare
- Install and activate the GF addon
135461f
to
60be9a8
Compare
Nothing to add from my side — looks good to me. |
Ref: https://jira.greenpeace.org/browse/PLANET-7686
Related PR: greenpeace/planet4-master-theme#2598
Testing 1
npx wp-env run cli wp plugin update wp-stateless
/wp-admin/upload.php?page=stateless-settings
) and change the mode toStateless
. You will need extra data to make it work (Bucket, Service Account JSON, and Domain). You can copy it from the Gutenberg instance.Testing 2
Notes
Do we also want to try the Gravity Form add-on, @comzeradd?
