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

Update of CM pipeline settings doesn't validate branch/tag existence #492

Open
jwadolowski opened this issue Sep 22, 2021 · 1 comment
Open
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@jwadolowski
Copy link

Expected Behavior

User input (branch/tag/repositoryId) must be validated upon update of CM pipeline settings.

Actual Behavior

aio cloudmanager:pipeline:update ends successfully for not existing branches/tags.

Reproduction Scenario, Platform, and Version

$ aio -v
@adobe/aio-cli/8.1.0 darwin-x64 node-v14.17.6

Steps to Reproduce

$ aio cloudmanager:pipeline:update PIPELINEID -p PROGRAMID --branch=this-branch-does-not-exist
updating pipeline... updated pipeline ID <PIPELINEID>

$ aio cloudmanager:pipeline:update PIPELINEID -p PROGRAMID --tag=not-existing-tag
updating pipeline... updated pipeline ID <PIPELINEID>

Once above is set you can start the pipeline, but it's gonna fail immediately at validation stage with the following message:

Failed: Invalid pipeline: . Reason=Branch=this-branch-does-not-exist not found in repository (Finished: September 22, 2021 11:14:23 AM GMT+2)

In contrast repository ID is being validated, so I assume that it may require some backend API changes:

$ aio cloudmanager:pipeline:update PIPELINEID -p PROGRAMID --repositoryId=123456
updating pipeline... failed
 ›   Error: [CloudManagerSDK:ERROR_UPDATE_PIPELINE] Cannot update pipeline: https://cloudmanager.adobe.io/api/program/PROGRAMID/pipeline/PIPELINEID (400 Bad Request) - Validation
 ›   Error(s): Referenced repository not found in application or is not ready for use: 123456
 ›   Code: ERROR_UPDATE_PIPELINE
@jwadolowski jwadolowski added the bug Something isn't working label Sep 22, 2021
@justinedelson justinedelson added enhancement New feature or request and removed bug Something isn't working labels Sep 23, 2021
@justinedelson
Copy link
Member

justinedelson commented Sep 23, 2021

It could certainly make sense for this CLI command to accept a flag --validate-branch which gets the repositoryId (either from the current pipeline definition or the repositoryId flag), lists the branches, and validates that the branch is one of those. That wouldn't be possible for tags, however.

@justinedelson justinedelson added the help wanted Extra attention is needed label Sep 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants