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: Improvements to GS1 imports to prepare integration of Agena3000 #6566

Merged
merged 25 commits into from
Apr 8, 2022

Conversation

stephanegigandet
Copy link
Contributor

This PR includes:

  • changes to use the Perl XML::XML2JSON module instead of nodejs xml2json module, in order to remove the dependency on nodejs (as suggested by @alexgarel )
  • support for GS1 messages that contain nested products (a pallet that contains cartons that contain the actual products sold to consumers)
  • updated expected test results: as we might have more than 1 product in a GS1 message, each test now returns an array of product data
  • new test cases with sample data from Agena3000 in XML converted by the Perl XML::XML2JSON module

@stephanegigandet stephanegigandet requested a review from a team as a code owner April 6, 2022 15:27
@github-actions github-actions bot added GS1 The producer platform is integrating with the GS1 product data formats. GS1 manages barcodes. 📦 Packaging https://wiki.openfoodfacts.org/Category:Recycling 🏭 Producers Platform https://wiki.openfoodfacts.org/Platform_for_producers 🧬 Taxonomies https://wiki.openfoodfacts.org/Global_taxonomies 🧪 tests labels Apr 6, 2022
@stephanegigandet stephanegigandet changed the title Improvements to GS1 imports to prepare integration of Agena3000 feat: Improvements to GS1 imports to prepare integration of Agena3000 Apr 7, 2022
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

kudos

scripts/convert_gs1_xml_to_json_in_dir.js Outdated Show resolved Hide resolved
lib/ProductOpener/GS1.pm Outdated Show resolved Hide resolved
lib/ProductOpener/GS1.pm Outdated Show resolved Hide resolved
scripts/convert_gs1_xml_to_json_in_dir.pl Show resolved Hide resolved
@@ -12,11 +12,10 @@ find /home/sftp/equadis/data/ -mtime -2 -type f -exec cp {} /srv2/off-pro/equadi

export NPM_CONFIG_PREFIX=~/.npm-global

node equadis-xml2json.js
node /srv/off-pro/scripts/convert_gs1_xml_to_json_in_dir.js /srv2/off-pro/equadis-data-tmp/
Copy link
Member

Choose a reason for hiding this comment

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

why not use the new .pl here ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I want to test it out more thoroughly first, to check that we end up with the exact same results once the products are imported into OFF.

@sonarcloud
Copy link

sonarcloud bot commented Apr 7, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@sonarcloud
Copy link

sonarcloud bot commented Apr 7, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GS1 The producer platform is integrating with the GS1 product data formats. GS1 manages barcodes. 📦 Packaging https://wiki.openfoodfacts.org/Category:Recycling 🏭 Producers Platform https://wiki.openfoodfacts.org/Platform_for_producers 🧬 Taxonomies https://wiki.openfoodfacts.org/Global_taxonomies 🧪 tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants