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: new import_images.pl script for pro platform #11225

Merged
merged 7 commits into from
Jan 22, 2025
Merged

Conversation

stephanegigandet
Copy link
Contributor

The import of images in the pro platform is currently tied to the import of product data: we import images only of they come with product data.

Some producers can send us product photos in bulk, without sending product data at the same time.

The new image_import.pl script is to load those photos. The script essentially uses existing code from Import.pm (which has been moved a bit in separate functions).

@codecov-commenter
Copy link

codecov-commenter commented Jan 10, 2025

Codecov Report

Attention: Patch coverage is 55.00000% with 27 lines in your changes missing coverage. Please review.

Project coverage is 49.33%. Comparing base (a35d15a) to head (6886a79).
Report is 28 commits behind head on main.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
lib/ProductOpener/Import.pm 55.17% 16 Missing and 10 partials ⚠️
lib/ProductOpener/Products.pm 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #11225      +/-   ##
==========================================
+ Coverage   49.22%   49.33%   +0.11%     
==========================================
  Files          78       79       +1     
  Lines       22405    22506     +101     
  Branches     5374     5386      +12     
==========================================
+ Hits        11028    11104      +76     
- Misses      10020    10042      +22     
- Partials     1357     1360       +3     

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

Co-authored-by: Pierre Slamich <pierre@openfoodfacts.org>
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.

Thanks.

Comment on lines +2791 to +2794
upload_images_for_product(
$args_ref, $images_ref->{$code}, $product_ref, $imported_product_ref, $product_id,
$code, $user_id, $product_comment, $stats_ref
);
Copy link
Member

Choose a reason for hiding this comment

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

That's so cool :-)

lib/ProductOpener/Import.pm Show resolved Hide resolved
lib/ProductOpener/Import.pm Show resolved Hide resolved
lib/ProductOpener/Import.pm Outdated Show resolved Hide resolved
stephanegigandet and others added 3 commits January 22, 2025 11:36
Co-authored-by: Alex Garel <alex@openfoodfacts.org>
Co-authored-by: Alex Garel <alex@openfoodfacts.org>
Co-authored-by: Alex Garel <alex@openfoodfacts.org>
@stephanegigandet stephanegigandet enabled auto-merge (squash) January 22, 2025 10:37
@stephanegigandet stephanegigandet merged commit a46c967 into main Jan 22, 2025
16 checks passed
@stephanegigandet stephanegigandet deleted the import_images branch January 22, 2025 11:12
stephanegigandet pushed a commit that referenced this pull request Jan 22, 2025
🤖 I have created a release *beep* *boop*
---


##
[2.56.0](v2.55.0...v2.56.0)
(2025-01-22)


### Features

* add common categories found on re-commerce websites
([#11263](#11263))
([8f54f80](8f54f80))
* Add common cosmetic allegations
([#11264](#11264))
([94de6d0](94de6d0))
* add link on pro platform to see nutriscore evolution
[#11246](#11246)
([#11247](#11247))
([c0518c1](c0518c1))
* new import_images.pl script for pro platform
([#11225](#11225))
([a46c967](a46c967))
* Update the tagline to force the app upgrade
([#11262](#11262))
([f685cb0](f685cb0))


### Bug Fixes

* Add more german stopwords
([#11266](#11266))
([4e45a34](4e45a34))
* link of nutri-score knowledge panel on pro platform
([#11272](#11272))
([75a873b](75a873b))

---
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
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants