Skip to content

Chore/sp 4371 add get source purl method#13

Closed
agustingroh wants to merge 3 commits intomainfrom
chore/SP-4371-add-get-source-purl-method
Closed

Chore/sp 4371 add get source purl method#13
agustingroh wants to merge 3 commits intomainfrom
chore/SP-4371-add-get-source-purl-method

Conversation

@agustingroh
Copy link
Copy Markdown
Contributor

@agustingroh agustingroh commented Apr 30, 2026

Summary by CodeRabbit

Release Notes - Version 0.10.0

  • New Features

    • Added project retrieval capability by package URL (PURL) with enriched data including mine information
    • Added source package URL lookup for components with source mine, vendor, and repository details
  • Database Updates

    • Extended schema to track source mine information and repository URLs for improved data tracking
  • Error Handling

    • Added new error types for missing projects and source PURLs

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 30, 2026

Warning

Rate limit exceeded

@agustingroh has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 54 minutes and 53 seconds before requesting another review.

To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: f08d411b-dcbf-4681-a320-00277c1cb318

📥 Commits

Reviewing files that changed from the base of the PR and between 8ad0693 and cefd6ff.

📒 Files selected for processing (6)
  • CHANGELOG.md
  • internal/testutils/mock/mines.sql
  • pkg/models/projects.go
  • pkg/scanoss/client.go
  • pkg/services/project.go
  • pkg/types/types.go
📝 Walkthrough

Walkthrough

This change introduces project retrieval capabilities and source PURL functionality for the 0.10.0 release. Database schemas are extended with additional fields, ProjectModel gains GetSourcePurl and GetProjectByPurl methods, a new ProjectService is created for project lookups, ComponentService receives a GetSourcePurl method, corresponding response types are defined, and the client is updated to expose ProjectService.

Changes

Cohort / File(s) Summary
Schema Extensions
internal/testutils/mock/all_urls.sql, internal/testutils/mock/mines.sql
Added is_mined boolean column to all_urls table and repository_url text column to mines table to support source PURL tracking.
Project Model Layer
pkg/models/projects.go
Expanded Project struct with mine/PURL metadata fields (MineID, PurlType, Vendor) and source-mine attributes. Added SourcePurlRow join struct and new methods GetSourcePurl and GetProjectByPurl with joined mines queries using COALESCE for nullable fields.
Service Layer
pkg/services/component.go, pkg/services/project.go
Added GetSourcePurl method to ComponentService with PURL parsing and sentinel error ErrSourcePurlNotFound. Introduced new ProjectService with GetProject method handling PURL-based project lookup, error conversion, and ErrProjectNotFound sentinel.
Type Definitions
pkg/types/types.go
Added Project response type with source-mine fields as pointers and omitempty tags; added SourcePurl struct for join data mapping.
Client Integration
pkg/scanoss/client.go
Extended scanoss.Client with exported Project field, initialized with ProjectService in constructor.
Documentation
CHANGELOG.md
Documented 0.10.0 release features: GetSourcePurl functionality, ProjectService capabilities, new sentinel errors, and model field expansions.

Sequence Diagram

sequenceDiagram
    participant Client
    participant ProjectService
    participant ProjectModel
    participant Database

    Client->>ProjectService: GetProject(ctx, purl)
    ProjectService->>ProjectService: Parse PURL (name, type)
    ProjectService->>ProjectModel: GetProjectByPurl(ctx, purlName, purlType)
    ProjectModel->>Database: Query (projects JOIN mines ON source) with COALESCE
    Database-->>ProjectModel: Project row with mine/source fields
    alt No rows found
        ProjectModel-->>ProjectService: sql.ErrNoRows
        ProjectService-->>Client: ErrProjectNotFound
    else Success
        ProjectModel-->>ProjectService: Project struct (filled)
        ProjectService-->>ProjectService: Map to types.Project
        ProjectService-->>Client: types.Project (with pointers for nullable fields)
    end
Loading

Estimated Code Review Effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly Related PRs

Suggested Reviewers

  • isasmendiagus
  • scanoss-qg

🐰 New PURL paths now open wide,
Projects and sources side by side!
With mines joined true and pointers neat,
This 0.10.0 release is complete! 🎉

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the primary change: adding a new GetSourcePurl method across ComponentService and ProjectModel, though it uses 'source purl' in lowercase.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/SP-4371-add-get-source-purl-method

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
Review rate limit: 0/1 reviews remaining, refill in 54 minutes and 53 seconds.

Comment @coderabbitai help to get the list of available commands and usage tips.

@agustingroh agustingroh force-pushed the chore/SP-4371-add-get-source-purl-method branch from 8ad0693 to cefd6ff Compare April 30, 2026 14:10
@agustingroh agustingroh deleted the chore/SP-4371-add-get-source-purl-method branch April 30, 2026 14:53
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.

1 participant