Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: added maintenance deadline to CLI in printouts #322

Merged
merged 11 commits into from
Aug 24, 2023
Merged

Conversation

madhuravius
Copy link
Contributor

@madhuravius madhuravius commented Aug 17, 2023

  • Parent PRs (2 of 2 merged on API layer, aptible-api-ruby needs merge + release before this can move forward)
  • Specs pending some signoff from alex on this one (in terms of desired behavior), backed up by Ann on this
  • Only pending a released gem, and should be mergable

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
Copy link
Member

@shortcut-integration
Copy link

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

@UserNotFound
Copy link
Member

# 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
Copy link
Contributor Author

madhuravius commented Aug 23, 2023

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
Copy link
Contributor Author

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

image

@madhuravius
Copy link
Contributor Author

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

image

@madhuravius madhuravius marked this pull request as ready for review August 24, 2023 15:08
@madhuravius madhuravius merged commit 844c961 into master Aug 24, 2023
4 checks passed
@madhuravius madhuravius deleted the MR-sc-11658 branch August 24, 2023 17:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants