feat: add support of ProductListingCriteria to compressed criteria parameter
1. Why is this change necessary?
Storefront OpenAPI schema contains ProductListingCriteria definition. It represents Criteria component + a number of additional parameters that can be used in ProductListing pages.
With https://github.com/shopware/shopware/pull/12541 and https://github.com/shopware/shopware/pull/12476 we introduces compressed _criteria parameter that allows to pass Criteria parameter as a base64url(gzip(json_encode($criteria))) string.
To keep API schema consistent, it makes sense to allow passing also ProductListingCriteria parameters the same way.
2. What does this change do, exactly?
There is no ProductListingCriteria class in the system, and it's not easy to introduce it without bc breaks (taking into account that custom plugin filters can be passed the same way). This PR add code that parses _criteria parameter and sets values that were not processed by RequestCriteriaBuilder into $request->query parameters bag.
3. Describe each step to reproduce the issue or behaviour.
4. Please link to the relevant issues (if any).
- relates https://github.com/shopware/shopware/issues/12388
This PR replaces https://github.com/shopware/shopware/pull/12703 (see reasoning)
5. Checklist
- [ ] I have written tests and verified that they fail without my change
- [ ] I have updated developer-facing release notes if this change is relevant for external developers:
- Add a short entry to
RELEASE_INFO-6.<major>.mdunder “Upcoming” for informational changes, including the consequences of the change and how it affects external developers. - Add an
UPGRADEsection inUPGRADE-6.<next-major>.mdfor breaking changes (what/why/impact/how to adapt). - See the Release Notes & Changelog Process for details.
- Add a short entry to
- [ ] I have written or adjusted the documentation according to my changes
- [ ] This change has comments for package types, values, functions, and non-obvious lines of code
- [ ] I have read the contribution requirements and fulfilled them
OpenAPI Snapshot
Project: shopware/store-api
Changes detected: 5 total
0 additions · 0 removals · 5 modifications
Diff: https://explore-openapi.dev/diff#...
Links:
All Project Snapshots · Base Branch Snapshot
Project: shopware/admin-api
No changes detected
Your OpenAPI schema is identical to the base branch (trunk).
Codecov Report
:x: Patch coverage is 87.50000% with 2 lines in your changes missing coverage. Please review.
:white_check_mark: Project coverage is 57.33%. Comparing base (3e7b64f) to head (3d171d6).
:warning: Report is 1 commits behind head on trunk.
:white_check_mark: All tests successful. No failed tests found.
| Files with missing lines | Patch % | Lines |
|---|---|---|
| ...g/Processor/CompressedCriteriaListingProcessor.php | 81.81% | 2 Missing :warning: |
Additional details and impacted files
@@ Coverage Diff @@
## trunk #13643 +/- ##
==========================================
+ Coverage 54.06% 57.33% +3.26%
==========================================
Files 3199 4776 +1577
Lines 96165 164901 +68736
Branches 0 8977 +8977
==========================================
+ Hits 51993 94539 +42546
- Misses 44172 67704 +23532
- Partials 0 2658 +2658
| Flag | Coverage Δ | |
|---|---|---|
| phpunit-migration | 94.31% <ø> (ø) |
|
| phpunit-unit | 51.97% <87.50%> (+0.01%) |
:arrow_up: |
Flags with carried forward coverage won't be shown. Click here to find out more.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
:rocket: New features to boost your workflow:
- :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.