microsoft / appcenter-cli

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

Can't specify codepush version in codepush promote command #2464

Closed Ingibjorg closed 11 months ago

Ingibjorg commented 1 year ago

Steps to Reproduce

  1. From command line, run appcenter codepush promote -a myAppName --token myToken -s Staging -d Production -t 1.0.0 -v v192

Expected Behavior

What you expected to happen? I'd expect the command to support specifying the codepush version like it says it does while running appcenter codepush promote --help

Common Options (works on all commands):
    -v|--version                       Display appcenter version                                                                                                                          

If I have two codepushes for the same version on staging that haven't been promoted to production yet, I want to be able to specify the codepush version (v192) to make sure I promote the right codepush to production.

Note that if I have two codepushes for v1.0.0 on Staging, e.g. v191 and v192, if I run codepush promote, it will automatically promote v191 to production. So if we've codepushed v191 to staging, test it and find a bug, codepush a fix for same app version and now have codepush version v192, I can't use the command to promote the new build to Production without promoting the old one first.

My use case is that I'm building a GHA using this command to allow devs to promote codepushes to production via GHA.

Actual Behavior

What actually happens? I get the error below

Error: Command 'appcenter codepush promote -a myAppName --token myToken -s Staging -d Production -t 1.0.0 -v v192' failed with exception "Unknown arguments: v192"

Environment

Ingibjorg commented 1 year ago

I realize now that the -v option gives you the appcenter version 😶‍🌫️ Does the promote command offer any possibilities to pick the right codepush version?

DmitriyKirakosyan commented 1 year ago

Hi @Ingibjorg, thanks for writing! You can use -t|--target-binary-version to set the release version. Is there a reason this doesn't work for you?

I'm moving this to the right repo since it's about the appcenter-cli.

Ingibjorg commented 12 months ago

Hi @DmitriyKirakosyan, I know I can use -t to target the app version but I would also like to either target the codepush version or the bundle version.

Here's my use case: I have the following Codepush versions on AppCenter: Codepush - Staging 1.0.0 (1234) v12 (where 1.0.0 is the target binary version, 1234 is the bundle version and v12 is the Codepush version) 1.0.0 (1235) v13

The appcenter-cli promote command doesn't seem to provide a way to pick the latter build specifically to promote to production. Ideally, I'd like to be able to do appcenter codepush promote -a myAppName --token myToken -s Staging -d Production -t 1.0.0 --codepush-version 13 or appcenter codepush promote -a myAppName --token myToken -s Staging -d Production -t 1.0.0 --bundle-version 1235

DmitriyKirakosyan commented 11 months ago

@Ingibjorg , unfortunately only target-binary-version is supported as an argument for codepush promote command.