magento2 icon indicating copy to clipboard operation
magento2 copied to clipboard

Add Tracking Parameters to Varnish Configuration

Open sprankhub opened this issue 1 year ago • 15 comments

Description (*)

Add additional tracking parameters to the Varnish configuration, so that the same page will be cached independent of those tracking parameters.

Related Pull Requests

https://github.com/magento/magento2/pull/38299 https://github.com/magento/magento2/pull/38302

Fixed Issues (if relevant)

  1. Fixes magento/magento2#38298

Manual testing scenarios (*)

  1. Open the Magento backend
  2. Open Stores > Configuration > Advanced > System > Full Page Cache
  3. Export the Varnish configuration
  4. Make sure the new tracking parameters are included

Questions or comments

Previous PRs have not been merged and not been updated. Hence, here is another try to get this over the line.

Contribution checklist (*)

  • [X] Pull request has a meaningful description of its purpose
  • [X] All commits are accompanied by meaningful commit messages
  • [ ] All new or changed code is covered with unit/integration tests (if applicable)
  • [ ] README.md files for modified modules are updated and included in the pull request if any README.md predefined sections require an update
  • [ ] All automated tests passed successfully (all builds are green)

sprankhub avatar Sep 19 '24 11:09 sprankhub

Hi @sprankhub. Thank you for your contribution! Here are some useful tips on how you can test your changes using Magento test environment.

Add the comment under your pull request to deploy test or vanilla Magento instance:
  • @magento give me test instance - deploy test instance based on PR changes
  • @magento give me 2.4-develop instance - deploy vanilla Magento instance

:exclamation: Automated tests can be triggered manually with an appropriate comment:

  • @magento run all tests - run or re-run all required tests against the PR changes
  • @magento run <test-build(s)> - run or re-run specific test build(s) For example: @magento run Unit Tests

<test-build(s)> is a comma-separated list of build names.

Allowed build names are:
  1. Database Compare
  2. Functional Tests CE
  3. Functional Tests EE
  4. Functional Tests B2B
  5. Integration Tests
  6. Magento Health Index
  7. Sample Data Tests CE
  8. Sample Data Tests EE
  9. Sample Data Tests B2B
  10. Static Tests
  11. Unit Tests
  12. WebAPI Tests
  13. Semantic Version Checker

You can find more information about the builds here :information_source: Run only required test builds during development. Run all test builds before sending your pull request for review.


For more details, review the Code Contributions documentation. Join Magento Community Engineering Slack and ask your questions in #github channel.

m2-assistant[bot] avatar Sep 19 '24 11:09 m2-assistant[bot]

If you have doubts regarding the parameters, check https://github.com/mpchadwick/tracking-query-params-registry/blob/master/_data/params.csv, where all of them are mentioned including a reference.

sprankhub avatar Sep 19 '24 11:09 sprankhub

It would be good to handle this PR together with https://github.com/magento/magento2/pull/35228 (_kx is also referenced in that csv file)

hostep avatar Sep 19 '24 20:09 hostep

Thanks for the feedback, @hostep. I guess it would be easiest if I include the parameter here in this PR. Or should I try to cherry-pick that other commit to keep the author information? What do you think?

sprankhub avatar Sep 20 '24 05:09 sprankhub

Yeah cherry-picking is probably the best, this PR has a lot more upvotes than the other and probably will be picked up sooner than the other, so having everything fixed in one PR is probably the fastest way to get everything in the core.

hostep avatar Sep 23 '24 06:09 hostep

I now cherry-picked the changes from https://github.com/magento/magento2/pull/35228 and also applied the change to the Varnish 7 VCL.

sprankhub avatar Sep 23 '24 06:09 sprankhub

@magento run all tests

engcom-Bravo avatar Oct 16 '24 04:10 engcom-Bravo

Hi @sprankhub ,

Thanks for the collaboration & contribution!

:heavy_check_mark: QA Passed

Preconditions:

  • Install fresh Magento 2.4-develop

Steps to reproduce

  • Open the Magento backend
  • Open Stores > Configuration > Advanced > System > Full Page Cache
  • Export the Varnish configuration
  • Make sure the new tracking parameters are included

Before: :heavy_multiplication_x: 

Screenshot 2024-10-16 at 10 11 00

After: :heavy_check_mark:

Screenshot 2024-10-16 at 10 25 35

Builds are failed. Hence, moving this PR to Extended Testing.

Thanks.

engcom-Bravo avatar Oct 16 '24 09:10 engcom-Bravo

@magento run all tests

engcom-Charlie avatar Oct 16 '24 09:10 engcom-Charlie

Cheers

Gelmo avatar Oct 16 '24 16:10 Gelmo

@magento run Functional Tests B2B, Functional Tests EE

engcom-Charlie avatar Oct 17 '24 05:10 engcom-Charlie

@magento run Functional Tests B2B

engcom-Charlie avatar Oct 17 '24 09:10 engcom-Charlie

The Functional EE test failures are not consistent in recent 2 builds on the same code. The tests are neither part of PR nor failing because of its changes, seems to be flaky.

Run 1: https://public-results-storage-prod.magento-testing-service.engineering/reports/magento/magento2/pull/39188/4651151eb184b68de3ad372419f1a23d/Functional/allure-report-ee/index.html#categories

image

Run 2: https://public-results-storage-prod.magento-testing-service.engineering/reports/magento/magento2/pull/39188/e54a1bee28f120d2e13548854311a981/Functional/allure-report-ee/index.html#categories

image

engcom-Charlie avatar Oct 17 '24 09:10 engcom-Charlie

@magento run Functional Tests B2B

engcom-Charlie avatar Oct 18 '24 06:10 engcom-Charlie

Few of the functional B2B test failures are not consistent and one of them is a known issue. Hence moving this PR in Merge in Progress now.

Run 1: https://public-results-storage-prod.magento-testing-service.engineering/reports/magento/magento2/pull/39188/924e8c6185564914f96a7e10bd139e31/Functional/allure-report-b2b/index.html#categories

image

Run 2: https://public-results-storage-prod.magento-testing-service.engineering/reports/magento/magento2/pull/39188/25d25e585bd56bfa9186d36dc9d7a0fa/Functional/allure-report-b2b/index.html#categories

image

Known issues: ACP2E-3314 - StorefrontPrintListItemsFromRequisitionListTest ACQE-6402 - StorefrontVirtualQuotePurchaseOrderTest

engcom-Charlie avatar Oct 18 '24 09:10 engcom-Charlie