Skip to content

Feat/track packages#4169

Merged
themarolt merged 36 commits into
mainfrom
feat/track-packages
Jun 4, 2026
Merged

Feat/track packages#4169
themarolt merged 36 commits into
mainfrom
feat/track-packages

Conversation

@themarolt

@themarolt themarolt commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Summary

Changes

Type of change

  • Bug fix
  • New feature
  • Refactor / cleanup
  • Performance improvement
  • Chore / dependency update
  • Documentation

JIRA ticket


Note

Medium Risk
Changes the host value stored and used in BQ dedup keys and Postgres ingest; downstream code that assumed full domains in host could misbehave, though canonical URLs are unchanged.

Overview
Aligns repo host identity across the packages worker so BigQuery, TypeScript helpers, and ingestion all use short forge keys (github, gitlab, bitbucket) while canonical URLs still use https://{domain}/{path}.

In canonicalRepoUrl, domain lookup is renamed to DOMAIN_BY_TYPE, GitHub lowercasing keys off type === 'GITHUB' instead of comparing the domain string, and parseRepoUrl now maps known hostnames to those short keys via HOST_BY_DOMAIN (unknown hosts still pass through as the URL hostname).

packageReposSql and reposSql compute host as the short key in intermediate CTEs and only expand to github.com / gitlab.com / bitbucket.org when building canonical_url, so dedup/partitioning on host matches what lands in staging/merge columns without changing URL shape.

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

themarolt added 30 commits May 27, 2026 13:12
Signed-off-by: Uroš Marolt <uros@marolt.me>
Signed-off-by: Uroš Marolt <uros@marolt.me>
Signed-off-by: Uroš Marolt <uros@marolt.me>
…n ecosystems

Signed-off-by: Uroš Marolt <uros@marolt.me>
Signed-off-by: Uroš Marolt <uros@marolt.me>
Signed-off-by: Uroš Marolt <uros@marolt.me>
Signed-off-by: Uroš Marolt <uros@marolt.me>
Signed-off-by: Uroš Marolt <uros@marolt.me>
Signed-off-by: Uroš Marolt <uros@marolt.me>
Signed-off-by: Uroš Marolt <uros@marolt.me>
Signed-off-by: Uroš Marolt <uros@marolt.me>
Signed-off-by: Uroš Marolt <uros@marolt.me>
Signed-off-by: Uroš Marolt <uros@marolt.me>
Signed-off-by: Uroš Marolt <uros@marolt.me>
Signed-off-by: Uroš Marolt <uros@marolt.me>
Signed-off-by: Uroš Marolt <uros@marolt.me>
Signed-off-by: Uroš Marolt <uros@marolt.me>
Signed-off-by: Uroš Marolt <uros@marolt.me>
Signed-off-by: Uroš Marolt <uros@marolt.me>
Signed-off-by: Uroš Marolt <uros@marolt.me>
Signed-off-by: Uroš Marolt <uros@marolt.me>
Signed-off-by: Uroš Marolt <uros@marolt.me>
Signed-off-by: Uroš Marolt <uros@marolt.me>
Signed-off-by: Uroš Marolt <uros@marolt.me>
Signed-off-by: Uroš Marolt <uros@marolt.me>
themarolt added 6 commits June 4, 2026 07:36
Signed-off-by: Uroš Marolt <uros@marolt.me>
Signed-off-by: Uroš Marolt <uros@marolt.me>
Signed-off-by: Uroš Marolt <uros@marolt.me>
Signed-off-by: Uroš Marolt <uros@marolt.me>
Signed-off-by: Uroš Marolt <uros@marolt.me>
Copilot AI review requested due to automatic review settings June 4, 2026 11:04
@github-actions

github-actions Bot commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

⚠️ Jira Issue Key Missing

Your PR title doesn't contain a Jira issue key. Consider adding it for better traceability.

Example:

  • feat: add user authentication (CM-123)
  • feat: add user authentication (IN-123)

Projects:

  • CM: Community Data Platform
  • IN: Insights

Please add a Jira issue key to your PR title.

@github-actions github-actions Bot 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.

PR titles must follow Conventional Commits. Love from, Your reviewers ❤️.

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.

Pull request overview

Aligns repo “host” identity across the deps.dev ingestion pipeline in packages_worker by switching stored host values from full domains (e.g. github.com) to short forge keys (e.g. github), while keeping canonical_url shapes unchanged.

Changes:

  • Update BigQuery export SQL to emit host as github|gitlab|bitbucket while still constructing canonical_url with github.com|gitlab.com|bitbucket.org.
  • Refactor canonicalRepoUrl to use a DOMAIN_BY_TYPE mapping and base GitHub lowercasing on type === 'GITHUB'.
  • Update parseRepoUrl to map known domains to short forge keys via HOST_BY_DOMAIN.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
services/apps/packages_worker/src/deps-dev/queries/reposSql.ts Exports host as a short forge key, but keeps canonical_url on the public domain.
services/apps/packages_worker/src/deps-dev/queries/packageReposSql.ts Same host canonicalization for package→repo exports; canonical_url remains domain-based.
services/apps/packages_worker/src/deps-dev/canonicalRepoUrl.ts Renames host/domain mapping, adjusts GitHub lowercasing condition, and maps parsed URL hostnames to short keys.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@themarolt
themarolt merged commit 7f2e076 into main Jun 4, 2026
16 of 19 checks passed
@themarolt
themarolt deleted the feat/track-packages branch June 4, 2026 11:26
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.

2 participants