semaphoreci / cli

Semaphore 2.0 Command Line Interface
Apache License 2.0
26 stars 13 forks source link

If project name is taken, sem init fails with error, leaving user without next steps #116

Open markoa opened 5 years ago

markoa commented 5 years ago
$ sem init
error: http status 422 with message "{"message":"project name \"project-name\" is already taken"}" received from upstream

so what to do next...?

shiroyasha commented 5 years ago

proposal 1 (help message)

$ sem init
error: project name "project-name" is taken

Set up project with an alternative name with: sem init --project-name [NAME].

pros: clean, no ugly names, prevents accidental duplicate projects cons: it requires more typing, and reading the output

proposal 2 (automatic alternative name)

$ sem init
Project `project-name-2` created. Run your first pipeline with:

  git add .semaphore/sem....

pros: fast cons: Maybe I don't want to create this project again if it is already registered. I need to manually change project name from project-name-1, to something I like.

I vote for (proposal 1), it is cleaner, and more predictable in scripts.

markoa commented 5 years ago

I'd also go with no. 1 but also add a second suggestion to delete the old project. In my case I simply forgot that it exists, so I did that...

Suggestions:

- Set up a project with another name:
    sem init --project-name [NAME]

- Delete the existing project and try again:
    sem delete project typed-name