Skip to content

feat(experiments): expose metric direction on experiment metrics API - #8098

Merged
Zaimwa9 merged 4 commits into
mainfrom
feat/experiment-metric-direction-api
Jul 27, 2026
Merged

feat(experiments): expose metric direction on experiment metrics API#8098
Zaimwa9 merged 4 commits into
mainfrom
feat/experiment-metric-direction-api

Conversation

@Zaimwa9

@Zaimwa9 Zaimwa9 commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

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

Exposes the metric's inherent direction (up / down / informational) on the experiment metrics API, read-only from the related Metric. The frontend uses it to colour lift values by whether they move with or against the metric (follow-up to #8091).

How did you test this code?

Extended the attach-metric view test to assert the new field; tests/unit/experimentation/test_experiment_metric_views.py passes (18 tests), mypy clean.

@Zaimwa9
Zaimwa9 requested a review from a team as a code owner July 24, 2026 13:42
@Zaimwa9
Zaimwa9 requested review from khvn26 and removed request for a team July 24, 2026 13:42
@vercel

vercel Bot commented Jul 24, 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 Jul 24, 2026 1:56pm
flagsmith-frontend-preview Ignored Ignored Preview Jul 24, 2026 1:56pm
flagsmith-frontend-staging Ignored Ignored Preview Jul 24, 2026 1:56pm

Request Review

@coderabbitai

coderabbitai Bot commented Jul 24, 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: 63ec260c-d53a-4439-9d9e-c9fe046673d4

📥 Commits

Reviewing files that changed from the base of the PR and between 32407c6 and ed8fd71.

📒 Files selected for processing (2)
  • mcp/src/flagsmith_mcp/openapi.json
  • openapi.yaml

📝 Walkthrough

Walkthrough

ExperimentMetricSerializer now includes a read-only direction field sourced from the associated metric and lists it in the serialised fields. The attachment test verifies that an increasing metric returns "up", and both OpenAPI definitions document the new field.

Estimated code review effort: 1 (Trivial) | ~3 minutes


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 Jul 24, 2026
@github-actions

github-actions Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Docker builds report

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

@flagsmith-engineering
flagsmith-engineering Bot requested a review from a team as a code owner July 24, 2026 13:44

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 2561c67e-78f1-4e3b-af88-a305c607384f

📥 Commits

Reviewing files that changed from the base of the PR and between 912808a and e0cb86a.

📒 Files selected for processing (2)
  • mcp/src/flagsmith_mcp/openapi.json
  • openapi.yaml

Comment thread mcp/src/flagsmith_mcp/openapi.json
Comment thread openapi.yaml
@github-actions

github-actions Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor
✅ oss · depot-ubuntu-latest-arm-16 — run #18711 (attempt 1)

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

passed  1 passed

Details

stats  1 test across 1 suite
duration  46.3 seconds
commit  ed8fd71
info  🔄 Run: #18711 (attempt 1)

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

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

passed  2 passed

Details

stats  2 tests across 2 suites
duration  58.6 seconds
commit  32407c6
info  🔄 Run: #18710 (attempt 1)

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

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

passed  4 passed

Details

stats  4 tests across 4 suites
duration  36.9 seconds
commit  32407c6
info  🔄 Run: #18710 (attempt 1)

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

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

passed  1 passed

Details

stats  1 test across 1 suite
duration  34.5 seconds
commit  ed8fd71
info  🔄 Run: #18711 (attempt 1)

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

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

passed  1 passed

Details

stats  1 test across 1 suite
duration  46.4 seconds
commit  32407c6
info  🔄 Run: #18710 (attempt 1)

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

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

passed  1 passed

Details

stats  1 test across 1 suite
duration  43.6 seconds
commit  32407c6
info  🔄 Run: #18710 (attempt 1)

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

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

passed  1 passed

Details

stats  1 test across 1 suite
duration  37.1 seconds
commit  912808a
info  🔄 Run: #18707 (attempt 1)

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

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

passed  3 passed

Details

stats  3 tests across 3 suites
duration  33.1 seconds
commit  912808a
info  🔄 Run: #18707 (attempt 1)

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

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

passed  1 passed

Details

stats  1 test across 1 suite
duration  46.5 seconds
commit  e0cb86a
info  🔄 Run: #18708 (attempt 1)

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

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

passed  1 passed

Details

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

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

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

passed  1 passed

Details

stats  1 test across 1 suite
duration  41 seconds
commit  912808a
info  🔄 Run: #18707 (attempt 1)

@Zaimwa9
Zaimwa9 requested review from gagantrivedi and removed request for khvn26 July 24, 2026 13:49
@github-actions

github-actions Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Visual Regression

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

@codecov

codecov Bot commented Jul 24, 2026

Copy link
Copy Markdown

Codecov Report

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

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #8098   +/-   ##
=======================================
  Coverage   98.69%   98.69%           
=======================================
  Files        1525     1525           
  Lines       60605    60607    +2     
=======================================
+ Hits        59817    59819    +2     
  Misses        788      788           

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

@github-actions github-actions Bot added feature New feature or request and removed feature New feature or request labels Jul 24, 2026
@Zaimwa9
Zaimwa9 merged commit 8ac19b9 into main Jul 27, 2026
41 checks passed
@Zaimwa9
Zaimwa9 deleted the feat/experiment-metric-direction-api branch July 27, 2026 07:01
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