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

Apply RocketCDN CNAME change #7095

Merged
merged 16 commits into from
Nov 19, 2024
Merged

Conversation

wordpressfan
Copy link
Contributor

@wordpressfan wordpressfan commented Nov 7, 2024

Description

Fixes #7027

Starting from 3.17.3, we will show a message if the cname changed in WPR settings page only.

Type of change

  • New feature (non-breaking change which adds functionality).

Detailed scenario

the approach that we took here is that with update, we will force refreshing the rocketcdn status which has the cname url on it and compare it with the old/previous url then set an option which will be used to show the admin notice in WPR side, so the trigger here is the WPR plugin update.

Technical description

Documentation

With update we will force getting rocketcdn cname again and if it's different that the old url, we will show the notice to let the customers know about that.

New dependencies

No

Risks

I mentioned some questions with risks here: https://wp-media.slack.com/archives/C06CQPWEJSK/p1731572752314419
to @wp-media/product team

Mandatory Checklist

Code validation

  • I validated all the Acceptance Criteria. If possible, provide screenshots or videos.
  • I triggered all changed lines of code at least once without new errors/warnings/notices.
  • I implemented built-in tests to cover the new/changed code.

Code style

  • I wrote a self-explanatory code about what it does.
  • I protected entry points against unexpected inputs.
  • I did not introduce unnecessary complexity.
  • Output messages (errors, notices, logs) are explicit enough for users to understand the issue and are actionnable.

Additional Checks

  • In the case of complex code, I wrote comments to explain it.
  • When possible, I prepared ways to observe the implemented system (logs, data, etc.).
  • I added error handling logic when using functions that could throw errors (HTTP/API request, filesystem, etc.)

@wordpressfan wordpressfan self-assigned this Nov 7, 2024
Copy link

codacy-production bot commented Nov 7, 2024

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
Report missing for e5bca661 23.64% (target: 50.00%)
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (e5bca66) Report Missing Report Missing Report Missing
Head commit (744a99c) 38226 16726 43.76%

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#7095) 55 13 23.64%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

Codacy stopped sending the deprecated coverage status on June 5th, 2024. Learn more

Footnotes

  1. Codacy didn't receive coverage data for the commit, or there was an error processing the received data. Check your integration for errors and validate that your coverage setup is correct.

@wordpressfan wordpressfan marked this pull request as ready for review November 14, 2024 08:41
@wordpressfan
Copy link
Contributor Author

I'll be waiting for a reply here: https://wp-media.slack.com/archives/C06CQPWEJSK/p1731572752314419
to see if we will change the direction that we took here or we are fine.

@wordpressfan
Copy link
Contributor Author

I'll change the way we handle this to detect the old and new urls when setting rocketcdn_status transient instead of WPR upgrade.

@wordpressfan wordpressfan requested a review from a team November 14, 2024 16:31
inc/Engine/CDN/RocketCDN/NoticesSubscriber.php Outdated Show resolved Hide resolved
inc/Engine/WPRocketUninstall.php Outdated Show resolved Hide resolved
inc/Engine/CDN/RocketCDN/DataManagerSubscriber.php Outdated Show resolved Hide resolved
@remyperona
Copy link
Contributor

PR approved to move to QA, but we should have tests coverage added to before merging

@piotrbak
Copy link
Contributor

@wordpressfan There's still the question from Mathieu in this topic:
https://wp-media.slack.com/archives/CUT7FLHF1/p1731692989584199?thread_ts=1731601939.328049&cid=CUT7FLHF1

Please make after merging this PR to send it to transifex.

@Mai-Saad
Copy link
Contributor

Mai-Saad commented Nov 18, 2024

As per slack,
Trigger: On update from < 3.17.3 to >= 3.17.3
If the CDN URL is set to xxxxxxxx.rocketcdn.me (where xxxxxxxx is exactly 8 alphanumeric characters), then:
change it to xxxxxxxx.delivery.rocketcdn.me
display the banner with before/after values
There should be no API call involved in this approach.
ACs would be: (validation is WIP)

  • On WP Rocket < 3.17.3, enable CDN option. Set xxxxxxxx.rocketcdn.me as CNAME URL in the plugin. Update to 3.17.3. The CNAME should be xxxxxxxx.delivery.rocketcdn.me and the banner must appear.

  • On WP Rocket < 3.17.3, disable CDN option. Set xxxxxxxx.rocketcdn.me as CNAME URL in the plugin. Update to 3.17.3. The CNAME should be xxxxxxxx.delivery.rocketcdn.me and the banner must appear.

  • On WP Rocket < 3.17.3, enable CDN option. Set xxxxxxxx.delivery.rocketcdn.me as CNAME URL in the plugin. Update to 3.17.3. The CNAME should still be xxxxxxxx.delivery.rocketcdn.me and the banner must not appear. => (from 3.16.4 and 3.17.2.1)

  • On WP Rocket < 3.17.3, enable CDN option. Set xxxxxxxx.another.cdn as CNAME URL in the plugin. Update to 3.17.3. The CNAME should still be xxxxxxxx.another.cdn and the banner must not appear. => (only green text under the option is displayed on old/new version if we already have a valid subscription)

  • With Fresh install and activation of subscription => no banner displayed and CNAME with delivery is there ✔️

  • Update from 3.17.3 to > 3.17.3 while xxxxxxxx.delivery.rocketcdn.me as CNAME => No banner displayed

  • Update from 3.17.3 to > 3.17.3 while xxxxxxxx.rocketcdn.me as CNAME => ===> actual is no rewrite to cdn and no banner

@hanna-meda hanna-meda added this pull request to the merge queue Nov 19, 2024
Merged via the queue into develop with commit 0559ca4 Nov 19, 2024
12 of 13 checks passed
@hanna-meda hanna-meda deleted the feature/7027-rocketcdn-cname-change branch November 19, 2024 11:49
@wordpressfan
Copy link
Contributor Author

Slack discussion: https://wp-media.slack.com/archives/CUKB44GNN/p1731939168323999

We need to create another issue to add more automated tests (unit/integration) to fix the codacy CI failure.

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.

RocketCDN CNAME change
6 participants