Page MenuHomePhabricator

[keyserver] Extract getBackupInfos
ClosedPublic

Authored by ashoat on Jun 14 2022, 10:28 AM.
Tags
None
Referenced Files
F3365614: D4263.diff
Mon, Nov 25, 7:22 AM
Unknown Object (File)
Fri, Nov 22, 12:39 PM
Unknown Object (File)
Fri, Nov 22, 12:39 PM
Unknown Object (File)
Fri, Nov 22, 12:39 PM
Unknown Object (File)
Fri, Nov 22, 12:39 PM
Unknown Object (File)
Fri, Nov 22, 12:38 PM
Unknown Object (File)
Oct 25 2024, 9:40 PM
Unknown Object (File)
Oct 22 2024, 11:26 AM
Subscribers

Details

Summary

We're going to want to reuse some of this code for ENG-1234, so I extracted it.

Depends on D4262

Test Plan

I copy pasted the new backups.js file into prod and added a console.log of the result of getBackupInfos. I made sure it was in chrono order and had everything right

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

atul added inline comments.
keyserver/src/cron/backups.js
223

Thoughts on naming this something like getSortedBackupInfos or something? Just something to indicate at the callsite that we're getting the data in some order so the [0] seems less arbitrary?

223

Can we make this return type $ReadOnlyArray<BackupInfo?

230

We could maybe sequence the startsWith before the endsWith... but really doesn't matter.

This revision is now accepted and ready to land.Jun 14 2022, 11:55 AM
keyserver/src/cron/backups.js
223

getSortedBackupInfos sounds good. I'd rather leave the array as mutable. Since we're returning a new array, it should be up to the caller if they want to mutate

230

Fair

This revision was landed with ongoing or failed builds.Jun 15 2022, 10:01 AM
This revision was automatically updated to reflect the committed changes.