feat(pitr): add command to restore a database to a specific point in time - #1244
Conversation
curzolapierre
left a comment
There was a problem hiding this comment.
Just a question otherwise LGTM
| return errors.Wrapf(ctx, err, "get Scalingo client") | ||
| } | ||
|
|
||
| operationID, err := c.DatabasePITRRestore(ctx, currentResource, addonName, restoreTime) |
There was a problem hiding this comment.
Suggestion: what about adding a confirmation message to the end user?
Which would format the date as human readable (maybe add the local time conversion).
There was a problem hiding this comment.
What do you mean? There is a io.Status 2 lines below. Or do you mean improving said message?
There was a problem hiding this comment.
Sorry it was not clear: I had in mind something like apps destroy command, ask for an user confirmation before to proceed the operation:
Line 29 in 93a1947
There was a problem hiding this comment.
Good question! Usually I'd have asked Benjamin, or checked how it is in the dashboard. But you are right, as it is a destructive action it might be better.
There was a problem hiding this comment.
Added here fc07c8c. I added a yes/no more than a name, as the use can use the addon name or ID or type, it didn't see great.
There was a problem hiding this comment.
Praise thanks for this update
| return errors.Wrap(ctx, err, "restore database") | ||
| } | ||
|
|
||
| io.Statusf("Database restore operation %s has been created", operationID) |
There was a problem hiding this comment.
question: what does the output looks like?
There was a problem hiding this comment.
I am not sure what you mean? It will just display a line with that info, like we do on many other commands (eg project creation)
There was a problem hiding this comment.
I am asking because there is no "\n" at the end. Usually I would expect a newline at the end
There was a problem hiding this comment.
Oooooh. I see what you mean, nice catch 🙇 . I guess the example I used was wrong.
I haven't QAed yet (as stated in the description)
fc07c8c to
1f69aa8
Compare
SCedricThomas
left a comment
There was a problem hiding this comment.
LGTM, just a reminder. Ping me when you need a reapproval post release
| require ( | ||
| github.com/AlecAivazis/survey/v2 v2.3.7 | ||
| github.com/Scalingo/go-scalingo/v11 v11.1.1 | ||
| github.com/Scalingo/go-scalingo/v11 v11.1.2-0.20260810154739-f30bd2e7ef2c |
There was a problem hiding this comment.
reminder: don't forget to release v11.1.2 before merging this PR
There was a problem hiding this comment.
(:information_source: discussion about that here)
Add a new command to restore PITR.
It reuses the same mechanism as maintenance. Both components are shared between SR addons and DR databases.
It adds a small check to ensure the time is correctly parsed.