Skip to content

feat(edge-proxy): Wire the flagsmith-private edge_proxy app into the api - #8305

Open
gagantrivedi wants to merge 2 commits into
mainfrom
feat/edge-proxy-app-wiring
Open

feat(edge-proxy): Wire the flagsmith-private edge_proxy app into the api#8305
gagantrivedi wants to merge 2 commits into
mainfrom
feat/edge-proxy-app-wiring

Conversation

@gagantrivedi

@gagantrivedi gagantrivedi commented Aug 15, 2026

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

Contributes to Flagsmith/edge-proxy#128

Wires up the edge_proxy private app (Flagsmith/flagsmith-private#265 — merged, released in flagsmith-private 0.13.0, which main already locks), adding the proxy key credential and the proxy config endpoint that let a running Edge Proxy discover its environments. Consumed by the proxy in Flagsmith/edge-proxy-rs#17 and Flagsmith/edge-proxy-rs#18.

Three edits, following the rbac/scim pattern:

  • EDGE_PROXY_INSTALLED detection and conditional INSTALLED_APPS append.
  • Mounts for the two URL trees: proxy key management under organisations/{id}/edge-proxy/, and api/v1/proxy/ for the proxy config endpoint.
  • A mypy override so the no-private run passes.

Private cloud only: SaaS images ship the private wheel, so the mounts are gated on is_saas() at runtime rather than on the app being absent; the app's own views carry a matching permission as defence in depth.

How did you test this code?

With the released flagsmith-private==0.13.0 wheel installed (the version main locks): EDGE_PROXY_INSTALLED is True, edge_proxy is in INSTALLED_APPS, and both URL trees resolve (/api/v1/proxy/config/, /api/v1/organisations/1/edge-proxy/keys/). With a SAAS_DEPLOYMENT marker file present they 404 (reverse() raises NoReverseMatch). The app's own behaviour is covered by the integration tests merged with #265.

@vercel

vercel Bot commented Aug 15, 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 29, 2026 5:28am
flagsmith-frontend-preview Ignored Ignored Preview Aug 29, 2026 5:28am
flagsmith-frontend-staging Ignored Ignored Preview Aug 29, 2026 5:28am

Request Review

@coderabbitai

coderabbitai Bot commented Aug 15, 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: 8a11b259-1ab6-4afc-8822-41f4cb00f3f8

📥 Commits

Reviewing files that changed from the base of the PR and between 247cfc9 and 4330617.

📒 Files selected for processing (1)
  • api/app/urls.py

Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review.


📝 Walkthrough

Walkthrough

The change detects the optional edge_proxy module and adds it to Django when available. It registers Edge Proxy routes for non-SaaS runtimes. It configures mypy to ignore missing edge_proxy imports. The OpenAPI specification adds Edge Proxy key CRUD endpoints, proxy configuration retrieval, and schemas for environments and proxy keys.

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

Merge Risk: ⚪ Minimal · up to 43306

This change conditionally exposes the Edge Proxy application and its API routes for supported deployments while keeping them unavailable in SaaS deployments; no actionable merge-blocking risk remains after normal checks and review.


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 api Issue related to the REST API feature New feature or request labels Aug 15, 2026
@codecov

codecov Bot commented Aug 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.81%. Comparing base (250aff3) to head (4330617).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #8305   +/-   ##
=======================================
  Coverage   98.81%   98.81%           
=======================================
  Files        1621     1621           
  Lines       66102    66103    +1     
=======================================
+ Hits        65318    65319    +1     
  Misses        784      784           

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

@gagantrivedi
gagantrivedi force-pushed the feat/edge-proxy-app-wiring branch from 42c4d60 to eb468cc Compare August 29, 2026 05:22
@github-actions github-actions Bot added feature New feature or request and removed feature New feature or request labels Aug 29, 2026
@gagantrivedi gagantrivedi changed the title feat: wire up the edge_proxy private app feat(edge-proxy): Wire the flagsmith-private edge_proxy app into the api Aug 29, 2026
@gagantrivedi
gagantrivedi marked this pull request as ready for review August 29, 2026 05:22
@gagantrivedi
gagantrivedi requested a review from a team as a code owner August 29, 2026 05:22
@gagantrivedi
gagantrivedi requested review from matthewelwell and removed request for a team August 29, 2026 05:22
@github-actions github-actions Bot removed the feature New feature or request label Aug 29, 2026
@github-actions

github-actions Bot commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

Docker builds report

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

@github-actions github-actions Bot added the feature New feature or request label Aug 29, 2026
@flagsmith-engineering
flagsmith-engineering Bot requested a review from a team as a code owner August 29, 2026 05:23
Detects the edge_proxy app and mounts its two URL trees: proxy key
management for organisation admins, and the environment inventory that
Edge Proxy instances poll.

The feature is for private cloud only. SaaS images ship
the private wheel, so the mount is gated on is_saas() at runtime rather
than on the app being absent; the app's own views carry a matching
permission as defence in depth.
@github-actions

github-actions Bot commented Aug 29, 2026

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

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

passed  2 passed

Details

stats  2 tests across 2 suites
duration  48.8 seconds
commit  4330617
info  🔄 Run: #19945 (attempt 1)

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

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

passed  3 passed

Details

stats  3 tests across 3 suites
duration  38.7 seconds
commit  4330617
info  🔄 Run: #19945 (attempt 1)

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

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

passed  1 passed

Details

stats  1 test across 1 suite
duration  47.7 seconds
commit  4330617
info  🔄 Run: #19945 (attempt 1)

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

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

passed  1 passed

Details

stats  1 test across 1 suite
duration  41.1 seconds
commit  4330617
info  🔄 Run: #19945 (attempt 1)

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

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

passed  2 passed

Details

stats  2 tests across 2 suites
duration  38.1 seconds
commit  eb468cc
info  🔄 Run: #19943 (attempt 1)

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

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

passed  2 passed

Details

stats  2 tests across 2 suites
duration  31.9 seconds
commit  eb468cc
info  🔄 Run: #19943 (attempt 1)

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

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

passed  1 passed

Details

stats  1 test across 1 suite
duration  51 seconds
commit  eb468cc
info  🔄 Run: #19943 (attempt 1)

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

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

passed  1 passed

Details

stats  1 test across 1 suite
duration  51.4 seconds
commit  247cfc9
info  🔄 Run: #19944 (attempt 1)

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

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

passed  1 passed

Details

stats  1 test across 1 suite
duration  40.4 seconds
commit  247cfc9
info  🔄 Run: #19944 (attempt 1)

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

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

passed  1 passed

Details

stats  1 test across 1 suite
duration  32.4 seconds
commit  eb468cc
info  🔄 Run: #19943 (attempt 1)

@gagantrivedi
gagantrivedi force-pushed the feat/edge-proxy-app-wiring branch from 247cfc9 to 4330617 Compare August 29, 2026 05:28
@github-actions github-actions Bot added feature New feature or request and removed feature New feature or request labels Aug 29, 2026
@github-actions

github-actions Bot commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

Visual Regression

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

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.

1 participant