Skip to content

fix: count last 365 days in the active contributors badge and drop v1 health score copy - #2377

Merged
gaspergrom merged 3 commits into
mainfrom
fix/IN-1222-health-v1-copy-badge
Oct 13, 2026
Merged

gaspergrom merged 3 commits into
mainfrom
fix/IN-1222-health-v1-copy-badge

Conversation

@gaspergrom

@gaspergrom gaspergrom commented Oct 13, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • The active contributors README badge (/api/badge/active-contributors) counts contributors from the last 365 days. It reads active_contributors with the same filters and window as the badge preview in the share menu (active-contributor-badge.vue): code contributions on, collaborations off, start 365 days ago, end today. The "Active contributors (1Y)" label and the shields.io redirect stay the same.
  • The Health Score docs page loses its "How This Differs from the Previous Health Score" section, and its intro no longer mentions the previous composite score.
  • health-score-banner.vue is deleted. It was the "We updated our Health Score methodology" notice on the project overview, linking readers to that comparison.

Why

The badge called health_score_active_contributors, a health score benchmark pipe, without dates. It showed an all-time count under a "(1Y)" label, so README badges disagreed with the share preview for the same project.

The comparison section and the banner describe the v1 score. Once #2374 ships (the Open Source Index pill still reads v1 on main until then), Health Score v2 is the only overall score insights shows.

README badge numbers drop when this deploys. Envoy goes from 5.1K (all time) to about 1.6K (last 365 days).

Changes

File What changed
frontend/server/api/badge/active-contributors.ts Reads contributorCount from active_contributors for the last 365 days
frontend/server/api/badge/active-contributors.test.ts New. Covers the pipe, filters, 365-day window, label, number format and the 404 case
frontend/docs/metrics/health-score/index.md Removes the comparison section; rewords the intro without the "previous single composite score" phrase
frontend/app/components/modules/project/components/overview/health-score-banner.vue Deleted
frontend/app/components/modules/project/views/overview.vue Drops the banner

JIRA

IN-1222: Deprecate v1 health score sinks and tables

Related PRs

Deploy order

No ordering constraints.

DB migrations

No DB migrations.

Test plan

  • Unit tests: the badge calls active_contributors with includeCodeContributions=true, includeCollaborations=false and a 365-day window, keeps the "(1Y)" label, shows 1,580 as 1.6K, and returns 404 when the pipe has no row.
  • Local run against production data for envoy: the current badge shows 5.1K, and the share preview's query for the same window returns 1,623 (1.6K). The new badge sends that query. The badge builds its window from the UTC date, while the share preview uses the viewer's local date, so the two can differ by one day at the edges.
  • Behaviour change: a valid project with a repos= value that matches no repository now shows a "0" badge. The old route returned 404 because its pipe returned no row.
  • pnpm docs:build passes with no dead links. Nothing else linked to the removed section.
  • No other file imports health-score-banner.vue.
  • Gates: pnpm lint, pnpm format:check, cd frontend && pnpm tsc-check && pnpm vitest run (321 tests), pnpm build.

To check after deploy:

  • /api/badge/active-contributors?project=envoy redirects with a message near 1.6K.
  • The project overview has no methodology banner.
  • /docs/metrics/health-score/ ends at the coverage note.

Checklist

  • git commit --signoff -S on every commit
  • MIT license header on the new test file
  • PR diff: 157 changed lines
  • No unrelated changes bundled

Signed-off-by: Gašper Grom <gasper.grom@gmail.com>
…r IN-1222

Signed-off-by: Gašper Grom <gasper.grom@gmail.com>
Copilot AI balanced review requested due to automatic review settings October 13, 2026 11:08
@cursor

cursor Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

PR Summary

Medium Risk
The badge API is a public integration surface—deploy will change displayed counts (e.g. all-time vs last year) and edge behavior for empty repo filters; doc/UI removals are low impact.

Overview
The active contributors README badge endpoint now queries the active_contributors Tinybird pipe with a rolling 365-day window and the same filters as the share preview (code contributions on, collaborations off), using contributorCount instead of the old health-score benchmark pipe—so the (1Y) label matches the data. Unit tests lock in the pipe, date range, label, formatting, and 404 behavior.

Health Score v1 deprecation in the UI/docs: the project overview methodology banner is removed (component deleted), and the health score docs drop the “How This Differs from the Previous Health Score” section plus wording about replacing the old composite score.

Reviewed by Cursor Bugbot for commit cba5550. Bugbot is set up for automated code reviews on this repo. Configure here.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The functional changes are consistent and tested; only a non-blocking comment-style cleanup remains.

1 open finding
What changed in this PR

Aligns the active-contributors badge with the share preview’s 365-day calculation and removes obsolete Health Score v1 messaging.

Changes:

  • Queries active_contributors using the expected filters and date window.
  • Adds badge behavior and error-path tests.
  • Removes legacy Health Score comparison documentation and banner UI.
File Description
frontend/​server/​api/​badge/​active-contributors.ts Uses the 365-day active-contributors query.
frontend/​server/​api/​badge/​active-contributors.test.ts Tests query parameters, formatting, and 404 behavior.
frontend/​docs/​metrics/​health-score/​index.md Removes v1 comparison content.
frontend/​app/​components/​modules/​project/​views/​overview.vue Removes the methodology banner usage.
frontend/​app/​components/​modules/​project/​components/​overview/​health-score-banner.vue Deletes the obsolete banner component.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.


<!-- TEMPORARILY HIDDEN (IN-1243): original intro described three assessments: "LFX Insights surfaces up to **three independent assessments** for open source projects: a **Lifecycle state**, a **Health Score**, and when applicable an **Impact Score**. Together, these replace the previous single composite score and answer three distinct questions:" Re-enable by uncommenting and removing the two-assessment replacement below. -->
LFX Insights surfaces **two independent assessments** for open source projects: a **Lifecycle state** and a **Health Score**. Together, these replace the previous single composite score and answer two distinct questions:
<!-- TEMPORARILY HIDDEN (IN-1243): original intro described three assessments: "LFX Insights surfaces up to **three independent assessments** for open source projects: a **Lifecycle state**, a **Health Score**, and when applicable an **Impact Score**. Together, they answer three distinct questions:" Re-enable by uncommenting and removing the two-assessment replacement below. -->

@themarolt themarolt left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

lgtm

…-copy-badge

Signed-off-by: Gašper Grom <gasper.grom@gmail.com>
Copilot AI balanced review requested due to automatic review settings October 13, 2026 13:15
@gaspergrom
gaspergrom merged commit eb52435 into main Oct 13, 2026
13 checks passed
@gaspergrom
gaspergrom deleted the fix/IN-1222-health-v1-copy-badge branch October 13, 2026 13:16

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The functional changes are consistent with the share preview and adequately tested.

1 open finding

🧠 Review effort: Balanced

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants