Page MenuHomePhabricator

[client-backup] add backup-service facts
ClosedPublic

Authored by kamil on Aug 29 2023, 2:04 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Oct 27, 5:01 PM
Unknown Object (File)
Sat, Oct 19, 9:37 AM
Unknown Object (File)
Sep 27 2024, 11:26 PM
Unknown Object (File)
Sep 27 2024, 11:26 PM
Unknown Object (File)
Sep 27 2024, 11:26 PM
Unknown Object (File)
Sep 27 2024, 11:26 PM
Unknown Object (File)
Sep 27 2024, 11:20 PM
Unknown Object (File)
Sep 2 2024, 10:14 AM
Subscribers

Details

Summary

Backup API definition.

Based on D8963, D8964, D8965

Depends on D8989

Test Plan

N/A

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

kamil held this revision as a draft.
kamil published this revision for review.Aug 29 2023, 3:04 AM
kamil added inline comments.
lib/facts/backup-service.js
34 ↗(On Diff #30468)

this will be updated after backup deploy (cc. @michal)

This revision is now accepted and ready to land.Aug 29 2023, 5:21 AM
bartek requested changes to this revision.Aug 29 2023, 5:57 AM
bartek added inline comments.
lib/facts/backup-service.js
3–6 ↗(On Diff #30468)

Requesting changes to address https://phab.comm.dev/D8991#inline-57473

Might be also worth doing for Blob service facts:

// lib/facts/blob-service.js
type BlobServicePath = '/blob/:blobHash' | '/blob';

export type BlobServiceHTTPEndpoint = {
  +path: BlobServicePath,
  +method: 'GET' | 'POST' | 'PUT' | 'DELETE',
};
This revision now requires changes to proceed.Aug 29 2023, 5:57 AM
lib/facts/backup-service.js
14–30 ↗(On Diff #30468)

I would probably name them like this

lib/facts/backup-service.js
15–19 ↗(On Diff #30468)

Also we can probably use JS style naming convention (blob facts also use camelCase) (remember to also change all calls to makeBackupServiceEndpointURL with the different names!)

This is a larger change that we probably don't need to implement but what about creating something more like this:

const httpEndpoints = Object.freeze({
  UPLOAD_BACKUP: () => {
    path: '/backups',
    method: 'POST',
  },
  GET_USER_KEYS_AUTH: (backup_id) => {
    path: `/backups/${backup_id}/user_keys`,
    method: 'GET',
  },

Maybe even add an argument for auth identity, and make the returned objects contain headers?: string[], that would be added with spread operator to the other headers?

Thanks for all the suggestions, I improved the type for path - for the rest I created ENG-4819.

lib/facts/backup-service.js
3–6 ↗(On Diff #30468)

Done!

For blob see: D9012

This revision is now accepted and ready to land.Aug 29 2023, 10:10 AM