[CDAP-21074] remove calls to list apps api during pipeline deployment #1249
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.
remove calls to list apps api during pipeline deployment
Description
The list apps (
GET /apps
) call is made before deploying a pipeline to ensure that a pipeline of the same name does not already exist. This check is necessary, because the deployment path in the backend (PUT /apps/{app-id}
) creates a new version of the application when an existing pipelineName / appId is given.In the UI, we do not want to call the deploy method before ensuring that the pipeline name does not already exist, in the case where the intent of the user is to create a new pipeline. (If the intent of the user is to edit and create a new version, we do not perform this check, nor call the list apps API).
However, this is not an efficient method of checking the existence of the pipeline name, as in case of instances with large number of pipelines the network overhead and the load on the backend service are high. A better way to check if a pipeline name is available, is to use the
GET /apps/{app-id}
API. This would return a 404 response if the name is available.Solution
Use the
GET /apps/{app-id}
API to ensure that the pipeline name is available.PR Type
Links
Jira: CDAP-21074
Test Plan
Existing e2e-tests must pass
Screenshots
NA