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

Closes #6909: LRC hashes injected while SaaS is visiting #6919

Merged
merged 9 commits into from
Aug 29, 2024

Conversation

Miraeld
Copy link
Contributor

@Miraeld Miraeld commented Aug 28, 2024

Description

Fixes #6909

Type of change

  • New feature (non-breaking change which adds functionality).
  • Bug fix (non-breaking change which fixes an issue).
  • Enhancement (non-breaking change which improves an existing functionality).
  • Breaking change (fix or feature that would cause existing functionality to not work as before).
  • Sub-task of #(issue number)
  • Release

Detailed scenario

  • Manually delete the LRC data of a page to ensure there is no LRC data for this page. Make sure the LRC feature is enabled.
  • Clear the cache and visit the page with nowprocket=1&no_optimize=1&wpr_imagedimensions=1. LRC hashes must be added to the page.
  • Check the DB, the LRC data must have been stored.
  • Clear the cache again. Visit the same page. LRC hashes must not be injected.

Technical description

Documentation

We add a trigger to make sure hashes are added.

New dependencies

Risks

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.)

@Miraeld Miraeld added the module: ALR Issues related to the Automatic Lazy Rendering feature label Aug 28, 2024
@Miraeld Miraeld requested a review from a team August 28, 2024 02:59
@Miraeld Miraeld self-assigned this Aug 28, 2024
@Miraeld Miraeld changed the base branch from develop to feature/lrc August 28, 2024 02:59
Copy link

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
Report missing for 7999ed21 20.24% (target: 50.00%)
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (7999ed2) Report Missing Report Missing Report Missing
Head commit (005941b) 37956 9516 25.07%

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 (#6919) 583 118 20.24%

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.

Copy link

codacy-production bot commented Aug 28, 2024

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
+0.01% (target: -0.10%) 0.00% (target: 50.00%)
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (d7a5719) 37925 16540 43.61%
Head commit (5f9f34b) 37926 (+1) 16543 (+3) 43.62% (+0.01%)

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 (#6919) 2 0 0.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

@Miraeld
Copy link
Contributor Author

Miraeld commented Aug 28, 2024

Hasn't pass review yet, but I allow myself posting this screenshot, which is a result of the DB after a warm-up
Screenshot 2024-08-28 at 11 30 28
We can see pages with hashes while it was full empty before.
Pages that are empty now are normal. It should be empty.
I did the following process:

  1. Manually delete the LRC data of a page to ensure there is no LRC data for this page. Make sure the LRC feature is enabled.

  2. Clear the cache and visit the page with nowprocket=1&no_optimize=1&wpr_imagedimensions=1. LRC hashes must be added to the page.

  3. Check the DB, the LRC data must have been stored.

  4. Clear the cache again. Visit the same page. LRC hashes must not be injected.

  5. Clear performance hints to trigger a warm-up. After a few minutes, LRC data must be available in DB and the rows must contain hashes. (Some inconsistencies can occur, it happened to me once or twice over 15 tries to see a page with empty result while it shouldn't).

@jeawhanlee
Copy link
Contributor

Good Job Sir
What do you think about having an integration test for this filter: rocket_critical_image_saas_visit_buffer callback?

@MathieuLamiot
Copy link
Contributor

Tested and looks OK on http://mathieu.e2e.rocketlabsqa.ovh/.
About #6894, I can't reproduce now with this version on mathieu.e2e.I triggered warm-ups several times and consistently get only one row with empty LRC hash list (contact-us, mobile version) which seems normal.

I'll keep this in review pending closing @jeawhanlee comment about tests. But then, it can be considered QA Done :)

@MathieuLamiot MathieuLamiot self-requested a review August 28, 2024 19:19
@Miraeld
Copy link
Contributor Author

Miraeld commented Aug 29, 2024

Integrations tests have been added @jeawhanlee , can you confirm and move it to QA Ready ?

@MathieuLamiot
Copy link
Contributor

Only tests changed since I manually checked the fix, so let's consider the QA Done

@MathieuLamiot MathieuLamiot merged commit 568f90f into feature/lrc Aug 29, 2024
12 of 13 checks passed
@MathieuLamiot MathieuLamiot deleted the fix/6909-lrc-injected-saas branch August 29, 2024 13:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module: ALR Issues related to the Automatic Lazy Rendering feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3.17 - LRC hashes must be injected when needed for SaaS visits
4 participants