Page MenuHomePhabricator

[keyserver] Extract getBackupInfos
ClosedPublic

Authored by ashoat on Jun 14 2022, 10:28 AM.
Tags
None
Referenced Files
F3385097: D4263.id13528.diff
Thu, Nov 28, 11:22 PM
Unknown Object (File)
Mon, Nov 25, 9:35 AM
Unknown Object (File)
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
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
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

atul added inline comments.
keyserver/src/cron/backups.js
223 ↗(On Diff #13497)

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 ↗(On Diff #13497)

Can we make this return type $ReadOnlyArray<BackupInfo?

230 ↗(On Diff #13497)

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 ↗(On Diff #13497)

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 ↗(On Diff #13497)

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.