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

Backup: Add backup storage UI #28085

Merged
merged 30 commits into from
Jan 23, 2023
Merged

Backup: Add backup storage UI #28085

merged 30 commits into from
Jan 23, 2023

Conversation

Initsogar
Copy link
Contributor

@Initsogar Initsogar commented Dec 27, 2022

Changes proposed in this Pull Request:

  • Add site storage size and storage limit on backup admin page
  • Add progress bar with different colors based on % of storage usage
  • Adjust new layout to include the new storage UI
  • When storage usage is above 65%, show a CUT with add-on storage upgrade

What's next?

The following features will be address in a new PR:

  • Add days of backups saved below the storage meter.
  • Backups stopped related messages on main title and CUT.

Screenshots

Description Screenshot
Admin page image
Normal (< 65% used storage)
Warning (65% - 80% used storage)
Critical (80%-100% used storage)
Full (> 100% used storage)

Other information:

  • Have you written new tests for your changes, if applicable?
  • Have you checked the E2E test CI results, and verified that your changes do not break them?
  • Have you tested your changes on WordPress.com, if applicable (if so, you'll see a generated comment below with a script to run)?

Jetpack product discussion

  • peaFOp-wy-p2
  • p1HpG7-jQY-p2

Does this pull request change what data or activity we track or use?

No

Unit testing:

You can run unit testing using the following command:

  • JS: jetpack test packages/backup js
  • PHP: jetpack test packages/backup php

Testing instructions:

  • Spin up a Jurassic Ninja site with Jetpack Beta, using Backup branch add/backup-storage-ui with a backup plan like Jetpack Backup (1 GB or 10 GB).
  • Navigate to Jetpack -> VautlPress Backup
  • Once the first backup completes, you should see the main page of the plugin, including the storage meter.
  • Given it is a new site, it will be ~0GB used and no upsell prompt should be displayed.

To try different scenarios for the storage meter, you could try to upload big files to your site or dispatch the events using Redux DevTools (chrome extension). After installing it, follow these steps:

  • Open the extension in Chrome
  • In the dropdown in the top right, select jetpack-backup-plugin
  • In the bottom, click on >_ option to show the dispatcher.
    image
  • It should look like this:

  • Then in the dispatcher editor, you can set the used storage like this (the size is represented in bytes):
{
    type: 'SITE_BACKUP_SIZE_GET_SUCCESS',
    payload: {
        size: 10737418240
    }
}
  • So if you have a site with 10 GB, you can use the following sizes to test the different scenarios:
    • Normal (< 65%): 1073741824 (1GB)
    • Warning (65% - 80%): 7516192768 (7GB)
    • Critical (80%-100%): 9663676416 (9GB)
    • Full (> 100%): 10737418240 (10 GB)

@github-actions
Copy link
Contributor

github-actions bot commented Dec 27, 2022

Are you an Automattician? You can now test your Pull Request on WordPress.com. On your sandbox, run bin/jetpack-downloader test jetpack add/backup-storage-ui to get started. More details: p9dueE-5Nn-p2

@github-actions
Copy link
Contributor

github-actions bot commented Dec 27, 2022

Thank you for your PR!

When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:

  • ✅ Include a description of your PR changes.
  • ⚠️ All commits were linted before commit.
  • ✅ Add a "[Status]" label (In Progress, Needs Team Review, ...).
  • ✅ Add testing instructions.
  • ✅ Specify whether this PR includes any changes to data or privacy.
  • ✅ Add changelog entries to affected projects

This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖


The e2e test report can be found here. Please note that it can take a few minutes after the e2e tests checks are complete for the report to be available.


Once your PR is ready for review, check one last time that all required checks (other than "Required review") appearing at the bottom of this PR are passing or skipped.
Then, add the "[Status] Needs Team review" label and ask someone from your team review the code.
Once you’ve done so, switch to the "[Status] Needs Review" label; someone from Jetpack Crew will then review this PR and merge it to be included in the next Jetpack release.


Jetpack plugin:

  • Next scheduled release: February 7, 2023.
  • Scheduled code freeze: January 31, 2023.

Backup plugin:

  • Next scheduled release: February 7, 2023.
  • Scheduled code freeze: January 31, 2023.

@Initsogar Initsogar force-pushed the add/backup-storage-ui branch from b1f220a to cf7fc16 Compare January 11, 2023 05:44
@Initsogar Initsogar self-assigned this Jan 11, 2023
@github-actions github-actions bot added [Plugin] Backup A plugin that allows users to save every change and get back online quickly with one-click restores. [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ labels Jan 11, 2023
@Initsogar Initsogar marked this pull request as ready for review January 19, 2023 06:53
@Initsogar Initsogar requested review from a team and keoshi January 19, 2023 06:53
keoshi
keoshi previously approved these changes Jan 19, 2023
Copy link
Contributor

@keoshi keoshi left a comment

Choose a reason for hiding this comment

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

First off, thank you so much for all the work that went into this, @Initsogar! The detailed instructions are wonderful as well.

Everything looks great to me in the testing that I did. Noticed some minor things which I'll list below, but none are blocking; more like nice to haves if we want to create follow-up PRs.

Zero character shows up — bug?

While the first backup is being created a zero (0) appears in the section created for the storage UI; see below:

image

Grid positioning

The new storage UI seems to take 6 columns of the existing grid, instead of the last 5 as intended. This one is on me for not having documented this more in detail...sorry about that.

See the following image where the top is the design and below what's in the PR right now, with a red rectangle of where the storage UI should be placed.

image

This might seem confusing or counter-intuitive, but by adding a full empty column in between the left and right sections, we're creating more opportunities to draw the eye to the storage UI.

Heading in warning state

Saw that you added variable headings for different states — very nice touch. The warning state is missing a custom heading though. Wonder if we could add this one:

Cloud storage is almost full

@Initsogar
Copy link
Contributor Author

I was thinking that Cloud storage is almost full fits better for storage usage between 80%-100% (Critical).

@Initsogar This sounds wonderful to me!

@keoshi Great! Thanks for the feedback.

  • Heading in warning state
    Just added the Cloud storage is almost full when the storage usage is 80%-100% (Critical).

image

@Initsogar Initsogar requested a review from jwebbdev January 23, 2023 13:49
jwebbdev
jwebbdev previously approved these changes Jan 23, 2023
Copy link
Contributor

@jwebbdev jwebbdev 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 to me!

@jwebbdev jwebbdev added [Status] Needs Review To request a review from fellow Jetpack developers. Label will be renamed soon. and removed [Status] Needs Team Review labels Jan 23, 2023
Copy link
Contributor

@anomiex anomiex left a comment

Choose a reason for hiding this comment

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

One minor suggestion inline. Otherwise looks ok to me from a monorepo perspective.

projects/packages/backup/package.json Outdated Show resolved Hide resolved
Co-authored-by: Brad Jorsch <anomiex@users.noreply.github.com>
@Initsogar Initsogar merged commit 99ee5e3 into trunk Jan 23, 2023
@Initsogar Initsogar deleted the add/backup-storage-ui branch January 23, 2023 23:59
@github-actions github-actions bot removed the [Status] Needs Review To request a review from fellow Jetpack developers. Label will be renamed soon. label Jan 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package] Backup [Plugin] Backup A plugin that allows users to save every change and get back online quickly with one-click restores. [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Status] Needs Test Review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants