Skip to content
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

feat: Backend support for feature health #5023

Draft
wants to merge 11 commits into
base: main
Choose a base branch
from
Draft

Conversation

khvn26
Copy link
Member

@khvn26 khvn26 commented Jan 21, 2025

Thanks for submitting a PR! Please check the boxes below:

  • 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?
  • I have used a Conventional Commit title for this Pull Request

Changes

  • Auditable feature health events
  • Sample feature health event provider
  • Feature health event ingestion webhook with signed paths
  • "Unhealthy" system tag automatically added to features with corresponding feature health events

To create a Sample feature health provider, perform the following request:

curl -x POST http://<base-api-url>/api/v1/projects/<project-id>/feature-health/providers -H 'authorization: Token <user token>' --data-raw '{"type": "Sample"}'

or use the admin interface.

Request the resulting webhook URL:

curl -x POST http://<base-api-url>/api/v1/feature-health/<webhook-hash> --data-raw '{"environment": "<your-env-name>", "status": "unhealthy", "feature": "<your-feature-name>"}'

Observe the new system tag being added to your feature of choice.

Get a list of latest feature events per feature-provider pair:

curl http://<base-api-url>/api/v1/projects/<project-id>/feature-health/events -H 'authorization: Token <user token>'

How did you test this code?

Please describe.

Copy link

vercel bot commented Jan 21, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

3 Skipped Deployments
Name Status Preview Comments Updated (UTC)
docs ⬜️ Ignored (Inspect) Visit Preview Jan 26, 2025 7:48pm
flagsmith-frontend-preview ⬜️ Ignored (Inspect) Visit Preview Jan 26, 2025 7:48pm
flagsmith-frontend-staging ⬜️ Ignored (Inspect) Visit Preview Jan 26, 2025 7:48pm

@github-actions github-actions bot added api Issue related to the REST API feature New feature or request labels Jan 21, 2025
Copy link
Contributor

github-actions bot commented Jan 21, 2025

Uffizzi Ephemeral Environment Deploying

☁️ https://app.uffizzi.com/github.com/Flagsmith/flagsmith/pull/5023

⚙️ Updating now by workflow run 12977813943.

What is Uffizzi? Learn more!

@khvn26 khvn26 force-pushed the feat/feature-health branch from 0a13670 to 261fd86 Compare January 21, 2025 07:29
@github-actions github-actions bot added feature New feature or request and removed feature New feature or request labels Jan 21, 2025
@khvn26 khvn26 marked this pull request as ready for review January 21, 2025 07:33
@khvn26 khvn26 requested a review from a team as a code owner January 21, 2025 07:33
@khvn26 khvn26 requested review from matthewelwell and removed request for a team January 21, 2025 07:33
@github-actions github-actions bot removed the feature New feature or request label Jan 21, 2025
Copy link
Contributor

github-actions bot commented Jan 21, 2025

Docker builds report

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

@github-actions github-actions bot added the feature New feature or request label Jan 21, 2025
@khvn26 khvn26 marked this pull request as draft January 21, 2025 07:34
- Auditable feature health events
- Sample feature health event provider
- Feature health event ingestion webhook with signed paths
- "Unhealthy" system tag automatically added and removed based on feature health event data
@khvn26 khvn26 force-pushed the feat/feature-health branch from 261fd86 to 6a4bfab Compare January 21, 2025 08:00
@github-actions github-actions bot added feature New feature or request and removed feature New feature or request labels Jan 21, 2025
Copy link

codecov bot commented Jan 21, 2025

Codecov Report

Attention: Patch coverage is 87.05502% with 40 lines in your changes missing coverage. Please review.

Project coverage is 97.32%. Comparing base (3557e14) to head (c233acd).
Report is 13 commits behind head on main.

Files with missing lines Patch % Lines
api/features/feature_health/admin.py 0.00% 14 Missing ⚠️
api/features/feature_health/models.py 78.43% 11 Missing ⚠️
api/features/feature_health/services.py 81.81% 8 Missing ⚠️
api/features/feature_health/apps.py 0.00% 4 Missing ⚠️
api/features/feature_health/views.py 94.44% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5023      +/-   ##
==========================================
- Coverage   97.40%   97.32%   -0.08%     
==========================================
  Files        1192     1210      +18     
  Lines       41654    41984     +330     
==========================================
+ Hits        40571    40862     +291     
- Misses       1083     1122      +39     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@github-actions github-actions bot added feature New feature or request and removed feature New feature or request labels Jan 21, 2025
@github-actions github-actions bot added feature New feature or request and removed feature New feature or request labels Jan 21, 2025
@github-actions github-actions bot added feature New feature or request and removed feature New feature or request labels Jan 23, 2025
@github-actions github-actions bot added feature New feature or request and removed feature New feature or request labels Jan 23, 2025
@github-actions github-actions bot added feature New feature or request and removed feature New feature or request labels Jan 23, 2025
@github-actions github-actions bot added feature New feature or request and removed feature New feature or request labels Jan 23, 2025
@github-actions github-actions bot added feature New feature or request and removed feature New feature or request labels Jan 26, 2025
@github-actions github-actions bot added feature New feature or request and removed feature New feature or request labels Jan 26, 2025
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