Skip to content

Conversation

@gagantrivedi
Copy link
Member

@gagantrivedi gagantrivedi commented Dec 5, 2025

Thanks for submitting a PR! Please check the boxes below:

  • I have added information to docs/ if required so people know about the feature!
  • I have filled in the "Changes" section below?
  • I have filled in the "How did you test this code" section below?
  • I have used a Conventional Commit title for this Pull Request

Changes

The trait_value field in SDKTraitData now correctly accepts both:

  • Structured SDKTraitValueData (from serializer validation via TraitValueField)
  • Raw primitive values (str, int, bool, float) when called directly
  • None (to delete traits)

This aligns the type definition with the actual runtime behavior of update_traits() and generate_traits() methods which handle both cases via Trait.generate_trait_value_data().

How did you test this code?

Please describe.

The trait_value field in SDKTraitData now correctly accepts both:
- Structured SDKTraitValueData (from serializer validation via TraitValueField)
- Raw primitive values (str, int, bool, float) when called directly
- None (to delete traits)

This aligns the type definition with the actual runtime behavior
of update_traits() and generate_traits() methods which handle
both cases via Trait.generate_trait_value_data().
@gagantrivedi gagantrivedi requested a review from a team as a code owner December 5, 2025 06:45
@gagantrivedi gagantrivedi requested review from khvn26 and removed request for a team December 5, 2025 06:45
@cursor
Copy link

cursor bot commented Dec 5, 2025

You have run out of free Bugbot PR reviews for this billing cycle. This will reset on December 10.

To receive reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

@vercel
Copy link

vercel bot commented Dec 5, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

3 Skipped Deployments
Project Deployment Preview Comments Updated (UTC)
docs Ignored Ignored Preview Dec 5, 2025 7:35am
flagsmith-frontend-preview Ignored Ignored Preview Dec 5, 2025 7:35am
flagsmith-frontend-staging Ignored Ignored Preview Dec 5, 2025 7:35am

@github-actions github-actions bot added api Issue related to the REST API fix labels Dec 5, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Dec 5, 2025

Docker builds report

Image Build Status Security report
ghcr.io/flagsmith/flagsmith-api-test:pr-6371 Finished ✅ Skipped
ghcr.io/flagsmith/flagsmith-frontend:pr-6371 Finished ✅ Results
ghcr.io/flagsmith/flagsmith-api:pr-6371 Finished ✅ Results
ghcr.io/flagsmith/flagsmith:pr-6371 Finished ✅ Results
ghcr.io/flagsmith/flagsmith-private-cloud:pr-6371 Finished ✅ Results

…ypes

The value field can be str, int, bool, or float based on the trait's
actual value type, not just str.
@github-actions github-actions bot added fix and removed fix labels Dec 5, 2025
- Remove unused type: ignore comments in launch_darkly/services.py
  now that SDKTraitData accepts raw trait values
- Update get_transient_identifier to handle both SDKTraitValueData
  and raw primitive values with proper type narrowing
@github-actions github-actions bot added fix and removed fix labels Dec 5, 2025
@codecov
Copy link

codecov bot commented Dec 5, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.02%. Comparing base (a2b62f2) to head (1bfef76).
⚠️ Report is 6 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6371   +/-   ##
=======================================
  Coverage   98.02%   98.02%           
=======================================
  Files        1282     1282           
  Lines       45498    45500    +2     
=======================================
+ Hits        44600    44602    +2     
  Misses        898      898           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Tests cover:
- Structured SDKTraitValueData format (from serializer validation)
- Raw primitive values (str, int, bool, float)
- None values being skipped
- Empty list returning UUID
- Same value in structured vs raw format producing same hash
@github-actions github-actions bot added fix and removed fix labels Dec 5, 2025
…nt_identifier

The function only receives SDKTraitValueData from serializer paths,
so a type: ignore comment is sufficient to handle the broadened TraitValue type.
@github-actions github-actions bot added fix and removed fix labels Dec 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api Issue related to the REST API fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants