Chore/sp 4371 add get source purl method#13
Conversation
…PURL data for a component
|
Warning Rate limit exceeded
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 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 configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (6)
📝 WalkthroughWalkthroughThis 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
Sequence DiagramsequenceDiagram
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
Estimated Code Review Effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly Related PRs
Suggested Reviewers
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Review rate limit: 0/1 reviews remaining, refill in 54 minutes and 53 seconds.Comment |
…etrieve project data by PURL
8ad0693 to
cefd6ff
Compare
Summary by CodeRabbit
Release Notes - Version 0.10.0
New Features
Database Updates
Error Handling