microsoft / appcenter-cli

Command-line Interface (CLI) for Visual Studio App Center
https://appcenter.ms/
MIT License
582 stars 235 forks source link

The create app command does not output relevant errors/does not validate arguments #315

Closed fgeorgsson closed 5 months ago

fgeorgsson commented 6 years ago

When creating an app any error messages from the server are ignored.

    $  appcenter apps create -p "React-Native" -o "ios" -d foobar
    Error: the request was rejected for an unknown reason
$  appcenter apps create -p "React-Native" -o "ios" -d foobar --debug
logFilter, request: WebResource {
  rawResponse: false,
  queryString: {},
  url: 'https://api.appcenter.ms/v0.1/apps',
  method: 'POST',
  headers:
   { 'Content-Type': 'application/json; charset=utf-8',
     'user-agent': 'appcenterCli/1.0.2 NodeJS/v7.7.1 win32/10.0.15063',
     'x-api-token': '...' },
  body: '{"display_name":"foobar","os":"ios","platform":"React-Native"}' }
| Creating app ...Response status code: 400
Body: {"error":{"code":"BadRequest","message":"Validation error for body parameter \"app.os\": No enum match for: ios"}}
Error: the request was rejected for an unknown reason

The argument should be "iOS", not "ios", and "Android", not "android". The error message could be more helpful.

The command shown in the migration guide is wrong: https://docs.microsoft.com/en-us/appcenter/distribution/codepush/migrationguide

Creating an App in the App Center CLI:
appcenter apps create -p "React-Native" -o "ios" -d "MyApp"
amchew commented 6 years ago

Hey @max-mironov, could you take a look at this?

christav commented 6 years ago

@amchew Why are you giving this to max, it's a core services command not codepush?

christav commented 6 years ago

And really the arguments should be case insensitive and converted internally to the right strings. We shouldn't be making users have to remember specific magic strings.

amchew commented 6 years ago

@christav we've discussed - thanks, yes it's a core services command.

@pcguru thanks for the useful feedback on the arguments, error message and documentation.

  1. Arguments and error message It would make more sense if the arguments are case-insensitive for the user. This is in our backlog. FYI, the valid OS strings are Android, iOS, macOS, Tizen, tvOS, Windows and the valid platform strings are Java, Objective-C-Swift, UWP, Cordova, React-Native, Xamarin.

  2. On documentation I've submitted a PR for the edits in the documentation, you should see the updates soon.

DmitriyKirakosyan commented 5 months ago

As we do not have plans to add support for this feature in the next year, I'm closing the issue.