posit-dev / publisher

MIT License
3 stars 0 forks source link

CLI: redeploy command doesn't give me a way to select the correct account #1059

Open zackverham opened 5 months ago

zackverham commented 5 months ago

In the chaos of local development / testing, I have two accounts being picked up by the publisher which reference my localhost connect instance:

Nickname: "localhost"
    Server URL: http://localhost:3939
    Configured via: RStudio IDE/rsconnect
    Authentication: RStudio IDE/rsconnect token+key

Nickname: "local"
    Server URL: http://localhost:3939
    Configured via: rsconnect-python
    Authentication: Connect API key

My RStudio IDE account has an invalid API key - so I can't deploy using the "localhost" account.

Initial deployment lets me specify the correct account:

publisher deploy -a local -n connect-content

but the redeploy command doesn't let me specify the account to use - it seems to be using the incorrect account (I'm assuming its deriving the account to use from the server URL) which is making my redeployments fail.

mmarchetti commented 5 months ago

redeploy should accept an optional account. If specified, make sure it belongs to the correct server (matching URL).

zackverham commented 5 months ago

hmm - when I look at the available args / flags for redeploy, I don't see any account options:

➜  publisher redeploy --help
Usage: publisher redeploy <deployment-name> [<path>]

Arguments:
  <deployment-name>    Name of deployment to update (in .posit/deployments/)
  [<path>]             Path to project directory containing files to publish.

Flags:
  -h, --help             Show context-sensitive help.
  -v, --verbose=INT      Enable verbose logging. Use -vv or --verbose=2 for debug logging.

  -c, --config=STRING    Configuration name (in .posit/publish/)
mmarchetti commented 5 months ago

Sorry, the triage notes above weren't clear - it "should" accept an account name and then verify that it matches, but currently it does neither of those things.

zackverham commented 5 months ago

ahhhh, gotcha :-)