diff options
author | Sami Hiltunen <shiltunen@gitlab.com> | 2021-04-15 17:42:02 +0300 |
---|---|---|
committer | Sami Hiltunen <shiltunen@gitlab.com> | 2021-04-21 14:40:56 +0300 |
commit | 6350ec5591df7ec905e8e0a7952425d8c8f94aa8 (patch) | |
tree | ed93a621bf23c729087c174d73d88abeb3ef4d75 /cmd/gitaly-hooks | |
parent | 184ea413f75659a68be2d964b2fb12e512e448ea (diff) |
Add functions for working with raw feature flag values
`internal/metadata/featureflag` does not currently provide functions
needed to work with raw feature flags. Propagating the feature flags
through hooks is not possible by using the typical gRPC metadata in
the context. As such, helpers are needed to pass the raw flags through
the hooks so they can be attached to the outgoing metadata when calling
HookService. While there is an existing function `AllFlags`, it joins the
flag names and values together which doesn't make for a good interface
to pass the raw flags through.
This commit adds the `Raw` type which is simply a raw map of the feature
flag metadata. `RawFromContext` is provided to extract the feature flags
from the context. `OutgoingWithRaw` is added in order to set the raw feature
flags into an outgoing context. These two functions in combination make it
easy to pass the serialized feature flags into the hook payload and to pass
them to HookService via the outgoing context.
Diffstat (limited to 'cmd/gitaly-hooks')
0 files changed, 0 insertions, 0 deletions