aptible / aptible-cli

Command line interface to Aptible
MIT License
28 stars 35 forks source link

SC-4187 - Operation logs printing after completion via redirect links #305

Closed madhuravius closed 2 years ago

madhuravius commented 2 years ago

This command can be tested locally with: aptible operation:logs OPERATION_ID

This appears like this:

image

This is dependent on this shared gem PR being merged: https://github.com/aptible/aptible-api-ruby/pull/142

This will do the following:

  1. Gets the /operations//logs from deploy-api
  2. Follows the redirect from the short-term presigned url
  3. Success!
shortcut-integration[bot] commented 2 years ago

This pull request has been linked to Shortcut Story #4187: CLI - Add command to retrieve logs.

madhuravius commented 2 years ago

@joshraker - works on my local for some reason 🤔, possible dep issue or something else

image
UserNotFound commented 2 years ago

Can you help me understand how to test this? I have deploy-api and sweetness changes deployed:

I have an operation uploaded to s3, but i get an error using this command: image

[aptible-cli]$ test-alex aptible operation:logs 1307
Requesting operation logs for succeeded deploy #1307 on deploy-api...
Printing out results of operation logs for 1307
<?xml version="1.0" encoding="UTF-8"?>
<Error><Code>AccessDenied</Code><Message>Access Denied</Message><RequestId>8ZZQMBB58RVR23FK</RequestId><HostId>5k6/UApXWtjuyQ8dXOLMCIWI0BEdnKZnigkCvgLKt0cMGy3rOkvvmjmaqct5N0UGURaGBRpcWjQ=</HostId></Error>
[aptible-cli]$ echo $?
0

I think this is just incomplete setup (missing permission?) on my part, since I created that bucket myself?

Also, i think this command should return an error when we get an error response, but it does not.

madhuravius commented 2 years ago

I think this is just incomplete setup (missing permission?) on my part, since I created that bucket myself?

This requires a deploy-api set of changes you may or may not have had set up (and there's permissions changes too). I'm moving this to draft mode as there's 1-2 other changes that have to go into this that Josh is currently working on.

Regarding Also, i think this command should return an error when we get an error response, but it does not. What kind of errors would you expect to see? Following up directly on slack


Edit - this was namely around the s3 file return