-
Notifications
You must be signed in to change notification settings - Fork 215
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
Closes #6599 validate image source before saving it into the DB #6605
Conversation
Could we also validate the resource usage/time spent on this one? |
Coverage summary from CodacySee diff coverage on Codacy
Coverage variation details
Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: Diff coverage details
Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: See your quality gate settings Change summary preferencesCodacy will stop sending the deprecated coverage status from June 5th, 2024. Learn more Footnotes
|
tests/Unit/inc/Engine/Media/AboveTheFold/AJAX/Controller/addLcpData.php
Outdated
Show resolved
Hide resolved
tests/Unit/inc/Engine/Media/AboveTheFold/AJAX/Controller/addLcpData.php
Outdated
Show resolved
Hide resolved
Reproducible for links here except for linear gradient case ... now we aren't adding those kind of URLs to DB. However, on this template, https://new.rocketlabsqa.ovh/wp-content/rocket-test-data/images/lcp/testwebp .webp is atf and not LCP while in PSI it's LCP https://e2e.rocketlabsqa.ovh/lcp_6599_template2/ (needs further investigation) Note: on trunk, webP is set as lcp (while we commented the BG image code but it isn't on branch) |
@wordpressfan We have a regression here while running e2e tests, see here |
Manual tests 🆗 https://wp-media.slack.com/archives/CUKB44GNN/p1717491699283409?thread_ts=1717423732.490199&cid=CUKB44GNN |
The test template is fine after merging 6693 to the branch, lcp not found and webP is ATF https://new.rocketlabsqa.ovh/lcp_6599_template2/. Note: visit the mobile version of the page using browserstack, is not added to DB (same on the trunk), visiting normal WP mobile page added normally to ATF table ===> In general further investigation is needed to make the template works If e2e is green then we can merge |
E2E Test Report: https://wp-media.slack.com/docs/T02RYMVKQ/F076AFQK40P |
@wordpressfan Is that expected that images from another hostname are filtered out with this PR? @wordpressfan There seems to be a regression, for instance on the template @piotrbak I would advice not to move forward with this PR in 3.16.1 as the result is quite uncertain at this stage. |
We changed the structure of the data being saved into the database a bit in other PRs and this PR is validating based on the old structure, so for sure many things will fail and we need to check, that's why this unit test case is failing as an example. |
Coverage summary from CodacySee diff coverage on Codacy
Coverage variation details
Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: Diff coverage details
Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: See your quality gate settings Change summary preferencesCodacy stopped sending the deprecated coverage status on June 5th, 2024. Learn more Footnotes
|
Ran e2e tests 2x and we are good for desktop, mobile scenario failures still the same as the one here |
I think it's working now properly, thanks @jeawhanlee |
I can't approve too because technically it's mine as well 😁 |
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.
It's missing the minified version of the beacon script
Can you update the PR description to remove irrelevant data and complete the checklist? |
I have run e2e on this branch again after merging develop into it and I get just one template failing on desktop but this template is also failing on dev, so no regression against dev here:
|
Next step to test this PR is to re-run E2E once wp-media/wp-rocket-e2e#88 is implemented. |
…-validate-image-src
Coverage summary from CodacySee diff coverage on Codacy
Coverage variation details
Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: Diff coverage details
Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: See your quality gate settings Change summary preferences🚀 Don’t miss a bit, follow what’s new on Codacy. Codacy stopped sending the deprecated coverage status on June 5th, 2024. Learn more Footnotes
|
E2E Results with E2E commit 7edc2237af34f62bf79185baa39023c8d83e0afd:
According to the expected behavior here, I think it's OK and that the E2E must be adapted. Here is my suggestion for the PR to adapt: wp-media/wp-rocket-e2e#117 Tested with the E2E PR, it's all OK. I'll move this to QA Done, and wait for QA team to come back to merge. |
Description
Fixes #6599
Documentation
User documentation
We just add another layer of sanitizing and checking the valid lcp/atf to be valid images
Technical documentation
Here we will exclude the following patterns and more:
Type of change
New dependencies
None
Risks
None
Checklists
Feature validation
Code style
Observability
Risks