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: enable attributes / personal search on OBF, OPF, OPFF, new config + logos for OPF & OPFF #10757

Merged
merged 55 commits into from
Sep 18, 2024

Conversation

stephanegigandet
Copy link
Contributor

  • Some changes to enable knowledge panels on OBF, OPF and OPFF
  • new conf files for new deployments of OPF and OPFF
  • new logos for OPF and OPFF

Test deployments (with the production databases):

https://world.new.openproductsfacts.org
https://world.new.openpetfoodfacts.org

@stephanegigandet stephanegigandet requested a review from a team as a code owner August 30, 2024 17:11
@github-actions github-actions bot added 🧬 Taxonomies https://wiki.openfoodfacts.org/Global_taxonomies 🧴 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 NGINX Display Products Tags config 🌐 Translations labels Aug 30, 2024
@github-actions github-actions bot added the 💥 Merge Conflicts 💥 Merge Conflicts label Sep 17, 2024
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.

Great, only minor comments !

include snippets/ssl-params.conf;

# Product Opener needs a root domain + a wildcard for all subdomains
server_name *.new.openproductsfacts.org openproductsfacts.org *.openproductsfacts.org;
Copy link
Member

Choose a reason for hiding this comment

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

we may remove the .new now :-)

log4perl.PatternLayout.cspec.J = sub { my $context = Log::Log4perl::MDC->get_context; use JSON::MaybeXS; my $json_utf8 = JSON::MaybeXS->new->utf8(1)->allow_nonref->canonical; my $str = $json_utf8->encode($context); return $str; }

log4perl.appender.LOGFILE=Log::Log4perl::Appender::File
log4perl.appender.LOGFILE.filename=/srv/opf/logs/log4perl.log
Copy link
Member

Choose a reason for hiding this comment

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

for the future: if we could read the conf, and change filename afterward in perl code (in startup_apache2.pl) it would be great to avoid so much duplication just for filepath changing !

Copy link
Member

Choose a reason for hiding this comment

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

do we really need to put this ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

well that way we remember how we created them if we need to recreate them

lib/ProductOpener/KnowledgePanels.pm Outdated Show resolved Hide resolved
if (defined $server) {
$product_ref->{server} = $server;

# If the product is on another server, set the server field so that it will be saved in the other server if we save it
Copy link
Member

Choose a reason for hiding this comment

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

Move this comment below ?

Copy link
Member

Choose a reason for hiding this comment

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

how is it handled

"text_element": {
"type": "summary",
"html": `
<p>[% edq(f_lang('f_equal_to_driving_km_in_a_petrol_car', { 'kilometers' => driving_per_unit_rounded } )) %]</p>
Copy link
Member

Choose a reason for hiding this comment

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

You can use a back quote ` in json ?
In this case we should have a ebq function (escape back quote).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@alexgarel it's not in normal JSON, it's to ease the creation of JSON for knowledge panels. It also handles the escaping of quotes that may be inside.

See https://github.com/openfoodfacts/openfoodfacts-server/blob/main/lib/ProductOpener/KnowledgePanels.pm#L374

Copy link

sonarcloud bot commented Sep 18, 2024

@teolemon
Copy link
Member

Given how large it is, we should tweak the wording of the donation message
image

@teolemon
Copy link
Member

We should not link to https://world.pro.openproductsfacts.org/ which gives a HTTPS error.

@stephanegigandet
Copy link
Contributor Author

@teolemon as this is in production already, I will go ahead and merge the PR, and I'll address the issues you raised in new PRs.

@stephanegigandet stephanegigandet merged commit 7e25d9a into main Sep 18, 2024
13 checks passed
@stephanegigandet stephanegigandet deleted the obf-attributes branch September 18, 2024 16:06
stephanegigandet pushed a commit that referenced this pull request Oct 2, 2024
🤖 I have created a release *beep* *boop*
---


##
[2.45.0](v2.44.0...v2.45.0)
(2024-10-02)


### Features

* Add short name, value and evaluation to knowledge panels
([#9683](#9683))
([bb5c3e2](bb5c3e2))
* enable attributes / personal search on OBF, OPF, OPFF, new config +
logos for OPF & OPFF
([#10757](#10757))
([7e25d9a](7e25d9a))
* make improvements to org table
([#10679](#10679))
([b0cfea1](b0cfea1))
* Small fixes + improvements
([#10818](#10818))
([bd91419](bd91419))


### Bug Fixes

* add Moji server IP to rate-limit allow-list
([#10785](#10785))
([065e0ab](065e0ab))
* add more nutrients to test, to test more things
([#10834](#10834))
([42b341d](42b341d))
* also check .pot GetText files in addition to .po files
([#10827](#10827))
([bb87197](bb87197))
* Determine obsolete and deleted from the product revision
([#10791](#10791))
([508d767](508d767))
* do not localize ecoscore on obf,opf,opff
([#10837](#10837))
([2f93877](2f93877))
* docs Adding closing ) to generate proper internal link
([#10850](#10850))
([492d6d9](492d6d9))
* docs Fixed proper denomination of product in query
([#10853](#10853))
([428dbb3](428dbb3))
* improve OCR JSON generation script
([#10802](#10802))
([3e8fee7](3e8fee7))
* incorrect self-reference in ingredient.yaml
([#10786](#10786))
([2757699](2757699))
* indicate some attributes have only mandatory / not_important options
([#10846](#10846))
([258dc8f](258dc8f))
* invalid type in product_misc.yaml
([#10787](#10787))
([21920a1](21920a1))
* new mongodb exports for obsolete products collection
([#10794](#10794))
([c22fc42](c22fc42))
* permissions for check-translations.sh
([#10838](#10838))
([62e12d6](62e12d6))
* YAML syntax in schema files.
([#10783](#10783))
([959c74c](959c74c))

---
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…) Attributes https://wiki.openfoodfacts.org/Product_Attributes config Display 🌱 Eco-Score https://world.openfoodfacts.org/eco-score-the-environmental-impact-of-food-products 🧪 integration tests 📖 Knowledge Panels https://wiki.openfoodfacts.org/Knowledge_panels 💥 Merge Conflicts 💥 Merge Conflicts NGINX 🧴 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 📦 Packaging https://wiki.openfoodfacts.org/Category:Recycling Product Page Products Site layout Tags 🧬 Taxonomies https://wiki.openfoodfacts.org/Global_taxonomies Template::Toolkit The templating toolkit used by product opener. The starting point for HTML/JS/CSS fixes. 🧪 tests 🌐 Translations 🧪 unit tests update all products
Projects
Status: Done
Status: Done
Status: Done
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants