Skip to content

fix: use recipe estimator for ingredient analysis (and test tool) - #13715

Merged
stephanegigandet merged 7 commits into
mainfrom
recipe-estimator-testing
Jun 5, 2026
Merged

fix: use recipe estimator for ingredient analysis (and test tool)#13715
stephanegigandet merged 7 commits into
mainfrom
recipe-estimator-testing

Conversation

@stephanegigandet

@stephanegigandet stephanegigandet commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

This PR:

  • enables calling recipe estimator when analyzing ingredients (instead of Product Opener legacy algorithm, which is kept if recipe estimator is not configured, or not responding)
  • adds CVXPY in the /cgi/test_ingredients_analysis.pl tool

Small fix for salt so that it also adds sodium as it's expected by recipe estimator

image

@stephanegigandet
stephanegigandet requested a review from a team as a code owner June 4, 2026 10:33
@github-actions github-actions Bot added API Issues related to the Open Food Facts API. More specific labels exist & should be used (API WRITE…) 🧴 Open Beauty Facts Our cosmetic analysis project https://world.openbeautyfacts.org 🐾 Open Pet Food Facts Our pet food analysis project https://world.openpetfoodfacts.org 📸 Open Products Facts Our project to increase the lifespan of objects. https://world.openproductsfacts.org 🥗🔍 Ingredients analysis https://wiki.openfoodfacts.org/Ingredients_Extraction_and_Analysis Template::Toolkit The templating toolkit used by product opener. The starting point for HTML/JS/CSS fixes. Tags config 🌐 Translations labels Jun 4, 2026
@github-project-automation github-project-automation Bot moved this to To discuss and validate in 🍊 Open Food Facts Server issues Jun 4, 2026
@github-project-automation github-project-automation Bot moved this to In progress in Ingredient analysis Jun 4, 2026
@codecov-commenter

codecov-commenter commented Jun 4, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 65.21739% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 54.83%. Comparing base (91517c2) to head (c58728f).
⚠️ Report is 2 commits behind head on main.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
lib/ProductOpener/Ingredients.pm 62.50% 4 Missing and 2 partials ⚠️
lib/ProductOpener/APIProductServices.pm 60.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #13715      +/-   ##
==========================================
+ Coverage   49.48%   54.83%   +5.35%     
==========================================
  Files          99      100       +1     
  Lines       25841    25904      +63     
  Branches     6173     6181       +8     
==========================================
+ Hits        12787    14205    +1418     
+ Misses      11392     9867    -1525     
- Partials     1662     1832     +170     
Flag Coverage Δ
integration-test-group-1 9.09% <4.34%> (?)
integration-test-group-2 9.25% <4.34%> (?)
integration-test-group-3 33.05% <56.52%> (?)
integration-test-group-4 28.69% <60.86%> (?)
integration-test-group-5 9.15% <4.34%> (?)
integration-test-group-6 9.69% <4.34%> (?)
integration-test-group-7 28.25% <56.52%> (?)
integration-test-group-8 26.49% <56.52%> (?)
integration-test-group-9 13.17% <4.34%> (?)
unit-test-group-1 24.13% <60.86%> (+0.13%) ⬆️
unit-test-group-2 34.84% <56.52%> (+0.10%) ⬆️
unit-test-group-3 23.49% <56.52%> (+0.13%) ⬆️
unit-test-group-4 29.89% <56.52%> (+0.11%) ⬆️
unit-test-group-5 17.23% <43.47%> (+0.02%) ⬆️
unit-test-group-6 27.28% <56.52%> (+0.10%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-project-automation github-project-automation Bot moved this from In progress to Reviewer approved in 🧴 Open Beauty Facts Jun 4, 2026
@github-project-automation github-project-automation Bot moved this from To discuss and validate to Done in 🍊 Open Food Facts Server issues Jun 4, 2026
@github-project-automation github-project-automation Bot moved this from In progress to Reviewer approved in 🛠️ - Server - API Jun 4, 2026
@github-project-automation github-project-automation Bot moved this from In progress to Reviewer approved in 📸 Open Products Facts Jun 4, 2026
@github-project-automation github-project-automation Bot moved this from In progress to Reviewer approved in Ingredient analysis Jun 4, 2026
@github-project-automation github-project-automation Bot moved this from In progress to Reviewer approved in 🐾 Open Pet Food Facts Jun 4, 2026
@stephanegigandet stephanegigandet changed the title fix: update test_ingredients_analysis.pl for recipe estimator testing fix: use recipe estimator for ingredient analysis (and test tool) Jun 4, 2026
@stephanegigandet

Copy link
Copy Markdown
Contributor Author

/update_tests_results

@stephanegigandet

Copy link
Copy Markdown
Contributor Author

/update_tests_results

Open Food Facts Bot and others added 2 commits June 5, 2026 10:25
@sonarqubecloud

sonarqubecloud Bot commented Jun 5, 2026

Copy link
Copy Markdown

@stephanegigandet
stephanegigandet merged commit 1768b7d into main Jun 5, 2026
41 checks passed
@stephanegigandet
stephanegigandet deleted the recipe-estimator-testing branch June 5, 2026 12:58
@github-project-automation github-project-automation Bot moved this from Reviewer approved to Done in 🐾 Open Pet Food Facts Jun 5, 2026
@github-project-automation github-project-automation Bot moved this from Reviewer approved to Done in 📸 Open Products Facts Jun 5, 2026
@github-project-automation github-project-automation Bot moved this from Reviewer approved to Done in Ingredient analysis Jun 5, 2026
@github-project-automation github-project-automation Bot moved this from Reviewer approved to Done in 🧴 Open Beauty Facts Jun 5, 2026
@github-project-automation github-project-automation Bot moved this from Reviewer approved to Done in 🛠️ - Server - API Jun 5, 2026
stephanegigandet pushed a commit that referenced this pull request Jun 8, 2026
🤖 I have created a release *beep* *boop*
---


##
[2.94.0](v2.93.1...v2.94.0)
(2026-06-08)


### Features

* FDC import script
([#13320](#13320))
([264c146](264c146))


### Bug Fixes

* add U+25CF (●) to ingredient separators for Japanese labels
([#13691](#13691))
([ed740f6](ed740f6))
* backward compatibility for API ask for refactored tags fields
([#13689](#13689))
([345779e](345779e))
* Issues found during STO to JSON migration
([#13714](#13714))
([ccfee79](ccfee79))
* nginx priority map
([#13723](#13723))
([4068a1e](4068a1e))
* reset to-be-exported on pro platform
([#13703](#13703))
([ac8cc84](ac8cc84))
* use recipe estimator for ingredient analysis (and test tool)
([#13715](#13715))
([1768b7d](1768b7d))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

API Issues related to the Open Food Facts API. More specific labels exist & should be used (API WRITE…) config 🥗🔍 Ingredients analysis https://wiki.openfoodfacts.org/Ingredients_Extraction_and_Analysis 🧴 Open Beauty Facts Our cosmetic analysis project https://world.openbeautyfacts.org 🐾 Open Pet Food Facts Our pet food analysis project https://world.openpetfoodfacts.org 📸 Open Products Facts Our project to increase the lifespan of objects. https://world.openproductsfacts.org Tags Template::Toolkit The templating toolkit used by product opener. The starting point for HTML/JS/CSS fixes. 🧪 tests 🌐 Translations

Development

Successfully merging this pull request may close these issues.

4 participants