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: Use 'GS1 Barcode Syntax Engine' in READ API v3 #9050

Merged
merged 23 commits into from
Sep 22, 2023

Conversation

hangy
Copy link
Member

@hangy hangy commented Sep 21, 2023

What

Use Perl module GS1::SyntaxEngine::FFI in READ API. This allows GS1 Data URI, AI Data String, and so on to be used in the URL.

Related issue(s) and discussion

- Remove redundant `$`
- Fix scope of `$ai_data_str`
- Some regexes
- Ensure that more GS1 Data Link URI formats can be 'normalized'
- URIs that cannot be a GS1 Data Link should not be treated as an
  product code
Should possibly have a feature flag, depending on the API version
…rom the code to allow query params in GS1 data URI to be present
…nd `decodeURIComponent`, so that a '/' in the code isn't split.
The dummy number used before does not have a valid checksum.
@hangy hangy self-assigned this Sep 21, 2023
@github-actions github-actions bot added API Issues related to the Open Food Facts API. More specific labels exist & should be used (API WRITE…) API READ All READ APIs include Product, Search… 🖼️ Images 🧪 tests 📖 Knowledge Panels https://wiki.openfoodfacts.org/Knowledge_panels Products 🧪 unit tests labels Sep 21, 2023
@hangy hangy added the GS1 The producer platform is integrating with the GS1 product data formats. GS1 manages barcodes. label Sep 21, 2023
@hangy hangy marked this pull request as ready for review September 21, 2023 14:51
@hangy hangy requested a review from a team as a code owner September 21, 2023 14:51
@github-actions github-actions bot added the 💥 Merge Conflicts 💥 Merge Conflicts label Sep 21, 2023
Copy link
Contributor

@stephanegigandet stephanegigandet left a comment

Choose a reason for hiding this comment

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

Looks good, but since I merged in #9049 there's a slight merge conflict.

@hangy
Copy link
Member Author

hangy commented Sep 21, 2023

Looks good, but since I merged in #9049 there's a slight merge conflict.

Thanks! Sorry about the conflict. I fixed it locally and pushed an update.

@sonarqubecloud
Copy link

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
No Duplication information No Duplication information

@codecov-commenter
Copy link

Codecov Report

Merging #9050 (8696c02) into main (77d296f) will increase coverage by 0.04%.
The diff coverage is 76.19%.

@@            Coverage Diff             @@
##             main    #9050      +/-   ##
==========================================
+ Coverage   46.31%   46.36%   +0.04%     
==========================================
  Files          64       64              
  Lines       19916    19924       +8     
  Branches     4814     4815       +1     
==========================================
+ Hits         9225     9238      +13     
+ Misses       9523     9520       -3     
+ Partials     1168     1166       -2     
Files Changed Coverage Δ
lib/ProductOpener/API.pm 16.81% <0.00%> (ø)
lib/ProductOpener/APIProductRead.pm 25.92% <0.00%> (ø)
lib/ProductOpener/APIProductWrite.pm 12.59% <0.00%> (ø)
lib/ProductOpener/Routing.pm 33.67% <80.00%> (+2.90%) ⬆️
lib/ProductOpener/Products.pm 48.33% <100.00%> (+0.27%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API READ All READ APIs include Product, Search… API v3 API Issues related to the Open Food Facts API. More specific labels exist & should be used (API WRITE…) GS1 The producer platform is integrating with the GS1 product data formats. GS1 manages barcodes. 🧪 integration tests 📖 Knowledge Panels https://wiki.openfoodfacts.org/Knowledge_panels 💥 Merge Conflicts 💥 Merge Conflicts Products 🧪 tests 🧪 unit tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow GS1 barcode types to be used in READ API
3 participants