Skip to content

feat: get rubygems owners as security-contacts [CM-1241] - #4328

Merged
mbani01 merged 5 commits into
mainfrom
feat/extend_security_contacts_for_rubygems
Jul 13, 2026
Merged

feat: get rubygems owners as security-contacts [CM-1241]#4328
mbani01 merged 5 commits into
mainfrom
feat/extend_security_contacts_for_rubygems

Conversation

@mbani01

@mbani01 mbani01 commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

This pull request enhances the RubyGems extractor in the packages_worker service to improve the discovery of maintainer contact information. The main improvement is the addition of logic to fetch and process owner email addresses from the RubyGems registry, supplementing the previous extraction from the gem metadata. This increases the accuracy and coverage of maintainer contact extraction.

Enhancements to RubyGems contact extraction:

  • Added a new function mapRubygemsOwners to extract maintainer emails from the RubyGems owners API, ensuring only valid and unique email addresses are included.
  • Updated fetchRubygems to fetch both the gem metadata and the owners list, merging contacts from both sources while avoiding duplicates.
  • Improved robustness of the fetch logic by gracefully handling failures when retrieving the owners list.
  • Updated imports to include the isEmail utility for validating email addresses.

Note

Low Risk
Adds outbound registry reads and more maintainer email data in the security-contacts pipeline; no auth or persistence schema changes in this diff.

Overview
RubyGems security-contact extraction now pulls maintainer emails from the registry owners API in addition to emails embedded in gem authors metadata.

fetchRubygems parallel-fetches gems/{name}.json and gems/{name}/owners.json, merges both contact lists, and treats owners fetch failures as non-fatal so gem metadata still works. New mapRubygemsOwners validates emails with isEmail, dedupes case-insensitively, and maps RubyGems handle to contact name (not handle) so it is not mistaken for a GitHub login during identity merge.

The RubyGems package ingestion Temporal workflow raises activity startToCloseTimeout from 30 to 60 minutes, likely to accommodate the extra registry work per batch.

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

@mbani01 mbani01 self-assigned this Jul 13, 2026
Copilot AI review requested due to automatic review settings July 13, 2026 08:22
@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.

Signed-off-by: Mouad BANI <mouad-mb@outlook.com>
@mbani01
mbani01 force-pushed the feat/extend_security_contacts_for_rubygems branch from 8640054 to 68a00e4 Compare July 13, 2026 08:24
@mbani01 mbani01 changed the title feat: get rubygems owners as security-contacts feat: get rubygems owners as security-contacts [CM-1241] 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 RubyGems owner emails to security-contact extraction alongside gem metadata.

Changes:

  • Fetches gem metadata and owners concurrently.
  • Validates and deduplicates owner emails.
  • Tolerates owner API failures.

Review note: Owner metadata can be lost during deduplication, and transient failures can remove existing contacts. The PR title also lacks the required JIRA key.


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

Copilot AI review requested due to automatic review settings July 13, 2026 08:25
Signed-off-by: Mouad BANI <mouad-mb@outlook.com>

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

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

Signed-off-by: Mouad BANI <mouad-mb@outlook.com>
Copilot AI review requested due to automatic review settings July 13, 2026 08:33

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

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

Comment thread services/apps/packages_worker/src/rubygems/workflows.ts
Signed-off-by: Mouad BANI <mouad-mb@outlook.com>
Copilot AI review requested due to automatic review settings July 13, 2026 08:50

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

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

Comment on lines +81 to +84
fetchJson(ownersUrl, timeoutMs, registryHeaders(userAgent)).catch(() => ({
status: 0,
json: null,
})),

const acts = proxyActivities<typeof activities>({
startToCloseTimeout: '30 minutes',
startToCloseTimeout: '60 minutes',
Copilot AI review requested due to automatic review settings July 13, 2026 09:35
@mbani01
mbani01 merged commit a4d2422 into main Jul 13, 2026
13 checks passed
@mbani01
mbani01 deleted the feat/extend_security_contacts_for_rubygems branch July 13, 2026 09:36

@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

Reviewed by Cursor Bugbot for commit 87c24a3. Configure here.

status: 0,
json: null,
})),
])

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Gem failure drops owner contacts

Medium Severity

fetchRubygems loads gem metadata and owners in parallel via Promise.all, but only the owners fetchJson call is wrapped in .catch. When the gem request errors (timeout, rate limit after retries, or non-absent HTTP status), the whole Promise.all rejects and owner emails from a successful owners response are never merged.

Fix in Cursor Fix in Web

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

Pull request overview

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

Comment on lines +79 to +84
const [gemResult, ownersResult] = await Promise.all([
fetchJson(gemUrl, timeoutMs, registryHeaders(userAgent)),
fetchJson(ownersUrl, timeoutMs, registryHeaders(userAgent)).catch(() => ({
status: 0,
json: null,
})),

const acts = proxyActivities<typeof activities>({
startToCloseTimeout: '30 minutes',
startToCloseTimeout: '60 minutes',
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