-
-
Notifications
You must be signed in to change notification settings - Fork 730
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
[Product Refactor] Primary Taxon #11369
Conversation
c564a2b
to
285b41d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work. Looks like we may need to rethink the shopfront ordering at some point.
Another couple of thoughts:
- A column ignore would prepare us for the column removal and test that Rails really doesn't try to access it.
- Resolving style issues or at least updating the Rubocop todo helps others keeping the code quality high.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good. I have a few questions and think we might be able to simplify the factory.
But I think the only essential change is to fix the linter errors. I'll have a go at that now.
Hi @Matt-Yorkley, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rebased and conflicts resolved.
I resolved the conflicts but there are quite a few specs failing now. Back to In Dev for @Matt-Yorkley. We need to review these pull requests quicker to avoid conflicts. Otherwise it will be stuck in the review-test-rebase loop forever. |
37dc49f
to
dcf0c57
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, I reviewed the last commits, all looks good to me
Ready to test with no conflicts! |
As it's user-facing change, it would be good to provide a little more detail in the PR name. I'm not sure exactly how it will affect users, but I guess they will see the category selection when editing Variants instead of Products? Does the tester have a suggestion? 🥺 |
Hi @Matt-Yorkley, I have tested the following. Super admin:
Admin:
Shopper:
ConclusionI am not sure how edgy the two failing test cases are. They both are regressions, I think. After our discussion on Tuesday about the trade off between quality and invested time I don't know if we want to merge, create issues and maybe fix later or if we want fix this before merging. So I'm adding the feedback needed label and ask @openfoodfoundation/train-drivers-product-owners for a decision. Thanks anyway for this great effort! 🙏 |
Thx @drummer83 for these thorough testing notes! I couldn't make it on Tuesday so I'm not sure I have all the info. Are those last bits tricky to fix @Matt-Yorkley ? I'm thinking we could merge and fix later: it will take a while for users to see they can change the category per variant and even in that case, scenarios where they will use it are rare - but I could be wrong. |
I thought it's a good idea to test deeply due to the regression we currently have with the product import and tax categories. Didn't want that to happen again. 😉 I agree that use cases for different categories for variants of the same product are rare and will probably not be used for some time. |
Ah so the multiple entries are happening all the time, not only when variants of the same product have different categories. In that case yes I agree it should be fixed in priority. |
Remove duplicate when a product has mutiple variant in the same category (taxon)
Hey @rioug , There were some issues staging the PR, it seems the first attempt fails to fully deploy; this happened for both: staging-FR
I'll stage master to make sure these products appear again, and this is indeed introduced by this PR. staging-UK I thought this could be an issue with the need of re-running the migration (for which, we'd have to delete a pre-existing version). But I could not find any of the migrations from this PR:
I'll still test staging master before - since the PR was recently rebase, maybe a migration which is in master could be needed? I'm not sure, can't hurt trying. |
(cont.) staging-FR As for the tests itself, we had two relevant scenarios:
After deleting it, the cat-o-mat product lowers it's position accordingly: staging-UK Deploying master works fine; still can't deploy this PR: Worth trying deployment on staging-AU: Deployment seems to have worked with no issues. Summary The PR fixes the previous issues 🎉 Added the feedback-needed label. |
It looks like the DB on staging-UK already has |
The staging-UK DB somehow got out of sync. |
What? Why?
Part of #9069
Migrates
primary_taxon
from Product to Variant.Review Note
I hit a bit of an issue described here: https://openfoodnetwork.slack.com/archives/C01T75H6G0Z/p1691581195059389
I've added a temporary solution which resolves it (see last two commits) by applying the filtering products by taxon via the first taxon of the first variant and it avoids having to remove the ordering feature for now. I think we can come back to this later.
What should we test?
Setting the product category when creating a new product or editing a variant, filtering and ordering by taxon in the shopfront.
Displaying the taxon (product category) in the products and inventory report.
Release notes
Changelog Category: User facing changes
The title of the pull request will be included in the release notes.