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' to normalize product codes #9049

Merged
merged 10 commits into from
Sep 21, 2023

Conversation

hangy
Copy link
Member

@hangy hangy commented Sep 21, 2023

What

Use Perl module GS1::SyntaxEngine::FFI to normalize barcodes. This allows more GS1 strings to be used with search.

Related issue(s) and discussion

@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 self-assigned this Sep 21, 2023
@hangy hangy changed the title feat: Use 'GS1 Barcode Syntax Engine' to normalize barcodes feat: Use 'GS1 Barcode Syntax Engine' to normalize product codes Sep 21, 2023
@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

@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
@stephanegigandet
Copy link
Contributor

on the prod server, I'm getting an error when I try to install the module with cpan:

t/90-encoder-exception.t .. Can't enable unknown feature try at t/90-encoder-exception.t line 12.
BEGIN failed--compilation aborted at t/90-encoder-exception.t line 12.
t/90-encoder-exception.t .. Dubious, test returned 255 (wstat 65280, 0xff00)
No subtests run 
t/99-multi-opts.t ......... ok   

Test Summary Report
-------------------
t/90-encoder-exception.t (Wstat: 65280 Tests: 0 Failed: 0)
  Non-zero exit status: 255
  Parse errors: No plan found in TAP output
Files=7, Tests=9,  2 wallclock secs ( 0.02 usr  0.01 sys +  1.63 cusr  0.18 csys =  1.84 CPU)
Result: FAIL
Failed 1/7 test programs. 0/9 subtests failed.
Makefile:880: recipe for target 'test_dynamic' failed
make: *** [test_dynamic] Error 255
  HANGY/GS1-SyntaxEngine-FFI-0.3.tar.gz
  /usr/bin/make test -- NOT OK
//hint// to see the cpan-testers results for installing this module, try:
  reports HANGY/GS1-SyntaxEngine-FFI-0.3.tar.gz
Failed during this command:
 HANGY/GS1-SyntaxEngine-FFI-0.3.tar.gz        : make_test NO

@hangy
Copy link
Member Author

hangy commented Sep 21, 2023

Can't enable unknown feature try at t/90-encoder-exception.t line 12.

Sounds like an old Perl version. The normal code doesn't use try - just the test: https://github.com/search?q=repo%3Ahangy%2Fstunning-goggles%20try&type=code So it should work, if you install with --no-test?

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.

Tested on the .dev server (on stretch), it works

https://world.openfoodfacts.dev/api/v3/product/(01)04044782317112(17)270101

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. 🖼️ Images 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 search
2 participants