Skip to content
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

Refactor product/ingredient import #1666

Merged
merged 39 commits into from
May 29, 2024
Merged

Conversation

rolandgeider
Copy link
Member

@rolandgeider rolandgeider commented May 19, 2024

Proposed Changes

  • Adds USDA food import 🙌🏻
  • Perform OFF imports directly from their dumps or daily delta files, without needing to import them to mongoDB (based on Import Open Food Facts Ingredients without Mongo #1540)
  • Some refactoring for commonly used logic
  • Increase author field length to accomodate for the reaaaaaly long values in some of the OFF products
  • Consistently use "fiber" fibre/fibres/fibers -> fiber #1670
  • Remove the submission status from the ingredients. We're only importing ingredients from external sources and this wasn't exposed to the UI anyway

Other questions

  • Do users need to run some commmands in their local instances due to this PR
    (e.g. database migration)?
    Yes, db migration

@rolandgeider rolandgeider linked an issue May 19, 2024 that may be closed by this pull request
@rolandgeider rolandgeider marked this pull request as draft May 19, 2024 10:42
@rolandgeider rolandgeider changed the title Add USD product import Add USDA product import May 19, 2024
@rolandgeider rolandgeider marked this pull request as ready for review May 21, 2024 15:03
@rolandgeider rolandgeider changed the title Add USDA product import Refactor product/ingredient import May 22, 2024
This can run automatically once per day if configured
This is specially important if we regularly import the delta files, since these
can have bad quality. We will probably need to add a bit more before putting
this live
…nto feature/import-usda-products

# Conflicts:
#	wger/nutrition/off.py
Also, make sure just rename the field and don't accidentally nuke the fibre field ;)
Ingredients / products will only be imported through automatic processes. We
should just point users in case of missing products to Open Food Facts, and not
handle this on our side. Admins can still add entries if they want.
@Dieterbe
Copy link
Contributor

🙇‍♂️

@rolandgeider rolandgeider merged commit 3322cb3 into master May 29, 2024
8 checks passed
@rolandgeider rolandgeider deleted the feature/import-usda-products branch May 29, 2024 10:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add USDA food import
3 participants