Skip to content

fix(Code References): Code references are slow to query#7463

Open
emyller wants to merge 6 commits into
mainfrom
fix/fast-code-references
Open

fix(Code References): Code references are slow to query#7463
emyller wants to merge 6 commits into
mainfrom
fix/fast-code-references

Conversation

@emyller
Copy link
Copy Markdown
Contributor

@emyller emyller commented May 8, 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

Closes #5932
Would originally close #6832

Improve code references so they're usable again.

The previous data model did not handle accumulated code references too well, and we had to disable it.

This patch will:

  • Complete redesign the data model of code references.
  • Migrate old data to new data.
  • Make code references viable for GA: in an hypothetical project with 400 features, 200K code references scans, list annotation improved from ~21s to ~12ms (around 1700x increase), and detail query improved from ~77ms to 1.4ms (~55x). Gotta go fast.
  • Prevent duplicate scans — for hygiene: performance gain does not rely on this.
  • Add a new "vcs_provider" to the API — but defaults to "github" for compatibility. This will allow support other VCS endeavours for free.
  • Delete code_references_ui_stats feature flag branches, 🎉.

How did you test this code?

  • Unit tests.
  • Benchmarking — tested on Apple silicon.

@emyller emyller self-assigned this May 8, 2026
@vercel
Copy link
Copy Markdown

vercel Bot commented May 8, 2026

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

3 Skipped Deployments
Project Deployment Actions Updated (UTC)
docs Ignored Ignored Preview May 12, 2026 1:07am
flagsmith-frontend-preview Ignored Ignored Preview May 12, 2026 1:07am
flagsmith-frontend-staging Ignored Ignored Preview May 12, 2026 1:07am

Request Review

@github-actions github-actions Bot added api Issue related to the REST API docs Documentation updates labels May 8, 2026
@emyller emyller changed the title Fix/fast code references fix(Code References): Code references are slow to query May 8, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented May 8, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.45%. Comparing base (e4651d1) to head (2b0f99e).
⚠️ Report is 17 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff            @@
##             main    #7463    +/-   ##
========================================
  Coverage   98.44%   98.45%            
========================================
  Files        1398     1401     +3     
  Lines       52654    52937   +283     
========================================
+ Hits        51834    52117   +283     
  Misses        820      820            

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

@emyller emyller force-pushed the fix/fast-code-references branch from b809ab4 to 9209bbe Compare May 11, 2026 21:56
@github-actions github-actions Bot added fix and removed docs Documentation updates labels May 11, 2026
@emyller emyller force-pushed the fix/fast-code-references branch from 9209bbe to 2b0f99e Compare May 11, 2026 23:51
@github-actions github-actions Bot added docs Documentation updates fix and removed fix docs Documentation updates labels May 11, 2026
@emyller emyller marked this pull request as ready for review May 12, 2026 00:33
@emyller emyller requested review from a team as code owners May 12, 2026 00:33
@emyller emyller requested review from gagantrivedi and removed request for a team May 12, 2026 00:33
Copy link
Copy Markdown

@claude claude Bot left a comment

Choose a reason for hiding this comment

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

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.

Tip: disable this comment in your organization's Code Review settings.

@github-actions github-actions Bot added fix and removed fix labels May 12, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 12, 2026

Docker builds report

Image Build Status Security report

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 12, 2026

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

passed  1 passed

Details

stats  1 test across 1 suite
duration  37.3 seconds
commit  2b0f99e
info  🔄 Run: #16672 (attempt 1)

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

passed  2 passed

Details

stats  2 tests across 2 suites
duration  44.5 seconds
commit  2b0f99e
info  🔄 Run: #16672 (attempt 1)

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

passed  18 passed

Details

stats  18 tests across 14 suites
duration  1 minute, 10 seconds
commit  2b0f99e
info  🔄 Run: #16672 (attempt 1)

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

passed  1 passed

Details

stats  1 test across 1 suite
duration  29.7 seconds
commit  2b0f99e
info  🔄 Run: #16672 (attempt 1)

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

passed  1 passed

Details

stats  1 test across 1 suite
duration  32.1 seconds
commit  d087401
info  🔄 Run: #16673 (attempt 1)

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

passed  1 passed

Details

stats  1 test across 1 suite
duration  43.1 seconds
commit  d087401
info  🔄 Run: #16673 (attempt 1)

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

passed  2 passed

Details

stats  2 tests across 2 suites
duration  42.1 seconds
commit  d087401
info  🔄 Run: #16673 (attempt 1)

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

passed  1 passed

Details

stats  1 test across 1 suite
duration  48.9 seconds
commit  d087401
info  🔄 Run: #16673 (attempt 1)

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 12, 2026

Visual Regression

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

@github-actions github-actions Bot added docs Documentation updates fix and removed fix docs Documentation updates labels May 12, 2026
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@emyller emyller force-pushed the fix/fast-code-references branch from d087401 to e9575cd Compare May 12, 2026 01:07
@github-actions github-actions Bot added docs Documentation updates fix and removed fix docs Documentation updates labels May 12, 2026
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.

Code references are slow to query Optimise annotate_feature_queryset_with_code_references_summary for feature list endpoint

1 participant