[5.7] Consolidate processing of catalog pricing jobs#4072
Open
nfourtythree wants to merge 19 commits into5.7from
Open
[5.7] Consolidate processing of catalog pricing jobs#4072nfourtythree wants to merge 19 commits into5.7from
nfourtythree wants to merge 19 commits into5.7from
Conversation
…pdate-for-purchasables-that-meet
50c9ca8 to
d0dc031
Compare
…pdate-for-purchasables-that-meet
…pdate-for-purchasables-that-meet
…pdate-for-purchasables-that-meet
Contributor
There was a problem hiding this comment.
Pull request overview
Consolidates catalog pricing regeneration work by persisting pending work into a dedicated queue table and having a single job execution reserve/consume that work, reducing queue overhead and aligning behavior with other consolidated job patterns (related to #4054).
Changes:
- Added
commerce_catalogpricing_queuetable + ActiveRecord to store/merge pending regeneration work (by purchasable IDs or rule IDs). - Updated
CatalogPricing::createCatalogPricingJob()to enqueue/merge work into the queue table and push a consolidatedCatalogPricingjob. - Updated
CatalogPricingqueue job to reserve a queue row, run generation, and delete/release the row based on success/failure.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| src/services/CatalogPricing.php | Writes/merges queue rows for pending catalog pricing work; adds reservation/release/delete helpers; changes job scheduling to consolidated processing. |
| src/records/CatalogPricingQueue.php | New ActiveRecord representing queue rows (type, ids JSON, reserved flag). |
| src/queue/jobs/CatalogPricing.php | Consolidated job execution: reserves a queue row, generates prices, then deletes/releases the row. |
| src/migrations/m260407_000000_add_catalog_pricing_queue_table.php | Adds the new queue table + indexes/FK for upgrades. |
| src/migrations/Install.php | Creates the queue table + indexes/FK for fresh installs. |
| src/db/Table.php | Adds Table::CATALOG_PRICING_QUEUE constant. |
| src/Plugin.php | Bumps schema version to trigger migration execution. |
| CHANGELOG-WIP.md | Documents new extensibility additions (table/record/service methods). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Make sure if there is already an "all ids" row or the request to the method is asking to process "all ids". That row is actually being created Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…purchasables-that-meet' of github.com:craftcms/commerce into nathaniel/pt-2823-5x-catalog-pricing-doesnt-update-for-purchasables-that-meet
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…purchasables-that-meet' of github.com:craftcms/commerce into nathaniel/pt-2823-5x-catalog-pricing-doesnt-update-for-purchasables-that-meet
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Changing strategy on this one. Reworking to mimic how search keyword jobs combine with each other to reduce overhead
Related issues
#4054