Skip to content

chore(licenses):SP-4211 Add err_message and error_code fields to Comp…#68

Merged
agustingroh merged 2 commits intomainfrom
chore/SP-4211-add-per-component-error-response-status-license-response
Apr 1, 2026
Merged

chore(licenses):SP-4211 Add err_message and error_code fields to Comp…#68
agustingroh merged 2 commits intomainfrom
chore/SP-4211-add-per-component-error-response-status-license-response

Conversation

@agustingroh
Copy link
Copy Markdown
Contributor

@agustingroh agustingroh commented Mar 30, 2026

…onentLicenseInfo message

Summary by CodeRabbit

  • New Features

    • Component license API responses now include per-component error messages and structured error codes, a component-level URL, and richer license details (approval flag and license URL).
  • Documentation

    • API docs and examples updated to show the new license fields and an “error in component” response example; changelog updated for the 0.34.0 release.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 30, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 337163b8-8848-47d4-96dc-5373a61f13ed

📥 Commits

Reviewing files that changed from the base of the PR and between 538cd04 and 685bbe8.

⛔ Files ignored due to path filters (1)
  • api/licensesv2/scanoss-licenses.pb.go is excluded by !**/*.pb.go
📒 Files selected for processing (4)
  • CHANGELOG.md
  • protobuf/scanoss/api/licenses/v2/README.md
  • protobuf/scanoss/api/licenses/v2/scanoss-licenses.proto
  • protobuf/scanoss/api/licenses/v2/scanoss-licenses.swagger.json
✅ Files skipped from review due to trivial changes (1)
  • CHANGELOG.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • protobuf/scanoss/api/licenses/v2/scanoss-licenses.proto

📝 Walkthrough

Walkthrough

Add per-component error reporting and richer license metadata: ComponentLicenseInfo gains error_message, error_code, and component_url; LicenseInfo gains is_spdx_approved and url. Documentation and OpenAPI examples updated; changelog includes a 0.34.0 entry.

Changes

Cohort / File(s) Summary
Documentation & Changelog
CHANGELOG.md, protobuf/scanoss/api/licenses/v2/README.md
Added v0.34.0 changelog entry and updated API README examples to show component.component_url, per-component error example (component.error_message, component.error_code), and expanded license objects with is_spdx_approved and url.
Protobuf Definitions
protobuf/scanoss/api/licenses/v2/scanoss-licenses.proto
Extended LicenseInfo with bool is_spdx_approved and string url; extended ComponentLicenseInfo with optional string error_message, optional common.v2.ErrorCode error_code, and required string component_url; updated schema descriptions/examples.
OpenAPI / Swagger
protobuf/scanoss/api/licenses/v2/scanoss-licenses.swagger.json
Added v2ErrorCode enum and extended v2ComponentLicenseInfo with error_message, error_code, and component_url; extended v2LicenseInfo with is_spdx_approved and url; updated response examples and descriptions to show success + per-component error cases.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested reviewers

  • isasmendiagus
  • eeisegn

Poem

🐰 I hopped through lines of proto and text,

components speak now when things go vexed,
licenses show links and SPDX lights,
errors wear codes in debug nights,
a tiny rabbit cheers these specs 🥕📜

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title is truncated and doesn't fully convey the complete scope of changes, which include not just error fields but also component_url, is_spdx_approved, and url fields across multiple messages. Clarify whether the truncated title is intentional; consider expanding to reflect all substantive additions: 'Add license and component fields with error handling to license API response messages.'
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ 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-4211-add-per-component-error-response-status-license-response

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

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

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
protobuf/scanoss/api/licenses/v2/README.md (1)

130-148: Clarify top-level status semantics in this section.

Consider adding one sentence that status: "SUCCESS" means the request was processed, while per-component failures are conveyed via error_code/error_message. That avoids client-side misinterpretation.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@protobuf/scanoss/api/licenses/v2/README.md` around lines 130 - 148, In the
"Error in component" section of the README add a single clarifying sentence
after the JSON example stating that the top-level status (e.g., "status":
"SUCCESS") indicates the overall request was processed, while per-component
failures are reported via the component's error_code and error_message fields so
clients should not treat a SUCCESS top-level status as every component
succeeded.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@CHANGELOG.md`:
- Around line 10-14: Change the dated release header in CHANGELOG.md that
currently reads "## [0.34.0] - 2026-03-31" to use an "Unreleased" header instead
(e.g., "## [Unreleased]" or "## [0.34.0] - Unreleased") so pending changes are
not pre-dated; update the same block that lists the two Added items (the
`error_message`/`error_code` addition and the README example) and ensure any
release tooling references the Unreleased section until the real release date.

---

Nitpick comments:
In `@protobuf/scanoss/api/licenses/v2/README.md`:
- Around line 130-148: In the "Error in component" section of the README add a
single clarifying sentence after the JSON example stating that the top-level
status (e.g., "status": "SUCCESS") indicates the overall request was processed,
while per-component failures are reported via the component's error_code and
error_message fields so clients should not treat a SUCCESS top-level status as
every component succeeded.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 606ceb10-3c10-43de-9d2e-7d353b6ac87f

📥 Commits

Reviewing files that changed from the base of the PR and between 18879cc and 538cd04.

⛔ Files ignored due to path filters (1)
  • api/licensesv2/scanoss-licenses.pb.go is excluded by !**/*.pb.go
📒 Files selected for processing (4)
  • CHANGELOG.md
  • protobuf/scanoss/api/licenses/v2/README.md
  • protobuf/scanoss/api/licenses/v2/scanoss-licenses.proto
  • protobuf/scanoss/api/licenses/v2/scanoss-licenses.swagger.json

@agustingroh agustingroh force-pushed the chore/SP-4211-add-per-component-error-response-status-license-response branch from 538cd04 to 685bbe8 Compare April 1, 2026 11:01
Copy link
Copy Markdown
Contributor

@scanoss-qg scanoss-qg left a comment

Choose a reason for hiding this comment

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

LGTM

@agustingroh agustingroh merged commit ebee3cc into main Apr 1, 2026
4 checks passed
@agustingroh agustingroh deleted the chore/SP-4211-add-per-component-error-response-status-license-response branch April 1, 2026 11:43
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