Move CLI component cache build to occur before pre-processing #2913
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #2911
What changes were proposed in this pull request?
This PR moves the build of the component cache for relevant CLI tasks (
validate,exportandsubmit) to occur before pipeline pre-processing. Pipeline CLI tests have also been updated to catch this case in the future. Long-winded explanation below.Recall that
ComponentCacheinstances are either considered server processes (usually a running Elyra instance) or not (mostly CLI processes), and only in the former case is a cache built. For the pipeline CLI tasks ofvalidate,exportandsubmit, we passemulate_server_app=Trueto the creation/retrieval of the cache instance so that it builds and can reference the cache during pipeline validation.The issue referenced above was caused by the fact that, as of #2799, pipeline pre-processing (e.g. the creation of a
PipelineDefinitionobject) also creates/retrieves aComponentCacheinstance (and does not specify anything in regards toemulate_server_app). Because pre-processing previously occurred before_build_component_cachein the CLI app, theComponentCacheinstance was created during pre-process and did not appropriately setemulate_server_apptoTrue. This PR moves the build of the cache to occur before pre-processing, such that creation of theComponentCacheinstance is done "as a server process".Another issue is that this problem was not caught by the tests because the
component_cachefixture explicitly setsemulate_server_appto True duringComponentCacheinstance creation. To more accurately reflect how things flow during use of the CLI, I've created a new fixture that does not result in the creation of aComponentCacheinstance.How was this pull request tested?
Tested manually. Also ran the updated backend tests against current
mainto ensure that the expected tests fail onmain, but pass on this branch.Developer's Certificate of Origin 1.1