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

fix: [go-feature-flag] Make flag metadata optional #572

Merged

Conversation

itchyny
Copy link
Contributor

@itchyny itchyny commented Dec 6, 2023

This PR

  • fixes a NullPointerException when receive data without flag metadata from go-feature-flag.

Related Issues

Fixes #367 (comment).

Notes

The metadata in the flag configuration is an optional field.

metadata
(optional)
This field allows adding a wealth of information about a particular feature flag, such as a configuration URL or the originating Jira issue.
https://gofeatureflag.org/docs/configure_flag/flag_format

Also see the following omitempty tag which means that the field is not included in the response JSON if empty.

Metadata map[string]interface{} json:"metadata,omitempty"
https://github.com/thomaspoignant/go-feature-flag/blob/ba95173c873f0bc49cabfe2911f04289d154a04b/internal/flagstate/flag_state.go#L16

Follow-up Tasks

How to test

@itchyny itchyny requested a review from a team as a code owner December 6, 2023 00:54
@itchyny itchyny force-pushed the fix-go-feature-flag-metadata-npe branch from b9cdc30 to 1bda560 Compare December 6, 2023 00:54
Copy link
Member

@thomaspoignant thomaspoignant left a comment

Choose a reason for hiding this comment

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

Good catch @itchyny, this is a bug that I did not catch before.

@thomaspoignant thomaspoignant merged commit 6a70bc4 into open-feature:main Dec 7, 2023
4 checks passed
@thomaspoignant
Copy link
Member

Version v0.2.16 has been released and will be available in maven soon.

DBlanchard88 pushed a commit to DBlanchard88/java-sdk-contrib that referenced this pull request Apr 29, 2024
)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
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