Page MenuHomePhabricator

[services][feature-flags] Introduce map and i32 parsing

Authored by tomek on Feb 23 2023, 7:27 AM.
Referenced Files
Unknown Object (File)
Feb 24 2023, 5:45 PM
Unknown Object (File)
Feb 24 2023, 5:45 PM
Unknown Object (File)
Feb 24 2023, 12:26 PM



We have to introduce a function that parses strings into numbers, because map keys in Dynamo are plain strings instead of AttributeValues. This affects what we store in DBItemError - now it is either AttributeValue or a String.

Depends on D6854

Test Plan

Tested with the rest of the stack.

Diff Detail

rCOMM Comm
Lint Not Applicable
Tests Not Applicable

Event Timeline

40–44 ↗(On Diff #23005)

This is copied from other services. I had to remove it from the previous diff as this case couldn't be matched.

tomek requested review of this revision.Feb 23 2023, 7:43 AM
bartek requested changes to this revision.Feb 24 2023, 1:41 AM
bartek added inline comments.
101–109 ↗(On Diff #23005)

Don't you want to distinguish between IncorrectType and Missing, the same way as in parse_{string,bool}_attribute?

If this is done deliberately, just let me know

116–123 ↗(On Diff #23005)

Wouldn't it work this way? Or are error types incompatible?

This revision now requires changes to proceed.Feb 24 2023, 1:41 AM
101–109 ↗(On Diff #23005)

That makes sense - changed

116–123 ↗(On Diff #23005)

It should work. I updated the diff and will test it later, after I'm done with rebasing.

Reabase and make error handling more consistent with other places.

This revision is now accepted and ready to land.Feb 27 2023, 5:02 AM