feat: repos collaboration signal [CM-1332] - #4404
Conversation
Signed-off-by: Mouad BANI <mouad-mb@outlook.com>
Signed-off-by: Mouad BANI <mouad-mb@outlook.com>
Signed-off-by: Mouad BANI <mouad-mb@outlook.com>
Signed-off-by: Mouad BANI <mouad-mb@outlook.com>
PR SummaryMedium Risk Overview Activity enrichment now requests After each full enrichment sweep, Reviewed by Cursor Bugbot for commit 4ba2b92. Bugbot is set up for automated code reviews on this repo. Configure here. |
|
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 4ba2b92. Configure here.
| BOOL_OR(EXISTS ( | ||
| SELECT 1 FROM advisory_affected_ranges rg | ||
| WHERE rg.advisory_package_id = ap.id AND rg.fixed_version IS NOT NULL | ||
| )) AS any_fixed, |
There was a problem hiding this comment.
Soft-deleted fixes inflate score
Medium Severity
The any_fixed check reads advisory_affected_ranges without filtering deleted_at IS NULL. Soft-deleted ranges (from OSV reconcile or deps.dev supersede) still count as fixes, so comp_a can stay 1.0 after a fix was removed or superseded and inflate the collaboration score.
Reviewed by Cursor Bugbot for commit 4ba2b92. Configure here.
There was a problem hiding this comment.
Pull request overview
Adds repository collaboration scoring based on external PRs, issue responsiveness, and advisory status.
Changes:
- Collects and persists external PR metrics.
- Computes collaboration scores and tiers for critical repositories.
- Recomputes signals after enrichment sweeps.
Metadata: PR title should end with (CM-1332), not [CM-1332].
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
updateRepoActivitySnapshot.ts |
Persists external PR counts. |
updateCollaborationSignal.ts |
Computes and stores collaboration signals. |
types.ts |
Types external PR metrics. |
runEnrichmentLoop.ts |
Schedules signal recomputation. |
fetchActivitySnapshot.ts |
Fetches PR author associations. |
computeMedians.ts |
Counts non-maintainer PRs. |
V1785167431__collaboration_signal.sql |
Adds collaboration columns. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| SET collaboration_score = f.new_score, | ||
| collaboration_tier = f.new_tier |
| SELECT 1 FROM advisory_affected_ranges rg | ||
| WHERE rg.advisory_package_id = ap.id AND rg.fixed_version IS NOT NULL |


This pull request introduces a new "collaboration signal" for repositories, which is calculated based on recent external pull request activity, issue responsiveness, and advisory status. It adds new fields to the database, updates the enrichment pipeline to collect and store external PR metrics, and includes a scoring/tiering mechanism that is periodically recomputed. These changes improve the system's ability to assess and track repository collaboration health.
Database Schema Changes:
external_prs_opened_12mandexternal_prs_merged_12mcolumns torepo_activity_snapshot, andcollaboration_scoreandcollaboration_tiercolumns toreposto support collaboration signal tracking.Data Collection and Enrichment:
repo_activity_snapshot. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]Collaboration Signal Computation:
updateCollaborationSignalfunction, which computes a collaboration score and tier for each critical repository based on responsiveness, external PR activity, and advisory status, and updates these values in therepostable.Pipeline Integration:
These changes provide a more nuanced and up-to-date view of repository collaboration health, enabling better insights and prioritization.