HomePhabricator
Diffusion Comm 9e8bcfef27fd

[services][backup] Add helper utilities

Description

[services][backup] Add helper utilities

Summary:
Added the following helpers:

  • generate_backup_id - generates IDs for new backups. C++ counterpart: link
  • generate_blob_holder - generates holder string for blob service. C++ counterpart: link
  • generate_random_string - random alphanumeric str of given length. C++ counterpart: link
  • BackupItem::new - database entity convenience constructor
  • handle_db_error - utility for mapping database errors into grpc status. It's almost copy-pasted from Identity service.

These are all needed for the CreateBackup handler.

Depends on D6196

Test Plan: These will be tested altogether with the CreateBackup endpoint. I'm wondering if adding unit tests is worth doing here.

Reviewers: varun, tomek, jon, max

Reviewed By: varun, tomek

Subscribers: ashoat, atul

Differential Revision: https://phab.comm.dev/D6197

Details

Provenance
bartekAuthored on Jan 9 2023, 1:43 AM
Reviewer
varun
Differential Revision
D6197: [services][backup] Add helper utilities
Parents
rCOMM74955fedf8ff: [services][backup] CreateBackup 1/3 - create handler module
Branches
Unknown
Tags
Unknown