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

feat: Eco-Score improvements and change of scale: A+ to F #10829

Merged
merged 14 commits into from
Oct 21, 2024

Conversation

stephanegigandet
Copy link
Contributor

The Eco-Score has an improved formula:
https://docs.score-environnemental.com/more/changelog#id-19-septembre-2024

There are 2 small changes:

  • Previously products that had a non recycled and non non recyclable packaging were capped to Eco-Score B at best. This cap has been removed.
  • The country enviromental product index bonus/malus is now only applied if there isn't already a bonus for the production system.

And there is a bigger more visible change:

  • the scale is now from A+ to F, instead of A to E, in order to better differentiate products (to avoid having most of the products of the same category have the same Eco-Score).

Note: this is a draft. In particular, the images for the new A+ and F grades are for testing purposes only.

To ease testing of mobile apps etc. this PR has been deployed to the world.openfoodfacts.dev server (login and password: off)

@stephanegigandet stephanegigandet requested a review from a team as a code owner September 26, 2024 10:12
@stephanegigandet stephanegigandet marked this pull request as draft September 26, 2024 10:13
@github-actions github-actions bot added 🧪 tests 🌱 Green-Score https://world.openfoodfacts.org/eco-score-the-environmental-impact-of-food-products Display Attributes https://wiki.openfoodfacts.org/Product_Attributes 🌐 Translations labels Sep 26, 2024
@teolemon teolemon added 🤳🥫 blocking mobile apps This issues are blocking a feature on the Open Food Facts mobile apps 🤳🥫 requires mobile changes labels Sep 26, 2024
@teolemon
Copy link
Member

image
image
I have strange behaviors in the application, it must be said that we now manage the multi-project. We make a request off then obf, opf and opff, and we stop when the product is found. is that right @monsieurtanuki ?
Are you managing to get openfoodfacts.dev to work for you ? cc @stephanegigandet @g123k

@monsieurtanuki
Copy link
Contributor

I have strange behaviors in the application, it must be said that we now manage the multi-project. We make a request off then obf, opf and opff, and we stop when the product is found. is that right @monsieurtanuki ?

@teolemon Indeed this is the correct order: food, beauty, pet food, product.

I've just managed to reproduce your screenshots:

  • I was happy working on prod with food
  • then I switched to dev
  • then I refreshed a (food/prod) product

The problem seems to be that the product was not found on food/dev. Then of course we're looking for it on beauty/dev, which can be problematic if the beauty/dev server is down or doesn't even exist.

@monsieurtanuki
Copy link
Contributor

The problem seems to be that the product was not found on food/dev. Then of course we're looking for it on beauty/dev, which can be problematic if the beauty/dev server is down or doesn't even exist.

@teolemon That said, a behavior may have to be fixed: if we know for a fact that a product has a given product type (e.g. food), we should check only for this product type and ignore the other ones. Do you want me to implement that behavior?
That said, it would remotely solve your issue, as the product is still not there in food/dev, not very convenient to check ecoscores.

@teolemon
Copy link
Member

Screenshot_20240926-203905.png

@stephanegigandet
Copy link
Contributor Author

@monsieurtanuki @g123k Search queries also return an error message on the mobile app when using .dev, even though they seem to be successfull on the server:

[27/Sep/2024:09:52:17 +0000] "POST /cgi/search.pl HTTP/1.0" 200 1431620 "-" "- Smoothie - OpenFoodFacts - 4.15.0+1345 - android+UP1A.231005.007.S911BXXS6CXGA - https://world.openfoodfacts.org/ - - Smoothie - OpenFoodFacts - 4.15.0+1345 - android+UP1A.231005.007.S911BXXS6CXGA - 6da31523-985c-4bf3-9d23-a58a9d014bf8"

@monsieurtanuki
Copy link
Contributor

@stephanegigandet Sure of that? I've just tested on dev for OxF, with my local version and food@dev is OK.
Can you be more specific about the dev query that doesn't work?

food beauty
Screenshot_1727431509 Screenshot_1727431569
food beauty
Screenshot_1727431619 Screenshot_1727431595

@monsieurtanuki
Copy link
Contributor

@stephanegigandet I've also tried with real food on food@dev: couldn't find nutella in France, but in the world:
Screenshot_1727431951

@github-actions github-actions bot added the 💥 Merge Conflicts 💥 Merge Conflicts label Oct 8, 2024
@teolemon
Copy link
Member

po/tags/tags.pot:669: duplicate message definition...
po/tags/tags.pot:660: ...this is the location of the first definition
po/tags/tags.pot:674: duplicate message definition...
po/tags/tags.pot:665: ...this is the location of the first definition
msgfmt: found 2 fatal errors
→ po/tags/tags.pot...contains errors!
po/tags/tags.pot:669: duplicate message definition...
po/tags/tags.pot:660: ...this is the location of the first definition
po/tags/tags.pot:674: duplicate message definition...
po/tags/tags.pot:665: ...this is the location of the first definition
msggrep: found 2 fatal errors

@teolemon
Copy link
Member

po/common/common.pot:7017: duplicate message definition...
po/common/common.pot:68: ...this is the location of the first definition
po/common/common.pot:7021: duplicate message definition...
po/common/common.pot:72: ...this is the location of the first definition
po/common/common.pot:7025: duplicate message definition...
po/common/common.pot:76: ...this is the location of the first definition
po/common/common.pot:7029: duplicate message definition...
po/common/common.pot:80: ...this is the location of the first definition
po/common/common.pot:7033: duplicate message definition...
po/common/common.pot:84: ...this is the location of the first definition
po/common/common.pot:7037: duplicate message definition...
po/common/common.pot:88: ...this is the location of the first definition
po/common/common.pot:7041: duplicate message definition...
po/common/common.pot:6926: ...this is the location of the first definition
po/common/common.pot:7065: duplicate message definition...
po/common/common.pot:6954: ...this is the location of the first definition
msgfmt: found 8 fatal errors
→ po/common/common.pot...contains errors!
po/common/common.pot:7017: duplicate message definition...
po/common/common.pot:68: ...this is the location of the first definition
po/common/common.pot:7021: duplicate message definition...
po/common/common.pot:72: ...this is the location of the first definition
po/common/common.pot:7025: duplicate message definition...
po/common/common.pot:76: ...this is the location of the first definition
po/common/common.pot:7029: duplicate message definition...
po/common/common.pot:80: ...this is the location of the first definition
po/common/common.pot:7033: duplicate message definition...
po/common/common.pot:84: ...this is the location of the first definition
po/common/common.pot:7037: duplicate message definition...
po/common/common.pot:88: ...this is the location of the first definition
po/common/common.pot:7041: duplicate message definition...
po/common/common.pot:6926: ...this is the location of the first definition
po/common/common.pot:7065: duplicate message definition...
po/common/common.pot:6954: ...this is the location of the first definition
msggrep: found 8 fatal errors

msgctxt "attribute_ecoscore_grade_title"
msgid "Eco-Score %s"
msgstr "Eco-Score %s"

msgctxt "attribute_ecoscore_a_plus_description_short"
msgid "Very low environmental impact"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GetText will complain about duplicate ids like, and Crowdin will get confused and cross contaminate between the 2 strings

Copy link
Member

@alexgarel alexgarel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@github-actions github-actions bot added the 💥 Merge Conflicts 💥 Merge Conflicts label Oct 17, 2024
Copy link

@stephanegigandet stephanegigandet marked this pull request as ready for review October 21, 2024 13:00
@github-actions github-actions bot removed the 💥 Merge Conflicts 💥 Merge Conflicts label Oct 21, 2024
@stephanegigandet stephanegigandet changed the title feat: Eco-Score improvements and change of scale: A+ to F - DRAFT feat: Eco-Score improvements and change of scale: A+ to F Oct 21, 2024
@stephanegigandet stephanegigandet merged commit 87df665 into main Oct 21, 2024
14 checks passed
@stephanegigandet stephanegigandet deleted the ecoscore-sept-2024 branch October 21, 2024 13:00
stephanegigandet pushed a commit that referenced this pull request Oct 24, 2024
🤖 I have created a release *beep* *boop*
---


##
[2.47.0](v2.46.0...v2.47.0)
(2024-10-24)


### Features

* api docs remove query string from get by barcode and add security to
solve openapi linter errors/warnings
([#10922](#10922))
([b7aefbd](b7aefbd))
* Eco-Score improvements and change of scale: A+ to F
([#10829](#10829))
([87df665](87df665))


### Bug Fixes

* add googleOther bot
([#10912](#10912))
([d56760a](d56760a))
* allow CORS requests for product image move
([#10920](#10920))
([967a47e](967a47e))
* attribute for product without new nutriscore data
([#10915](#10915))
([c413719](c413719))
* cosmetic changes for new Eco-Score grades
([#10921](#10921))
([6e7dbfa](6e7dbfa))
* Revert "fix: remove unused jquery-ui safe-active-element module
([#10708](#10708))"
([#10924](#10924))
([d290c54](d290c54))

---
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
Attributes https://wiki.openfoodfacts.org/Product_Attributes 🤳🥫 blocking mobile apps This issues are blocking a feature on the Open Food Facts mobile apps Display 🌱 Green-Score https://world.openfoodfacts.org/eco-score-the-environmental-impact-of-food-products 🤳🥫 requires mobile changes 🧪 tests 🌐 Translations
Development

Successfully merging this pull request may close these issues.

4 participants