CircleCI-Public / circleci-cli

Use CircleCI from the command line
https://circleci-public.github.io/circleci-cli/
MIT License
407 stars 232 forks source link

"orb init" allows providing incorrect number of categories #609

Open jippi opened 3 years ago

jippi commented 3 years ago

Meta:

CircleCI CLI Version:

0.1.15410+ba6fe81 (homebrew)

Operating System:

MacOS

CircleCI CLI Diagnostic:

Debugger mode: false
Config found: /Users/XXXX/.circleci/cli.yml
API host: https://circleci.com
API endpoint: graphql-unstable
OK, got a token.
Trying an introspection query on API...
Ok.
Hello, XXX

Current behavior:

When selecting categories, I picked 3, and the CLI tool proceeded to the next step in the setup - however, the server seems to reject the configuration as 2 is the maximum number of categories.

$ circleci orb init . --private
(....)
Error: Orbs may only belong to 2 category(s). This orb has already been placed under the following category(s): Build,Deployment. Please remove the orb from one of the aforementioned categories and then try again.

Expected behavior:

Would be nice if each step validated its input so I did not have to start over again and remember my other selected inputs to the guide.

When did this begin / Was this previously working?:

N/A

Additional Information:

N/A

jippi commented 3 years ago

Another case where validation up front would be really nice (or instructions more clear)

$ circleci orb init . --private
Note: This command is in preview. Please report any bugs! https://github.com/CircleCI-Public/circleci-cli/issues/new/choose
? Would you like to perform an automated setup of this orb? Yes, walk me through the process.
Downloading Orb Project Template into .
A few questions to get you up and running.
? Are you using GitHub or Bitbucket? GitHub
? Enter your github username or organization billysbilling
? Enter the namespace to use for this orb billysbilling
Saving namespace billysbilling as default
? Orb name ci
? What categories will this orb belong to? Build, Testing
? Automatically set up a publishing context for your orb? Yes, set up a publishing context with my API key.
`orb-publishing` context already exists, continuing on
? Would you like to set up your git project? Yes
? Enter your primary git branch. main
? Enter the remote git repository git@github.com:billysbilling/app-ci.git
Thank you! Setting up your orb...
An initial commit has been created - please run 'git push origin main' to publish your first commit!
? I have pushed to my git repository using the above command Yes
Error: Post "graphql-unstable/api/v1.1/project/gh/billysbilling/app-ci/follow": unsupported protocol scheme ""
patatepartie commented 3 years ago

Another case where validation up front would be really nice (or instructions more clear)

@jippi your comment seems to subject the error results from a wrong input. I'm having the same error but can't pinpoint what I did wrong. Did you workaround the "unsupported protocol scheme" error?