Skip to content

Self service downgrade: Allow lossless reverts#101827

Merged
claudiucelfilip merged 9 commits intotrunkfrom
add/downgrade-lossless-revert
Mar 25, 2025
Merged

Self service downgrade: Allow lossless reverts#101827
claudiucelfilip merged 9 commits intotrunkfrom
add/downgrade-lossless-revert

Conversation

@claudiucelfilip
Copy link
Contributor

@claudiucelfilip claudiucelfilip commented Mar 25, 2025

Proposed Changes

This adds a checkbox that triggers lossless reverts to recover posts, pages and media added after the site became atomic.

Why are these changes being made?

  • Part of an epic to support self service downgrades in wpcom

Testing Instructions

  • Locally there needs to be a feature flag activated plans/self-service-downgrade, flags=plans/self-service-downgrade
  • Sandbox public-api.wordpress.com with 178193-ghe-Automattic/wpcom
  • Go to a site with a Business plan, which is atomic with the default wpcomstaging url
  • Ensure you have a Post published after the site became atomic
  • Go to /purchases/subscriptions/<wpcomstaging.com-site-slug>
  • Click on the downgrade button visible at the purchase manage page
  • The next screen should also show a checkbox to recover posts, pages, and media content: make sure to check it as well and click the CTA
  • The downgrade should work and the site should be added to the lossless revert queue which you can check in 37583-pb/#bash
  • You may need to wait for the site to reach complete state. Once done, go to the Posts screen where you should see you recovered post

Pre-merge Checklist

  • Has the general commit checklist been followed? (PCYsg-hS-p2)
  • Have you written new tests for your changes?
  • Have you tested the feature in Simple (P9HQHe-k8-p2), Atomic (P9HQHe-jW-p2), and self-hosted Jetpack sites (PCYsg-g6b-p2)?
  • Have you checked for TypeScript, React or other console errors?
  • Have you used memoizing on expensive computations? More info in Memoizing with create-selector and Using memoizing selectors and Our Approach to Data
  • Have we added the "[Status] String Freeze" label as soon as any new strings were ready for translation (p4TIVU-5Jq-p2)?
    • For UI changes, have we tested the change in various languages (for example, ES, PT, FR, or DE)? The length of text and words vary significantly between languages.
  • For changes affecting Jetpack: Have we added the "[Status] Needs Privacy Updates" label if this pull request changes what data or activity we track or use (p4TIVU-aUh-p2)?

@matticbot
Copy link
Contributor

matticbot commented Mar 25, 2025

Here is how your PR affects size of JS and CSS bundles shipped to the user's browser:

Sections (~250 bytes added 📈 [gzipped])

Details
name            parsed_size           gzip_size
site-purchases       +624 B  (+0.0%)     +250 B  (+0.0%)
purchases            +624 B  (+0.0%)     +250 B  (+0.0%)
overview             +499 B  (+0.0%)     +209 B  (+0.0%)
domains              +499 B  (+0.0%)     +209 B  (+0.0%)

Sections contain code specific for a given set of routes. Is downloaded and parsed only when a particular route is navigated to.

Legend

What is parsed and gzip size?

Parsed Size: Uncompressed size of the JS and CSS files. This much code needs to be parsed and stored in memory.
Gzip Size: Compressed size of the JS and CSS files. This much data needs to be downloaded over network.

Generated by performance advisor bot at iscalypsofastyet.com.

@claudiucelfilip claudiucelfilip force-pushed the add/downgrade-lossless-revert branch from 7f1331a to 70545de Compare March 25, 2025 09:46
@claudiucelfilip claudiucelfilip requested review from a team as code owners March 25, 2025 09:46
@claudiucelfilip claudiucelfilip requested review from howarding and jeyip and removed request for a team March 25, 2025 09:46
@matticbot matticbot added the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Mar 25, 2025
@claudiucelfilip claudiucelfilip force-pushed the add/downgrade-lossless-revert branch 3 times, most recently from 322a061 to b82215f Compare March 25, 2025 09:54
@claudiucelfilip claudiucelfilip requested review from ddc22 and removed request for a team, howarding and jeyip March 25, 2025 09:55
@matticbot
Copy link
Contributor

matticbot commented Mar 25, 2025

Base automatically changed from fix/atomic-downgrade-warning to trunk March 25, 2025 10:49
@claudiucelfilip claudiucelfilip force-pushed the add/downgrade-lossless-revert branch from b82215f to 7474418 Compare March 25, 2025 10:56
@claudiucelfilip claudiucelfilip changed the title WIP Add/downgrade lossless revert Self service downgrade: Allow lossless reverts Mar 25, 2025
@claudiucelfilip claudiucelfilip force-pushed the add/downgrade-lossless-revert branch from a86d2f6 to 0581d37 Compare March 25, 2025 11:31
@matticbot
Copy link
Contributor

This PR modifies the release build for the following Calypso Apps:

For info about this notification, see here: PCYsg-OT6-p2

  • notifications
  • wpcom-block-editor

To test WordPress.com changes, run install-plugin.sh $pluginSlug add/downgrade-lossless-revert on your sandbox.

@claudiucelfilip claudiucelfilip self-assigned this Mar 25, 2025
Comment on lines 125 to 127
.cancel-purchase-form__atomic-lossless-revert {
margin-top: 1.25rem;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Cleanup

Copy link
Contributor

@ddc22 ddc22 left a comment

Choose a reason for hiding this comment

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

LGTM 🚢

@claudiucelfilip claudiucelfilip merged commit c454f58 into trunk Mar 25, 2025
13 checks passed
@claudiucelfilip claudiucelfilip deleted the add/downgrade-lossless-revert branch March 25, 2025 22:44
@github-actions github-actions bot removed the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Mar 25, 2025
@a8ci18n
Copy link

a8ci18n commented Mar 25, 2025

This Pull Request is now available for translation here: https://translate.wordpress.com/deliverables/17316057

Some locales (Hebrew, Japanese) have been temporarily machine-translated due to translator availability. All other translations are usually ready within a few days. Untranslated and machine-translated strings will be sent for translation next Monday and are expected to be completed by the following Friday.

Hi @claudiucelfilip, could you please edit the description of this PR and add a screenshot for our translators? Ideally it'd include all of the following strings:

  • Restore my posts, pages, and media.
  • Your posts, pages, and media added after upgrading will be automatically imported to your downgraded site. This process may take up to 24 hours.

Thank you in advance!

@a8ci18n
Copy link

a8ci18n commented Mar 28, 2025

Translation for this Pull Request has now been finished.

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.

4 participants

Comments