Skip to content

fix: normalize repo url in rubygems - #4330

Merged
mbani01 merged 2 commits into
mainfrom
fix/normalize_repo_url_in_rubygems
Jul 13, 2026
Merged

fix: normalize repo url in rubygems#4330
mbani01 merged 2 commits into
mainfrom
fix/normalize_repo_url_in_rubygems

Conversation

@mbani01

@mbani01 mbani01 commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

This pull request introduces enhancements to the RubyGems package normalization and synchronization process, focusing on improved repository URL handling and integration with the repository database. The changes ensure that repository URLs are consistently canonicalized, stored, and linked to packages in the database.

Repository URL handling and database integration:

  • normalizeRubyGemsPackage now canonicalizes the declaredRepositoryUrl using canonicalizeRepoUrl and adds a new repo field to the normalized package object. [1] [2] [3] [4]
  • When processing a package, if a canonicalized repository is present, the code creates or updates the repository entry in the database (getOrCreateRepoByUrl) and links it to the package using upsertPackageRepo. [1] [2]

Data model and synchronization improvements:

  • The NormalizedRubyGemsPackage type is updated to include the new repo field, reflecting the canonicalized repository information.
  • The package synchronization process now saves the canonicalized repository URL as repositoryUrl and ensures all relevant changes are tracked.

These updates improve the reliability and consistency of repository data associated with RubyGems packages.


Note

Medium Risk
Touches package upsert and repo linkage in the ingestion transaction; bad canonicalization could mis-associate repos, but the pattern matches existing npm/PyPI workers.

Overview
RubyGems ingestion now canonicalizes source_code_uri via canonicalizeRepoUrl and exposes the result on normalized packages as a repo field (alongside the raw declaredRepositoryUrl).

During sync, when a canonical repo exists, the worker persists repositoryUrl on the package, upserts the repo row with getOrCreateRepoByUrl, and links package↔repo with upsertPackageRepo (declared, confidence 0.8), with those changes folded into audit tracking like other ecosystems.

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

mbani01 added 2 commits July 13, 2026 10:58
Signed-off-by: Mouad BANI <mouad-mb@outlook.com>
Signed-off-by: Mouad BANI <mouad-mb@outlook.com>
@mbani01 mbani01 self-assigned this Jul 13, 2026
Copilot AI review requested due to automatic review settings July 13, 2026 10:11
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@github-actions

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.

Conventional Commits FTW!

@mbani01 mbani01 changed the title Fix/normalize repo url in rubygems fix: normalize repo url in rubygems Jul 13, 2026

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

Adds canonical RubyGems repository URL storage and package-to-repository linking.

Changes:

  • Canonicalizes source_code_uri.
  • Persists canonical URLs and repository relationships.

Blocking: Stale declared-repository links are not reconciled. The PR title also lacks the required Conventional Commit format and JIRA key.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
rubygems/types.ts Adds canonical repository metadata.
rubygems/normalize.ts Canonicalizes declared repository URLs.
rubygems/runRubyGemsCoreLoop.ts Stores and links repositories.

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

})
pkgChanged.forEach((f) => changed.add(f))

if (normalized.repo) {
@mbani01
mbani01 merged commit 20104c8 into main Jul 13, 2026
20 of 23 checks passed
@mbani01
mbani01 deleted the fix/normalize_repo_url_in_rubygems branch July 13, 2026 10:36
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