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

chore(1-3133): change avg health to current health in project status #8803

Merged
merged 4 commits into from
Nov 20, 2024

Conversation

thomasheartman
Copy link
Contributor

@thomasheartman thomasheartman commented Nov 20, 2024

This PR updates the project status service (and schemas and UI) to use the project's current health instead of the 4-week average.

I nabbed the calculateHealthRating from src/lib/services/project-health-service.ts instead of relying on the service itself, because that service relies on the project service, which relies on pretty much everything in the entire system.

However, I think we can split the health service into a service that does need the project service (which is used for 1 of 3 methods) and a service (or read model) that doesn't. We could then rely on the second one for this service without too much overhead. Or we could extract the calculateHealthRating into a shared function that takes its stores as arguments. ... but I suggest doing that in a follow-up PR.

Because the calculation has been tested other places (especially if we rely on a service / shared function for it), I've simplified the tests to just verify that it's present.

I've changed the schema's averageHealth into an object in case we want to include average health etc. in the future, but this is up for debate.

Copy link

vercel bot commented Nov 20, 2024

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

Name Status Preview Comments Updated (UTC)
unleash-monorepo-frontend ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 20, 2024 10:37am
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
unleash-docs ⬜️ Ignored (Inspect) Visit Preview Nov 20, 2024 10:37am

Copy link
Contributor

github-actions bot commented Nov 20, 2024

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

OpenSSF Scorecard

PackageVersionScoreDetails

Scanned Files

Copy link
Contributor

@sjaanus sjaanus left a comment

Choose a reason for hiding this comment

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

Nice

@thomasheartman thomasheartman merged commit 04b2b48 into main Nov 20, 2024
12 checks passed
@thomasheartman thomasheartman deleted the 1-3133/show-current-project-health-in-status branch November 20, 2024 10:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants