adobe / adobe/aio-cli-plugin-cloudmanager

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

Aperta
#492 1 commento 0 reazioni 0 assegnatari Vedi su GitHub
enhancement help wanted
Lingua principale
JavaScript
Stelle
50
Fork
36
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

**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

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

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
```

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Start with the `aio cloudmanager:pipeline:update` command and reproduce the branch and tag cases described in the issue, comparing them with the repositoryId validation result. Done means updates using nonexistent branches or tags are rejected during the update, rather than succeeding and failing only when the pipeline starts.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
javascript
Ambito
cli, cloud
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.