Skip to content

feat(identities): add system_traits to engine identity document model - #8212

Merged
gagantrivedi merged 5 commits into
mainfrom
feat/identity-system-traits
Aug 6, 2026
Merged

feat(identities): add system_traits to engine identity document model#8212
gagantrivedi merged 5 commits into
mainfrom
feat/identity-system-traits

Conversation

@gagantrivedi

Copy link
Copy Markdown
Member

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

  • I have read the Contributing Guide.
  • 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.

Changes

Second PR of the cohort sync feature: cohort membership will materialise on Edge identities as system-owned traits, so the identity document needs a field that user/SDK trait writes can never reach.

  • Optional system_traits dict on the engine IdentityModel
  • Omitted from Dynamo documents while unset, so existing documents are byte-identical until a cohort touches an identity
  • No behaviour change: nothing writes the field yet; the batch applier lands in a follow-up PR

How did you test this code?

Three new mapper tests: field present when set, key absent when unset, and a document round-trip test proving parsing no longer strips the field. Full tests/integration/edge_api suite passes unchanged, confirming no document-shape change.

@gagantrivedi
gagantrivedi requested a review from a team as a code owner August 4, 2026 05:23
@gagantrivedi
gagantrivedi requested review from khvn26 and removed request for a team August 4, 2026 05:23
@vercel

vercel Bot commented Aug 4, 2026

Copy link
Copy Markdown

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

3 Skipped Deployments
Project Deployment Actions Updated (UTC)
docs Ignored Ignored Preview Aug 5, 2026 10:20am
flagsmith-frontend-preview Ignored Ignored Preview Aug 5, 2026 10:20am
flagsmith-frontend-staging Ignored Ignored Preview Aug 5, 2026 10:20am

Request Review

@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 0971c7b4-7948-449d-84cf-5640627f8a6a

📥 Commits

Reviewing files that changed from the base of the PR and between 3d1fbef and 62c2b9d.

📒 Files selected for processing (1)
  • api/util/mappers/sdk.py

📝 Walkthrough

Walkthrough

The change adds an optional system_traits mapping to IdentityModel. DynamoDB mapping retains this attribute when applicable. SDK identity overrides exclude system_traits. Tests cover populated, absent, validated, and SDK-mapped trait values.

Estimated code review effort: 3 (Moderate) | ~20 minutes


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added the api Issue related to the REST API label Aug 4, 2026
@gagantrivedi
gagantrivedi requested review from Zaimwa9 and removed request for khvn26 August 4, 2026 05:24
@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Docker builds report

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

@github-actions github-actions Bot added the feature New feature or request label Aug 4, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 35761218-9d51-4fb9-aabf-34ee913990e2

📥 Commits

Reviewing files that changed from the base of the PR and between dc7f354 and 60bfba4.

📒 Files selected for processing (3)
  • api/tests/unit/util/mappers/test_unit_mappers_dynamodb.py
  • api/util/engine_models/identities/models.py
  • api/util/mappers/dynamodb.py

Comment thread api/tests/unit/util/mappers/test_unit_mappers_dynamodb.py
@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor
✅ private-cloud · depot-ubuntu-latest-arm-16 — run #19019 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  1 minute, 4 seconds
commit  62c2b9d
info  🔄 Run: #19019 (attempt 1)

🗂️ Previous results
✅ private-cloud · depot-ubuntu-latest-16 — run #19019 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  55.4 seconds
commit  62c2b9d
info  🔄 Run: #19019 (attempt 1)

✅ oss · depot-ubuntu-latest-arm-16 — run #19019 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-arm-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  44.2 seconds
commit  62c2b9d
info  🔄 Run: #19019 (attempt 1)

✅ oss · depot-ubuntu-latest-16 — run #19019 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  41.2 seconds
commit  62c2b9d
info  🔄 Run: #19019 (attempt 1)

✅ private-cloud · depot-ubuntu-latest-arm-16 — run #18979 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)

passed  3 passed

Details

stats  3 tests across 3 suites
duration  38.1 seconds
commit  4a55cee
info  🔄 Run: #18979 (attempt 1)

✅ private-cloud · depot-ubuntu-latest-16 — run #18979 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-16)

passed  3 passed

Details

stats  3 tests across 3 suites
duration  33.5 seconds
commit  4a55cee
info  🔄 Run: #18979 (attempt 1)

✅ oss · depot-ubuntu-latest-arm-16 — run #18979 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-arm-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  43.8 seconds
commit  4a55cee
info  🔄 Run: #18979 (attempt 1)

✅ oss · depot-ubuntu-latest-arm-16 — run #18980 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-arm-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  46.2 seconds
commit  3d1fbef
info  🔄 Run: #18980 (attempt 1)

✅ oss · depot-ubuntu-latest-16 — run #18979 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  41 seconds
commit  4a55cee
info  🔄 Run: #18979 (attempt 1)

✅ oss · depot-ubuntu-latest-16 — run #18980 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  34.4 seconds
commit  3d1fbef
info  🔄 Run: #18980 (attempt 1)

✅ private-cloud · depot-ubuntu-latest-arm-16 — run #18978 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  36.2 seconds
commit  60bfba4
info  🔄 Run: #18978 (attempt 1)

✅ private-cloud · depot-ubuntu-latest-16 — run #18978 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-16)

passed  3 passed

Details

stats  3 tests across 3 suites
duration  32.3 seconds
commit  60bfba4
info  🔄 Run: #18978 (attempt 1)

@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Visual Regression

19 screenshots compared. See report for details.
View full report

@github-actions github-actions Bot added feature New feature or request and removed feature New feature or request labels Aug 4, 2026
@codecov

codecov Bot commented Aug 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.71%. Comparing base (fc33002) to head (62c2b9d).
⚠️ Report is 12 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #8212   +/-   ##
=======================================
  Coverage   98.71%   98.71%           
=======================================
  Files        1531     1535    +4     
  Lines       61263    61351   +88     
=======================================
+ Hits        60475    60563   +88     
  Misses        788      788           

☔ View full report in Codecov by Harness.
📢 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.

@github-actions github-actions Bot added feature New feature or request and removed feature New feature or request labels Aug 5, 2026
@gagantrivedi
gagantrivedi merged commit bb69175 into main Aug 6, 2026
34 checks passed
@gagantrivedi
gagantrivedi deleted the feat/identity-system-traits branch August 6, 2026 04:18
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 feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants