aptible / aptible-cli

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

feat: added maintenance deadline to CLI in printouts #322

Closed madhuravius closed 1 year ago

madhuravius commented 1 year ago

note/suggestion - I think we should just add a simple helper whenever someone runs apps/databases (where we say at the bottom, to restart your app, just do aptible restart --app $ID or whatnot

we might have to add a warning: "You will only be able to see scheduled maintenance in Environments for which you have been granted at least Read access"


databases proof:

image

apps proof:

image

The ticket asked for this grouping (which I can do) if desired, but felt that this was a bit easier to view (and has more relevant information with ids, which i think our CLI supports instead of handle alone). I also did not add it to the parent apps (which I can do if desired):

# aptible apps --requiring-maintenance
=== scantests
2023-07-19 23:00 UTC ubuntu-22
2023-08-01 23:00 UTC debian-9 

=== security
2023-08-01 23:00 UTC security-notifications-to-shortcut
UserNotFound commented 1 year ago

https://app.shortcut.com/aptible/story/16658/show-scheduled-maintenance-in-the-cli

shortcut-integration[bot] commented 1 year ago

This pull request has been linked to Shortcut Story #16658: Show scheduled maintenance in the CLI.

UserNotFound commented 1 year ago
# aptible apps --requiring-maintenance
You may restart these Apps/DBs at any time, or Aptible will restart it during the defined window

=== scantests
ubuntu-22 between 2023-07-19 23:00 UTC and 2023-07-19 23:00 UTC
debian-9 between 2023-08-01 23:00 UTC and 2023-08-01 23:00 UTC

=== security
security-notifications-to-shortcut between 2023-08-01 23:00 UTC and 2023-08-01 23:00 UTC

You may restart these Apps/DBs at any time, or Aptible will restart it during the defined window

The JSON output will include a restart_command attribute that contains the command needed to restart it.

madhuravius commented 1 year ago

Currently look like this @UserNotFound

image
[aptible-cli] aptible maintenance:dbs                                                                                                                20:19:43 git:(MR-sc-11658*) ⚡ ✭
=== test-django
couchdb between 2023-08-18 17:32:46 UTC and 2023-08-19 17:32:46 UTC

You may restart these database(s) at any time, or Aptible will restart it during the defined window.
[aptible-cli] aptible maintenance:apps                                                                                                               20:19:50 git:(MR-sc-11658*) ⚡ ✭

No apps found affected by maintenance schedules.

We can stick it in --requiring-maintenance, but we agreed verbally previously flag was not necessary and it could live as a separate command (much like it lives as different API resources), advise if this is not desired

madhuravius commented 1 year ago

With respect to JSON output, I think something like this is what was desired:

image
madhuravius commented 1 year ago

This will pass if gem release is done (i don't have perms):

image