Skip to content

fix: match repo urls case-insensitively when linking packages for impact (IN-1420) - #4823

Merged
joanagmaia merged 9 commits into
mainfrom
fix/IN-1420-impact-case-insensitive-repo-url
Sep 30, 2026
Merged

joanagmaia merged 9 commits into
mainfrom
fix/IN-1420-impact-case-insensitive-repo-url

Conversation

@joanagmaia

Copy link
Copy Markdown
Contributor

Summary

  • Repo-to-package linking in the impact pipes joined repos on an exact, case-sensitive URL, so projects whose repo URL differs only by casing (e.g. BerriAI/litellm) got no packages and no impact data.
  • Both project_insights_impact_breakdown_copy.pipe and health_score_v2_impact.pipe now join on lower(url).

Impact

  • ~2,189 projects gain linked packages. Verified on the live query: berriai-litellm goes from NULL to 2,330 direct dependents / impact 40.6; k8s is unchanged.
  • Go/NuGet transitive inflation (cycles in the requirements graph) is out of scope.

Jira: https://linuxfoundation.atlassian.net/browse/IN-1420

…act (IN-1420)

Signed-off-by: Joana Maia <jmaia@contractor.linuxfoundation.org>
Copilot AI balanced review requested due to automatic review settings September 29, 2026 17:10
@cursor

cursor Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

PR Summary

Medium Risk
Changes nightly Tinybird COPY logic that drives health impact scores and project impact breakdowns for thousands of projects; scoped to GitHub/GitLab casing but still alters published analytics values.

Overview
Impact materialization pipes were failing to link packages when a project’s repositories.url and repos.url differed only by casing on GitHub or GitLab, leaving impact metrics NULL for those projects.

health_score_v2_impact.pipe and project_insights_impact_breakdown_copy.pipe now match repositories → repos with lower(url) only when domain(url) is github.com or gitlab.com; other hosts still use exact URL equality.

The project impact breakdown pipe also filters out deleted repos (rep.deletedAt IS NULL) and rolls up metrics via a project_packages subquery so the LEFT JOIN chain still emits every project (including those with no linked packages) before joining package metrics.

Reviewed by Cursor Bugbot for commit 7ede3d0. 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.

Copilot review overview

🟡 Changes recommended

Unconditional lowercasing can incorrectly merge distinct repositories on case-sensitive hosts.

Review effort: Balanced
Findings: 2 Medium severity

Open (2)
What changed in this PR

Updates Tinybird impact pipelines to match repository URLs case-insensitively when linking packages.

Changes:

  • Applies lowercase URL matching to project and health-score impact calculations.
File Description
project_insights_impact_breakdown_copy.pipe Makes package-impact URL matching case-insensitive.
health_score_v2_impact.pipe Makes health-score package linking case-insensitive.

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

Comment thread services/libs/tinybird/pipes/health_score_v2_impact.pipe Outdated
Comment thread services/libs/tinybird/pipes/project_insights_impact_breakdown_copy.pipe Outdated
…420)

Signed-off-by: Joana Maia <jmaia@contractor.linuxfoundation.org>
Copilot AI review requested due to automatic review settings September 29, 2026 17:15

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.

Copilot review overview

🟡 Changes recommended

Both host checks remain case-sensitive, so mixed-case GitHub/GitLab hostnames still fail to link.

Review effort: Balanced
Findings: 2 Medium severity

Open (2)
Resolved since last review (2)

Comment thread services/libs/tinybird/pipes/health_score_v2_impact.pipe Outdated
Comment thread services/libs/tinybird/pipes/project_insights_impact_breakdown_copy.pipe Outdated

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ 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 b2e8b05. Configure here.

Comment thread services/libs/tinybird/pipes/health_score_v2_impact.pipe Outdated
Signed-off-by: Joana Maia <jmaia@contractor.linuxfoundation.org>

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

LGTM. I checked both join sites against the packageRepos path. The GROUP BY with max() keeps the score stable even if two rows match, and the host restriction keeps other hosts on exact matching. health_score_v2_security, lifecycle and development still join repos on the exact URL, so a follow-up there would keep the scores consistent. lower(domain(...)) would also cover uppercase hosts.

Copilot AI balanced review requested due to automatic review settings September 29, 2026 17:20

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.

Copilot review overview

🟢 Approval recommended

The host-scoped normalization correctly addresses the reported casing mismatch without changing other-host semantics.

Review effort: Balanced
Findings: None

Resolved since last review (2)

Signed-off-by: Joana Maia <jmaia@contractor.linuxfoundation.org>
Copilot AI balanced review requested due to automatic review settings September 29, 2026 17:24

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.

Copilot review overview

🟡 Changes recommended

The join incorrectly lowercases self-hosted GitLab repository URLs on only one side, breaking existing exact matches.

Review effort: Balanced
Findings: 2 Medium severity

Open (2)

Comment thread services/libs/tinybird/pipes/health_score_v2_impact.pipe Outdated
Comment thread services/libs/tinybird/pipes/project_insights_impact_breakdown_copy.pipe Outdated
…1420)

Signed-off-by: Joana Maia <jmaia@contractor.linuxfoundation.org>
Copilot AI balanced review requested due to automatic review settings September 29, 2026 17:29

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.

Copilot review overview

🟡 Changes recommended

The project breakdown query can include soft-deleted case variants and double-count package downloads.

Review effort: Balanced
Findings: 1 High severity

Open (1)
Resolved since last review (2)

Comment thread services/libs/tinybird/pipes/project_insights_impact_breakdown_copy.pipe Outdated
…-1420)

Signed-off-by: Joana Maia <jmaia@contractor.linuxfoundation.org>
Copilot AI balanced review requested due to automatic review settings September 29, 2026 17:48

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.

Copilot review overview

🟢 Approval recommended

The host-scoped normalization and deletion filter address the identified correctness issues without changing matching semantics for other hosts.

Review effort: Balanced
Findings: None

Resolved since last review (1)

Copilot AI balanced review requested due to automatic review settings September 30, 2026 08:32

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.

Copilot review overview

🟡 Changes recommended

GitLab case-duplicate repo rows can fan out package joins and inflate summed downloads.

Review effort: Balanced
Findings: 1 Medium severity

Open (1)

Comment thread services/libs/tinybird/pipes/project_insights_impact_breakdown_copy.pipe Outdated
…down (IN-1420)

Signed-off-by: Joana Maia <jmaia@contractor.linuxfoundation.org>
Copilot AI balanced review requested due to automatic review settings September 30, 2026 08:40

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.

Copilot review overview

🟢 Approval recommended

The URL matching fix is correctly scoped and all prior correctness concerns are addressed.

Review effort: Balanced
Findings: None

Resolved since last review (1)

Copilot AI balanced review requested due to automatic review settings September 30, 2026 10:54

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.

Copilot review overview

🟢 Approval recommended

The URL matching is correctly host-scoped, and all previous correctness concerns are addressed.

Review effort: Balanced
Findings: None

@joanagmaia
joanagmaia merged commit 09614a2 into main Sep 30, 2026
15 checks passed
@joanagmaia
joanagmaia deleted the fix/IN-1420-impact-case-insensitive-repo-url branch September 30, 2026 11:01
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