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

Fixes #6972 Prevent injecting Beacon script when DONOTROCKETOPTIMIZE is defined #7045

Merged
merged 2 commits into from
Oct 25, 2024

Conversation

Khadreal
Copy link
Contributor

@Khadreal Khadreal commented Oct 18, 2024

Description

Fixes #6972
Prevent injecting Beacon script when DONOTROCKETOPTIMIZE is defined and allow SaaS visit

Type of change

  • Bug fix (non-breaking change which fixes an issue).

Detailed scenario

Steps are available in the issue #6972

Technical description

Documentation

Check for DONOTROCKETOPTIMIZE before injecting beacon and check if it's visit for SaaS

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.

@Khadreal Khadreal requested a review from a team October 18, 2024 13:44
@Khadreal Khadreal self-assigned this Oct 18, 2024
@Khadreal Khadreal added type: bug Indicates an unexpected problem or unintended behavior module: OCI Optimize Critical Images labels Oct 18, 2024
Copy link

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
Report missing for ce7b6011 100.00% (target: 50.00%)
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (ce7b601) Report Missing Report Missing Report Missing
Head commit (997da2d) 37750 16597 43.97%

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 (#7045) 1 1 100.00%

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.

@Miraeld
Copy link
Contributor

Miraeld commented Oct 24, 2024

Hello hello,
Here are the results:

  • Do not contain any mention of DONOTROCKETOPTIMIZE nor wpr_imagedimensions
    result-with-nothing-added
    ✅ We get the beacon injected

  • Only DONOTROCKETOPTIMIZE declared:
    only-donotrocketoptimize-declared
    ✅ We do not get the beacon injected

  • DONOTROCKETOPTIMIZE and wpr_imagedimensions used:
    everything-declared
    ✅ We do get the beacon injected.

Here is the report:
testrail-report-649.pdf

@MathieuLamiot
Copy link
Contributor

MathieuLamiot commented Oct 25, 2024

Discussed during the daily: This PR is needed for 3.17.2 as the rollback of the regression for SaaS visist was not done. So we should merge this to develop to fix the regression and complete the issue itself too.
A quick double check once merged from @wp-media/qa-team would be good then.

@Mai-Saad Mai-Saad added this pull request to the merge queue Oct 25, 2024
Merged via the queue into develop with commit 7555acd Oct 25, 2024
15 of 16 checks passed
@Mai-Saad Mai-Saad deleted the fix/6972-donotrocketoptimize branch October 25, 2024 15:24
Khadreal added a commit that referenced this pull request Nov 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module: OCI Optimize Critical Images type: bug Indicates an unexpected problem or unintended behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

wpr-beacon.min.js is added even if DONOTROCKETOPTIMIZE is set to true
5 participants