Commit Graph

27690 Commits

Author SHA1 Message Date
David Cook
fd889133cb Enable master variants with associated order cycles
There's only 5 in UK prod. keeping them is easier than figuring out if it's safe to delete.

(cherry picked from commit 4bf65e330b)
v4.4.0
2023-06-23 14:16:45 +10:00
David Cook
4ac3dda398 Delete stock_items for master variants
All variants have stock_items records, but master variants never use them, so these were always redundant.

(cherry picked from commit 2025a98f58)
2023-06-23 14:16:45 +10:00
Matt-Yorkley
9d5d269f1f Set master variants which are associated to line items to non-master
Line items which reference a master variant is a scenario that in theory shouldn't have been valid or even possible for at least 5-6 years, and these old bits of data in theory should have been cleaned up at the time those changes were made. But a couple of servers have some really old data that's not in a nice state.

Here we can just flip the is_master flag to false for those specific (legacy data) cases before deleting any other master variants, to keep the legacy line item data intact.

(cherry picked from commit c88799618f)
2023-06-23 14:16:45 +10:00
Matt-Yorkley
f4405775f6 Remove line items related to master variants
These shouldn't technically exist, but apparently they can be present if the dataset is old enough. They can trigger a foreign key violation if they are present when a master variant is deleted, so they need to be dropped if present.

(cherry picked from commit f9185ea56e)
2023-06-23 14:16:45 +10:00
Matt-Yorkley
3a38361857 Remove inventory units related to master variants
These shouldn't technically exist, but apparently they can be present if the dataset is old enough. They can trigger a foreign key violation if they are present when a master variant is deleted, so they need to be dropped if present.

(cherry picked from commit 6f5d3ceacc)
2023-06-23 14:16:45 +10:00
Matt-Yorkley
68b59ab7a6 Remove array syntax on new product form for product image
(cherry picked from commit 24aa55e053)
2023-06-23 14:16:45 +10:00
Matt-Yorkley
a56541216e Update ScopeVariantsForSearch logic to match both product and variant SKUs
(cherry picked from commit ae24b2d688)
2023-06-23 14:16:45 +10:00
Matt-Yorkley
05d9646f3e Blank out product SKU when cloning a product
This was effectively being done before for the product's sku (stored on the master variant) via the #duplicate_variant method, but now it needs to be done explicitly on the product in #duplicate_product

(cherry picked from commit 0f253bb2a0)
2023-06-23 14:16:45 +10:00
Matt-Yorkley
b1de64bf3e Remove unnecessary iterator
(cherry picked from commit 15000c7ed1)
2023-06-23 14:16:45 +10:00
Matt-Yorkley
e976cc6d95 Disable variant is_master column
(cherry picked from commit 733dd3c428)
2023-06-23 14:16:45 +10:00
Matt-Yorkley
9a89b22364 Remove master images data migration tests
(cherry picked from commit be72bbebb9)
2023-06-23 14:16:44 +10:00
Matt-Yorkley
1b304e2aa4 Remove is_master from variant serializer
(cherry picked from commit fbd09869bb)
2023-06-23 14:16:44 +10:00
Matt-Yorkley
48cdca59fd Remove superfluous method from products controller
(cherry picked from commit ced60d4382)
2023-06-23 14:16:44 +10:00
Matt-Yorkley
9095abfed2 Delete master variants
(cherry picked from commit b59bdc75e9)
2023-06-23 14:16:44 +10:00
Matt-Yorkley
aa9fd682d8 Remove is_master and not_master scopes
(cherry picked from commit 1daab8994d)
2023-06-23 14:16:44 +10:00
Matt-Yorkley
5b73ccb213 Remove unused is_master references in tests
(cherry picked from commit 0703bb4583)
2023-06-23 14:16:44 +10:00
Matt-Yorkley
dda3cfa58d Remove master variant validation conditionals
(cherry picked from commit 85059bfb26)
2023-06-23 14:16:44 +10:00
Matt-Yorkley
9da649a296 Improve validation feedback on new variant page and add test coverage
(cherry picked from commit 8247dce2dc)
2023-06-23 14:16:44 +10:00
Matt-Yorkley
2e53b9a0c6 Fix flaky spec: use milliseconds in cache service and remove sleep
(cherry picked from commit 618900767f)
2023-06-23 14:16:44 +10:00
Matt-Yorkley
527e305e2f Set unit_value to true when cloning a product
This value doesn't get persisted, but it's presence is validated. The product's duplicated variants store the actual :unit_value attribute

(cherry picked from commit 1e36043a2e)
2023-06-23 14:16:44 +10:00
Matt-Yorkley
89b59f97ee Reorganise associations, validations, scopes and callbacks for clarity
(cherry picked from commit 1922598d2d)
2023-06-23 14:16:44 +10:00
Matt-Yorkley
26d3cffba3 Remove master variant from product
(cherry picked from commit 3ef7d2c9ff)
2023-06-23 14:16:44 +10:00
Matt-Yorkley
86703bb545 Migrate first master variant image to product image
(cherry picked from commit 21cba0aa13)
2023-06-23 14:16:44 +10:00
Matt-Yorkley
8e99f496ff Migrate product image from master variant to product
(cherry picked from commit 7dc1091bc2)
2023-06-23 14:16:44 +10:00
Matt-Yorkley
2f2506e698 Migrate master variant :sku to product
(cherry picked from commit d8649fc9fb)
2023-06-23 14:16:44 +10:00
Matt-Yorkley
7ef9c2f56a Stop storing unit_value and unit_description on master variant
(cherry picked from commit 6b9b5ea347)
2023-06-23 14:16:44 +10:00
Matt-Yorkley
ee4402f751 Stop using master variant for storing :display_as value
(cherry picked from commit 8c0b8dad85)
2023-06-23 14:16:44 +10:00
Matt-Yorkley
79a2d1228d Stop using master variant as a potential store for prices
(cherry picked from commit 1b06c20197)
2023-06-23 14:16:44 +10:00
Matt-Yorkley
da3202460c Update old specs that rely on master variant instead of real variants
(cherry picked from commit 80a0138b48)
2023-06-23 14:16:44 +10:00
Matt-Yorkley
75ccc5c72f Simplify product images delegation mess
(cherry picked from commit d4188da7c1)
2023-06-23 14:16:44 +10:00
Matt-Yorkley
aca72e6071 Remove dead code
(cherry picked from commit 42a5a48816)
2023-06-23 14:16:44 +10:00
Maikel Linke
2453084a6b Update translations v4.3.13 2023-06-16 14:02:47 +10:00
Maikel
39183547aa Merge pull request #11033 from openfoodfoundation/revert-10455-dependabot/bundler/redis-5.0.6
Revert "Fix `redis` and `hiredis-client` version requirements "
2023-06-16 13:42:55 +10:00
Maikel
24000b2ce3 Revert "Fix redis and hiredis-client version requirements " 2023-06-16 13:09:25 +10:00
Maikel
8e86f76278 Merge pull request #11018 from openfoodfoundation/dependabot/bundler/sidekiq-7.1.2
chore(deps): bump sidekiq from 7.1.1 to 7.1.2
2023-06-16 12:08:25 +10:00
Maikel
4a91c180a3 Merge pull request #11017 from openfoodfoundation/dependabot/bundler/ddtrace-1.12.1
chore(deps): bump ddtrace from 1.12.0 to 1.12.1
2023-06-16 11:14:10 +10:00
Maikel
d192024786 Merge pull request #11019 from filipefurtad0/flaky_cache_spec
Clears cache around examples
2023-06-16 11:12:24 +10:00
Maikel
ec7de516aa Merge pull request #11011 from openfoodfoundation/dependabot/bundler/aws-sdk-s3-1.124.0
chore(deps): bump aws-sdk-s3 from 1.123.1 to 1.124.0
2023-06-16 10:59:56 +10:00
David Cook
47745b5e49 Merge pull request #11004 from dacook/show-current-version
Show current version at bottom of admin dashboard
2023-06-16 09:26:00 +10:00
Matt-Yorkley
3301c7cabc Update stage.yml 2023-06-16 00:18:36 +01:00
David Cook
35d9837f24 Show current version at bottom of admin dashboard
With generic link to the releases page. We could provide a link to latest tag with `git describe --tags --abbrev=0`. But I thought it better to keep things simple.
2023-06-16 09:11:59 +10:00
Matt-Yorkley
436deb9797 Update stage.yml 2023-06-16 00:03:16 +01:00
Matt-Yorkley
57451f2639 Update stage.yml 2023-06-15 23:26:27 +01:00
Matt-Yorkley
d56ad66ab8 Update stage.yml 2023-06-15 20:57:40 +01:00
Matt-Yorkley
fc5a53ebd9 Update stage.yml 2023-06-15 20:53:20 +01:00
Matt-Yorkley
f27472106e Update stage.yml 2023-06-15 20:52:07 +01:00
Matt-Yorkley
5729e33f69 Merge pull request #11031 from Matt-Yorkley/deployment-workflow
Add workflow for deploying to staging
2023-06-15 20:40:10 +01:00
Matt-Yorkley
584f6297f5 Allow manual workflow triggers 2023-06-15 20:18:44 +01:00
Matt-Yorkley
12bf17e21e Add workflow for deploying to staging 2023-06-15 19:37:18 +01:00
Matt-Yorkley
7068df5d4b Merge pull request #10804 from Matt-Yorkley/public-images
Update ActiveStorage image processing
2023-06-15 15:49:11 +01:00