Skip to content

feat(pitr): add command to restore a database to a specific point in time - #1244

Draft
matthieu526-scalingo wants to merge 5 commits into
masterfrom
feat/sTORY-3565/create-pitr-restore-command
Draft

feat(pitr): add command to restore a database to a specific point in time#1244
matthieu526-scalingo wants to merge 5 commits into
masterfrom
feat/sTORY-3565/create-pitr-restore-command

Conversation

@matthieu526-scalingo

Copy link
Copy Markdown
Contributor

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.

  • Add a changelog entry in the section "To Be Released" of CHANGELOG.md
  • right now depending on this PR. Before merging it should be set to a released version (or not?)
  • QA not executed yet

@matthieu526-scalingo matthieu526-scalingo self-assigned this Aug 5, 2026
@matthieu526-scalingo
matthieu526-scalingo requested a review from a team as a code owner August 5, 2026 14:09
@matthieu526-scalingo
matthieu526-scalingo requested review from SCedricThomas, briceamen and curzolapierre and removed request for a team and briceamen August 5, 2026 14:09
@matthieu526-scalingo
matthieu526-scalingo marked this pull request as draft August 5, 2026 14:10

@curzolapierre curzolapierre left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a question otherwise LGTM

Comment thread db/pitr/restore.go Outdated
return errors.Wrapf(ctx, err, "get Scalingo client")
}

operationID, err := c.DatabasePITRRestore(ctx, currentResource, addonName, restoreTime)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you mean? There is a io.Status 2 lines below. Or do you mean improving said message?

Comment thread README.md

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Praise thanks for this update

Comment thread db/pitr/restore.go Outdated
return errors.Wrap(ctx, err, "restore database")
}

io.Statusf("Database restore operation %s has been created", operationID)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: what does the output looks like?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am asking because there is no "\n" at the end. Usually I would expect a newline at the end

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

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