Skip to content

feat(experimentation): return feature object along with experiment entity#7609

Merged
Zaimwa9 merged 16 commits into
mainfrom
feat/experiment-api-returns-feature-object
May 28, 2026
Merged

feat(experimentation): return feature object along with experiment entity#7609
Zaimwa9 merged 16 commits into
mainfrom
feat/experiment-api-returns-feature-object

Conversation

@Zaimwa9
Copy link
Copy Markdown
Contributor

@Zaimwa9 Zaimwa9 commented May 27, 2026

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

  • Attaches feature object (name and variants needed) along the experiment entity to avoid multiple requests or frontend re-association with paginated

How did you test this code?

  • New tests

@Zaimwa9 Zaimwa9 requested a review from a team as a code owner May 27, 2026 09:29
@Zaimwa9 Zaimwa9 requested review from khvn26 and removed request for a team May 27, 2026 09:29
@vercel
Copy link
Copy Markdown

vercel Bot commented May 27, 2026

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

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview, Comment May 27, 2026 2:42pm
flagsmith-frontend-preview Ready Ready Preview, Comment May 27, 2026 2:42pm
flagsmith-frontend-staging Ready Ready Preview, Comment May 27, 2026 2:42pm

Request Review

@github-actions github-actions Bot added the api Issue related to the REST API label May 27, 2026
@Zaimwa9 Zaimwa9 requested review from a team and gagantrivedi and removed request for khvn26 May 27, 2026 09:30
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces nested serialization for experiments by defining ExperimentFeatureSerializer and ExperimentListSerializer to include detailed feature and multivariate option data. It also updates the viewset to use this new serializer for list and retrieve actions. The reviewer identified two critical issues: first, the nested serialization will trigger an N+1 query problem unless select_related and prefetch_related are used to optimize the queryset; second, the custom transition actions (like start, pause, and complete) should also use the new serializer to prevent the frontend from receiving inconsistent data structures.

Comment thread api/experimentation/views.py
Comment thread api/experimentation/views.py Outdated
@github-actions github-actions Bot added the feature New feature or request label May 27, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 27, 2026

Docker builds report

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

Zaimwa9 added 2 commits May 27, 2026 11:31
…ub.com:Flagsmith/flagsmith into feat/experiment-api-returns-feature-object
@github-actions github-actions Bot added feature New feature or request and removed feature New feature or request labels May 27, 2026
@github-actions github-actions Bot added feature New feature or request and removed feature New feature or request labels May 27, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 27, 2026

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

passed  1 passed

Details

stats  1 test across 1 suite
duration  33.3 seconds
commit  ed932fb
info  🔄 Run: #17020 (attempt 1)

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

passed  1 passed

Details

stats  1 test across 1 suite
duration  42.8 seconds
commit  ed932fb
info  🔄 Run: #17020 (attempt 1)

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

passed  2 passed

Details

stats  2 tests across 2 suites
duration  32.3 seconds
commit  ed932fb
info  🔄 Run: #17020 (attempt 1)

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

passed  1 passed

Details

stats  1 test across 1 suite
duration  38.9 seconds
commit  eaf6280
info  🔄 Run: #17022 (attempt 1)

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

passed  3 passed

Details

stats  3 tests across 3 suites
duration  36.6 seconds
commit  ed932fb
info  🔄 Run: #17020 (attempt 1)

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

passed  1 passed

Details

stats  1 test across 1 suite
duration  36.7 seconds
commit  eaf6280
info  🔄 Run: #17022 (attempt 1)

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

passed  3 passed

Details

stats  3 tests across 3 suites
duration  50.1 seconds
commit  eaf6280
info  🔄 Run: #17022 (attempt 1)

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

passed  2 passed

Details

stats  2 tests across 2 suites
duration  40.1 seconds
commit  eaf6280
info  🔄 Run: #17022 (attempt 1)

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

passed  1 passed

Details

stats  1 test across 1 suite
duration  41.7 seconds
commit  86db405
info  🔄 Run: #17023 (attempt 1)

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

passed  2 passed

Details

stats  2 tests across 2 suites
duration  32.1 seconds
commit  86db405
info  🔄 Run: #17023 (attempt 1)

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

passed  3 passed

Details

stats  3 tests across 3 suites
duration  1 minute, 5 seconds
commit  86db405
info  🔄 Run: #17023 (attempt 1)

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

passed  2 passed

Details

stats  2 tests across 2 suites
duration  37.9 seconds
commit  86db405
info  🔄 Run: #17023 (attempt 1)

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

passed  1 passed

Details

stats  1 test across 1 suite
duration  41.8 seconds
commit  18cc27b
info  🔄 Run: #17035 (attempt 1)

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

passed  1 passed

Details

stats  1 test across 1 suite
duration  38.9 seconds
commit  18cc27b
info  🔄 Run: #17035 (attempt 1)

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

passed  1 passed

Details

stats  1 test across 1 suite
duration  41.8 seconds
commit  18cc27b
info  🔄 Run: #17035 (attempt 1)

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

passed  1 passed

Details

stats  1 test across 1 suite
duration  37.3 seconds
commit  18cc27b
info  🔄 Run: #17035 (attempt 1)

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 27, 2026

Visual Regression

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

@codecov
Copy link
Copy Markdown

codecov Bot commented May 27, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.51%. Comparing base (d118da7) to head (18cc27b).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #7609   +/-   ##
=======================================
  Coverage   98.51%   98.51%           
=======================================
  Files        1439     1439           
  Lines       54690    54727   +37     
=======================================
+ Hits        53880    53917   +37     
  Misses        810      810           

☔ 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.

Base automatically changed from feat/scaffold-experimentation-models-and-cruds to main May 27, 2026 13:17
@github-actions github-actions Bot added feature New feature or request and removed feature New feature or request labels May 27, 2026
@Zaimwa9 Zaimwa9 changed the title feat(experimentation): return feature object along with experiment en… feat(experimentation): return feature object along with experiment entity May 27, 2026
@Zaimwa9 Zaimwa9 merged commit e5f2f7c into main May 28, 2026
36 of 42 checks passed
@Zaimwa9 Zaimwa9 deleted the feat/experiment-api-returns-feature-object branch May 28, 2026 08:44
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