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

refactor: new load_data() function to be used in startup_apache2.pl and batch scripts #7679

Merged
merged 6 commits into from
Nov 9, 2022

Conversation

stephanegigandet
Copy link
Contributor

  • create a new LoadData.pm module, with a load_data() function that loads packaging codes data, Agribalyse, Eco-Score etc.
    This is to remove duplicate code in startup_apache2.pl, minion_producers.pl and import_csv_file.pm, and also to remove the INIT block in PackagersCodes.pm which printed a warning "too late for INIT block" when starting Apache
  • Load all modules in startup_apache2.pl (we were missing a few new ones)
  • use "use Module" instead of "require Module"
  • remove warning "remove warning - sort (...) interpreted as function" in GS1.pm
  • removed some tests scripts for minion (we only use minion_producers.pl):

minion-off-pro.service:ExecStart=/srv/off-pro/scripts/minion_producers.pl minion worker -m production -q pro.openfoodfacts.org
minion-off.service:ExecStart=/srv/off/scripts/minion_producers.pl minion worker -m production -q openfoodfacts.org

@stephanegigandet stephanegigandet requested a review from a team as a code owner November 9, 2022 11:44
@github-actions github-actions bot added 🪶 Apache We use Apache as a server to run Open Food Facts Data import export GS1 The producer platform is integrating with the GS1 product data formats. GS1 manages barcodes. 🖼️ Images 📍🏭 Packager codes https://blog.openfoodfacts.org/en/news/discover-what-food-products-are-made-near-you-with-made-near- 🏭 Producers Platform https://wiki.openfoodfacts.org/Platform_for_producers Products 🧪 tests update all products Minion labels Nov 9, 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.

Cool move.

Only point:

  • you pushed an empty tests/update_tests_results.sh file !
  • you have to run make lint_perltidy

@stephanegigandet
Copy link
Contributor Author

  • you pushed an empty tests/update_tests_results.sh file !

the GitHub diff is misleading, in fact it's a chmod change from 644 to 755. I don't know why but I seem to have changed it in the previous merge.

+x is missing on update_all_products.pl as well, I'll add it back

@sonarqubecloud
Copy link

sonarqubecloud bot commented Nov 9, 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
No Duplication information No Duplication information

@stephanegigandet stephanegigandet merged commit 8dafcf6 into main Nov 9, 2022
@stephanegigandet stephanegigandet deleted the load-data branch November 9, 2022 17:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🪶 Apache We use Apache as a server to run Open Food Facts Data import export GS1 The producer platform is integrating with the GS1 product data formats. GS1 manages barcodes. 🖼️ Images Minion 📍🏭 Packager codes https://blog.openfoodfacts.org/en/news/discover-what-food-products-are-made-near-you-with-made-near- 🏭 Producers Platform https://wiki.openfoodfacts.org/Platform_for_producers Products 🧪 tests update all products
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants