openfoodfacts / openfoodfacts-server

Open Food Facts database, API server and web interface - 🐪🦋 Perl, CSS and JS coders welcome 😊 For helping in Python, see Robotoff or taxonomy-editor
http://openfoodfacts.github.io/openfoodfacts-server/
GNU Affero General Public License v3.0
644 stars 374 forks source link

Bugs in the build process #3124

Open teolemon opened 4 years ago

teolemon commented 4 years ago

Many warnings like this in the build process. Is it normal ? Is it something we can optimize ?

A timestamped file does not exist. Falling back to process start time, in case we are running in different Docker containers. {fallback => 1585249839,path => "/home/runner/work/openfoodfacts-server/openfoodfacts-server/html/css/dist/app.css",source => "CSS file generated by the 'npm run build' command"}
A timestamped file does not exist. Falling back to process start time, in case we are running in different Docker containers. {fallback => 1585249839,path => "/home/runner/work/openfoodfacts-server/openfoodfacts-server/html/css/dist/product-multilingual.css",source => "CSS file generated by the 'npm run build' command"}
A timestamped file does not exist. Falling back to process start time, in case we are running in different Docker containers. {fallback => 1585249839,path => "/home/runner/work/openfoodfacts-server/openfoodfacts-server/html/js/dist/product-multilingual.js",source => "JS file generated by the 'npm run build' command"}
A timestamped file does not exist. Falling back to process start time, in case we are running in different Docker containers. {fallback => 1585249841,path => "/home/runner/work/openfoodfacts-server/openfoodfacts-server/html/css/dist/app.css",source => "CSS file generated by the 'npm run build' command"}

A timestamped file does not exist. Falling back to process start time, in case we are running in different Docker containers. {fallback => 1585249841,path => "/home/runner/work/openfoodfacts-server/openfoodfacts-server/html/css/dist/product-multilingual.css",source => "CSS file generated by the 'npm run build' command"}
A timestamped file does not exist. Falling back to process start time, in case we are running in different Docker containers. {fallback => 1585249841,path => "/home/runner/work/openfoodfacts-server/openfoodfacts-server/html/js/dist/product-multilingual.js",source => "JS file generated by the 'npm run build' command"}

A timestamped file does not exist. Falling back to process start time, in case we are running in different Docker containers. {fallback => 1585249847,path => "/home/runner/work/openfoodfacts-server/openfoodfacts-server/html/css/dist/app.css",source => "CSS file generated by the 'npm run build' command"}
A timestamped file does not exist. Falling back to process start time, in case we are running in different Docker containers. {fallback => 1585249847,path => "/home/runner/work/openfoodfacts-server/openfoodfacts-server/html/css/dist/product-multilingual.css",source => "CSS file generated by the 'npm run build' command"}
A timestamped file does not exist. Falling back to process start time, in case we are running in different Docker containers. {fallback => 1585249847,path => "/home/runner/work/openfoodfacts-server/openfoodfacts-server/html/js/dist/product-multilingual.js",source => "JS file generated by the 'npm run build' command"}

Part of

hangy commented 4 years ago

Yes, we should do something about that. The problem is that this code without a code block is apparently always called when ProductOpener::Display is imported. Therefore it's probably better to move it into a sub which gets called in startup_apache2.pl.

Since we now have more files that are generated/minified by gulp, and then put into the dist directories, there could also be an advantage in simply iterating through all files in there recursively, than listing them in Display.pm. If the directory does not exist (Docker scenario with nginx front end proxy in a different container), use the current time for all files.

There's an additional opportunity for optimization in here. We have over 60 references to /css/dist/ and /js/dist/ files in here, which are don't use the timestamp right now, since we didn't list them in %file_timestamps manually.

stephanegigandet commented 4 years ago

Re-opening as the symptom was fixed, but not the resolution suggested by @hangy

github-actions[bot] commented 4 years ago

Stale issue message

github-actions[bot] commented 7 months ago

This issue has been open 90 days with no activity. Can you give it a little love by linking it to a parent issue, adding relevant labels and projets, creating a mockup if applicable, adding code pointers from https://github.com/openfoodfacts/openfoodfacts-server/blob/main/.github/labeler.yml, giving it a priority, editing the original issue to have a more comprehensive description… Thank you very much for your contribution to 🍊 Open Food Facts