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

Merged
merged 29 commits into from
Jan 29, 2025
Merged

feat: Backend support for feature health #5023

merged 29 commits into from
Jan 29, 2025

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 28, 2025 7:54pm
flagsmith-frontend-preview ⬜️ Ignored (Inspect) Visit Preview Jan 28, 2025 7:54pm
flagsmith-frontend-staging ⬜️ Ignored (Inspect) Visit Preview Jan 28, 2025 7:54pm

@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 Preview deployment-60083 was deleted.

@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-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

@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
@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

All modified and coverable lines are covered by tests ✅

Project coverage is 97.43%. Comparing base (ecd409b) to head (1486737).
Report is 6 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5023      +/-   ##
==========================================
+ Coverage   97.40%   97.43%   +0.03%     
==========================================
  Files        1193     1214      +21     
  Lines       41763    42224     +461     
==========================================
+ Hits        40678    41140     +462     
+ Misses       1085     1084       -1     

☔ 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 the feature New feature or request label Jan 28, 2025
@github-actions github-actions bot added feature New feature or request and removed feature New feature or request labels Jan 28, 2025
@khvn26 khvn26 force-pushed the feat/feature-health branch from 567a032 to 75d0ef3 Compare January 28, 2025 18:46
@github-actions github-actions bot added feature New feature or request and removed feature New feature or request labels Jan 28, 2025
@github-actions github-actions bot added feature New feature or request and removed feature New feature or request labels Jan 28, 2025
@github-actions github-actions bot added feature New feature or request and removed feature New feature or request labels Jan 28, 2025
@github-actions github-actions bot added feature New feature or request and removed feature New feature or request labels Jan 28, 2025
@github-actions github-actions bot added feature New feature or request and removed feature New feature or request labels Jan 28, 2025
@github-actions github-actions bot added feature New feature or request and removed feature New feature or request labels Jan 28, 2025
@khvn26 khvn26 requested a review from matthewelwell January 28, 2025 20:21
Copy link
Contributor

@matthewelwell matthewelwell left a comment

Choose a reason for hiding this comment

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

Approved with a few remaining minor comments.

@khvn26 khvn26 merged commit b0d0a80 into main Jan 29, 2025
37 checks passed
@khvn26 khvn26 deleted the feat/feature-health branch January 29, 2025 10:27
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.

3 participants