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 crash in 3259, add test #3275

Conversation

evankanderson
Copy link
Member

Summary

Fix crash when evaluating flags with nil GoFeatureFlag interface. This is an interface of type go-feature-flag.Provider, with a nil value. The interface itself is not nil, because it has the type stored.

Fixes #3259

Change Type

Mark the type of change your PR introduces:

  • Bug fix (resolves an issue without affecting existing features)
  • Feature (adds new functionality without breaking changes)
  • Breaking change (may impact existing functionalities or require documentation updates)
  • Documentation (updates or additions to documentation)
  • Refactoring or test improvements (no bug fixes or new functionality)

Testing

Added unit tests, verified they reproduced the panic, then fixed the panic.

Review Checklist:

  • Reviewed my own code for quality and clarity.
  • Added comments to complex or tricky code sections.
  • Updated any affected documentation.
  • Included tests that validate the fix or feature.
  • Checked that related changes are merged.

@evankanderson evankanderson requested a review from a team as a code owner May 7, 2024 15:33
@evankanderson evankanderson linked an issue May 7, 2024 that may be closed by this pull request
Comment on lines +64 to +69
name: "No File",
cfg: config.FlagsConfig{
GoFeature: config.GoFeatureConfig{
FilePath: "non-existent-file",
},
},
Copy link
Member Author

Choose a reason for hiding this comment

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

This is the test that would fail (panic) before.

@coveralls
Copy link

coveralls commented May 7, 2024

Coverage Status

coverage: 50.325% (+0.1%) from 50.189%
when pulling 1b8abac on evankanderson:3259-segfault-when-doing-role-assignment
into e2414bc on stacklok:main.

@evankanderson evankanderson merged commit 6c47102 into mindersec:main May 7, 2024
20 checks passed
@JAORMX
Copy link
Contributor

JAORMX commented May 7, 2024

staging doesn't crash anymore. Thanks for the fix!

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.

Segfault when doing role assignment
4 participants