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

feat: Support transient identities and traits #4325

Merged
merged 11 commits into from
Jul 17, 2024

Conversation

khvn26
Copy link
Member

@khvn26 khvn26 commented Jul 10, 2024

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

  • I have run pre-commit to check linting
  • 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

Closes #4279.
Contributes to #4278.

This adds support for

  • Top-level transient parameter
  • transient attribute for traits

for the /api/v1/identities SDK endpoint (GET, POST).

When including top-level transient: true, identity is evaluated against segments but is not persisted at all.
When calling the endpoint with traits marked as transient, these traits get evaluated against segments but do not get persisted.

Additionally, Identity.update_traits does not perform two SELECT queries anymore.

How did you test this code?

Added unit tests for views and serializers.

@khvn26 khvn26 requested a review from a team as a code owner July 10, 2024 17:52
@khvn26 khvn26 requested review from gagantrivedi and removed request for a team July 10, 2024 17:52
Copy link

vercel bot commented Jul 10, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

3 Skipped Deployments
Name Status Preview Comments Updated (UTC)
docs ⬜️ Ignored (Inspect) Visit Preview Jul 15, 2024 11:55am
flagsmith-frontend-preview ⬜️ Ignored (Inspect) Visit Preview Jul 15, 2024 11:55am
flagsmith-frontend-staging ⬜️ Ignored (Inspect) Visit Preview Jul 15, 2024 11:55am

@github-actions github-actions bot added api Issue related to the REST API feature New feature or request labels Jul 10, 2024
Copy link
Contributor

github-actions bot commented Jul 10, 2024

flagsmith-private-cloud image build and security scan finished ✨

Image Build Status Security report
ghcr.io/flagsmith/flagsmith-private-cloud:pr-4325 Finished ✅ Results

Copy link
Contributor

github-actions bot commented Jul 10, 2024

flagsmith-api image build and security scan finished ✨

Image Build Status Security report
ghcr.io/flagsmith/flagsmith-api:pr-4325 Finished ✅ Results

Copy link
Contributor

github-actions bot commented Jul 10, 2024

flagsmith-e2e image build finished ✨

Image Build Status Security report
ghcr.io/flagsmith/flagsmith-e2e:pr-4325 Finished ✅ Skipped

Copy link
Contributor

github-actions bot commented Jul 10, 2024

flagsmith-frontend image build and security scan finished ✨

Image Build Status Security report
ghcr.io/flagsmith/flagsmith-frontend:pr-4325 Finished ✅ Results

Copy link
Contributor

github-actions bot commented Jul 10, 2024

flagsmith image build and security scan finished ✨

Image Build Status Security report
ghcr.io/flagsmith/flagsmith:pr-4325 Finished ✅ Results

@khvn26 khvn26 force-pushed the feat/transient-identities-and-traits branch from f82a97f to a47b4bc Compare July 10, 2024 17:54
@github-actions github-actions bot added feature New feature or request and removed feature New feature or request labels Jul 10, 2024
Copy link
Contributor

github-actions bot commented Jul 10, 2024

Uffizzi Preview deployment-54064 was deleted.

@github-actions github-actions bot added feature New feature or request and removed feature New feature or request labels Jul 10, 2024
@github-actions github-actions bot added feature New feature or request and removed feature New feature or request labels Jul 11, 2024
Copy link

codecov bot commented Jul 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.78%. Comparing base (e7252cb) to head (ff66486).
Report is 17 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4325      +/-   ##
==========================================
+ Coverage   96.61%   96.78%   +0.17%     
==========================================
  Files        1196     1159      -37     
  Lines       39123    38152     -971     
==========================================
- Hits        37797    36925     -872     
+ Misses       1326     1227      -99     

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

@github-actions github-actions bot added feature New feature or request and removed feature New feature or request labels Jul 11, 2024
@github-actions github-actions bot added feature New feature or request and removed feature New feature or request labels Jul 11, 2024
@khvn26 khvn26 changed the title feat: Transient identities and traits feat: Support transient identities and traits Jul 11, 2024
@github-actions github-actions bot added feature New feature or request and removed feature New feature or request labels Jul 11, 2024
@github-actions github-actions bot added feature New feature or request and removed feature New feature or request labels Jul 11, 2024
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.

I've added a few fairly minor comments, but one additional thing that (I think) is missing, is a test that verifies that transient traits are correctly used when evaluating segments / segment overrides. Maybe this is implicit from other tests but I certainly expected to see an explicit test for this case.

@github-actions github-actions bot added feature New feature or request and removed feature New feature or request labels Jul 12, 2024
Copy link
Contributor

github-actions bot commented Jul 12, 2024

Docker builds report

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

@github-actions github-actions bot added feature New feature or request and removed feature New feature or request labels Jul 12, 2024
@khvn26 khvn26 force-pushed the feat/transient-identities-and-traits branch from 815b6e3 to 3929b2d Compare July 12, 2024 19:15
@github-actions github-actions bot added feature New feature or request and removed feature New feature or request labels Jul 12, 2024
@github-actions github-actions bot added feature New feature or request and removed feature New feature or request labels Jul 15, 2024
@khvn26 khvn26 requested a review from matthewelwell July 15, 2024 11:57
@khvn26 khvn26 added this pull request to the merge queue Jul 17, 2024
Merged via the queue into main with commit 27f6539 Jul 17, 2024
33 checks passed
@khvn26 khvn26 deleted the feat/transient-identities-and-traits branch July 17, 2024 10:40
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.

Support transient identities and traits in Core API
2 participants