-
Notifications
You must be signed in to change notification settings - Fork 449
feat: report environment metrics api #5430
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
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 3 Skipped Deployments
|
for more information, see https://pre-commit.ci
Docker builds report
|
Uffizzi Ephemeral Environment Deploying☁️ https://app.uffizzi.com/github.com/Flagsmith/flagsmith/pull/5430 ⚙️ Updating now by workflow run 14887281399. What is Uffizzi? Learn more! |
Uffizzi Ephemeral Environment Deploying☁️ https://app.uffizzi.com/github.com/Flagsmith/flagsmith/pull/5430 ⚙️ Updating now by workflow run 15320227152. What is Uffizzi? Learn more! |
…h/flagsmith into feat/report-environment-metrics
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #5430 +/- ##
==========================================
+ Coverage 97.65% 97.69% +0.04%
==========================================
Files 1237 1247 +10
Lines 43580 44250 +670
==========================================
+ Hits 42558 43231 +673
+ Misses 1022 1019 -3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
api/environments/models.py
Outdated
Returns total feature count and enabled-by-default feature count | ||
scoped to this environment's project. | ||
""" | ||
from edge_api.identities.models import EdgeIdentity |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All these local imports suggest this should be moved to the service layer?
api/environments/models.py
Outdated
|
||
fs_base_query = ( | ||
feature_states_qs.values("feature_id", "feature_segment_id") | ||
.annotate(latest_id=Max("id")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we doing Max?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My bad, thanks for catching up, it's a (useless) artifact from before using get_live_feature_states
for more information, see https://pre-commit.ci
) | ||
version += 1 | ||
|
||
for i in range(segment_overrides_count): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add versions to segments to check version selection
Thanks for submitting a PR! Please check the boxes below:
docs/
if required so people know about the feature!Changes
feat/report-environment-metrics-frontend
Dark mode with workflows

Light mode without workflows

Aim of this PR is to provide an endpoint returning a set of environment-level metrics:
Total features
Features enabled
Segment override
Open change requests
Scheduled change to come
Created a base metric view nested within environment view
Added specific query-sets for each metrics
New metric service
Payload example:
How did you test this code?
How to
Make sure that the displayed metrics reflects reality state