Skip to content

fix: Support flat attributes in the evaluation context#26

Merged
khvn26 merged 4 commits intoFlagsmith:mainfrom
danjuv:fix/support-nested-traits
Feb 26, 2026
Merged

fix: Support flat attributes in the evaluation context#26
khvn26 merged 4 commits intoFlagsmith:mainfrom
danjuv:fix/support-nested-traits

Conversation

@danjuv
Copy link
Contributor

@danjuv danjuv commented Feb 22, 2026

This PR

  • Supports flat attributes in the evaluation context
  • Continues supporting nested traits attributes with the traits attribute taking precedence for backwards compatibility

Notes

Alternatively, can deprecate "traits" as an evaluation context attribute, but that's a breaking change and will defer to repository maintainers on that.

closes #24

Signed-off-by: Danju Visvanathan <danju.visvanathan@gmail.com>
@danjuv danjuv requested a review from a team as a code owner February 22, 2026 09:07
@danjuv danjuv requested review from gagantrivedi and removed request for a team February 22, 2026 09:07
@danjuv danjuv changed the title fix: support flat traits Fix: support flat traits Feb 22, 2026
@danjuv danjuv changed the title Fix: support flat traits fix: Support flat attributes in the evaluation context Feb 22, 2026
Signed-off-by: Danju Visvanathan <danju.visvanathan@gmail.com>
Copy link
Contributor

@matthewelwell matthewelwell left a comment

Choose a reason for hiding this comment

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

Thanks for the PR @danjuv .

I'd like to hear @khvn26 's opinion given your conversation on the issue, but from a code perspective, I've added one suggested improvement.

Signed-off-by: Danju Visvanathan <danju.visvanathan@gmail.com>
Copy link
Member

@khvn26 khvn26 left a comment

Choose a reason for hiding this comment

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

Thanks again for your contribution. The code looks good to me!

I approve of the solution used, but I'd like it to be documented somewhere — let's start with adding a small section to the README of this repo.

@danjuv
Copy link
Contributor Author

danjuv commented Feb 26, 2026

@khvn26 added a small section, let me know if you think it gets the point across

@danjuv danjuv requested a review from khvn26 February 26, 2026 15:41
Copy link
Member

@khvn26 khvn26 left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@khvn26 khvn26 merged commit b76a829 into Flagsmith:main Feb 26, 2026
5 checks passed
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.

Support flat attributes (not only nested traits) on evaluation contexts

3 participants