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: merge the products and product images directories for OFF, OBF, OPF and OPFF - WIP #10959

Draft
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

stephanegigandet
Copy link
Contributor

@stephanegigandet stephanegigandet commented Oct 31, 2024

In the last few weeks, we normalized product barcodes and deduplicated products that existed in multiple flavors (Open Food Facts, Open Beauty Facts, Open Product Facts and Open Pet Food Facts).

We are now going to merge the directories that contain product and product revision data (the .sto files) and the product images. We will keep separate MongoDB databases for each flavor.

This will:

  • make it much easier to move products from one product type to another
  • remove the possibility of having duplicate products on multiple flavors
  • make it much easier to have read and write APIs that can be used to retrieve / update products of any type.

Deployment plan:

  • stop OBF, OPF, OPFF for the duration of the migration (a couple of hours)
  • update OFF code
  • move products and product images dirs from OBF, OPF, OPFF to the OFF directory structure
  • change the links to products and products of images on OBF, OPF, OPFF to use the OFF dirs
  • restart OBF, OPF, OPFF with the new code

In this PR:

  • code updates to check product_type when reading / editing a product for both the website and API. Redirect to the right flavor if the product type is different than the one of the server the request was made to.
  • changed the product edit form to allow moderators to change the product_type
  • keep support for moderators to put "obf" etc. in the change code field
  • tests for the above
  • small refactor to put into Config.pm things that are the same for all flavors and that are currently duplicated in Config_off.pm etc.

Will solve:

@stephanegigandet stephanegigandet requested a review from a team as a code owner October 31, 2024 16:12
@github-actions github-actions bot added ✏️ Editing API WRITE WRITE API to allow sending product info and image API READ All READ APIs include Product, Search… 🧪 tests Template::Toolkit The templating toolkit used by product opener. The starting point for HTML/JS/CSS fixes. Display Products URL config multilingual products 🌐 Translations labels Oct 31, 2024
@stephanegigandet stephanegigandet marked this pull request as draft October 31, 2024 16:18
Copy link

sonarcloud bot commented Oct 31, 2024

@github-actions github-actions bot added the 💥 Merge Conflicts 💥 Merge Conflicts label Oct 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API READ All READ APIs include Product, Search… API WRITE WRITE API to allow sending product info and image config Display ✏️ Editing 💥 Merge Conflicts 💥 Merge Conflicts multilingual products Products Template::Toolkit The templating toolkit used by product opener. The starting point for HTML/JS/CSS fixes. 🧪 tests 🌐 Translations URL
Development

Successfully merging this pull request may close these issues.

1 participant