Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add metadata field to config model #260

Merged
merged 6 commits into from
Oct 20, 2023
Merged

Conversation

passichenko
Copy link
Contributor

@passichenko passichenko commented Oct 19, 2023

Context

This is needed for https://github.com/lekkodev/webapp/pull/358
The idea is to add a generic metadata field to store arbitrary json and persist it in starlark. It can be used for any unstructured data for prototypes / experimental features.

Change

  • add metadata fields to protos
  • handle serialization / deserialization to starlark

Compatibility

This is a breaking change, so it requires namespace version upgrade.

Testing

  • manual testing for now
  • I'll add some tests later if we decide to keep it

@passichenko passichenko changed the title Spass segments metadata Add metadata field to config model Oct 19, 2023
@@ -30,6 +31,7 @@ message Feature {
string description = 2;
Tree tree = 3;
FeatureType type = 4;
google.protobuf.Value metadata = 7;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we're enforcing that metadata needs to be a dict in starlark, can't we explicitly use the Struct type instead of Value?

@passichenko passichenko merged commit c4f6272 into main Oct 20, 2023
1 check passed
@passichenko passichenko deleted the spass-segments-metadata branch May 2, 2024 20:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants