runtimes-common icon indicating copy to clipboard operation
runtimes-common copied to clipboard

Adds a flag 'skip_package_lock_generation' to FTL

Open belchatek opened this issue 6 years ago • 7 comments

Adds a flag 'skip_package_lock_generation' to control if FTL should generate package-lock file at the beginning of the run. Skiping this can improve build speed but can cause older version of dependencies to be used.

belchatek avatar Nov 30 '18 13:11 belchatek

@aaron-prindle Please review

belchatek avatar Nov 30 '18 13:11 belchatek

Generating package-lock file is quite time consuming process - it can take even 5-10 seconds. I want to have an option to avoid paying this cost to check if there is cached layer available.

belchatek avatar Dec 03 '18 22:12 belchatek

Nice, this change definitely makes sense.

it seems that this is failing a lint check that we have: ./ftl/node/layer_builder.py:54:80: E501 line too long (89 > 79 characters) If you can fix that error and re submit the PR tests should run.

Also can you add an integration test for the flag that you are adding? You will need to add the test to: https://github.com/GoogleCloudPlatform/runtimes-common/blob/master/ftl/integration_tests/ftl_node_integration_tests_yaml.py#L14

The flag to the test similar to as done here: https://github.com/GoogleCloudPlatform/runtimes-common/blob/master/ftl/integration_tests/ftl_node_integration_tests_yaml.py#L43

And add a directory for the app to be tested, similar to here: https://github.com/GoogleCloudPlatform/runtimes-common/tree/master/ftl/node/testdata/packages_test

And you should create a structure_test.yaml that verifies that a package.lock file is not created: https://github.com/GoogleCloudPlatform/runtimes-common/blob/master/ftl/node/testdata/packages_test/structure_test.yaml

aaron-prindle avatar Dec 03 '18 22:12 aaron-prindle

There is a problem with adding an integration test for this flag. Even if I set it package-lock.json will be created in build phase.

belchatek avatar Dec 04 '18 16:12 belchatek

I dont understand what is broken in kokoro run

belchatek avatar Dec 04 '18 19:12 belchatek

The kokoro issue here is related to our kokoro pipeline recently upgrading the version of bazel that it uses and the files in runtimes-common not being compatible with this new version. We are working on a fix currently, I will update this PR as kokoro is fixed.

aaron-prindle avatar Dec 10 '18 21:12 aaron-prindle

@belchatek friendly ping. The CI issues you were experiencing are resolved now, resubmit and kokoro should have sane logs for the FTL tests

aaron-prindle avatar Dec 12 '18 01:12 aaron-prindle