Skip to content

Conversation

matiasdaloia
Copy link
Contributor

@matiasdaloia matiasdaloia commented Jul 22, 2025

Summary by CodeRabbit

  • New Features

    • Added a new CLI subcommand to export SBOM files directly to Dependency Track.
    • Introduced CycloneDX JSON file validation functionality.
  • Chores

    • Updated dependencies to include CycloneDX validation support.
    • Incremented the application version to 1.30.0.
    • Updated the changelog with new features and version details.

@matiasdaloia matiasdaloia self-assigned this Jul 22, 2025
@matiasdaloia matiasdaloia requested a review from agustingroh July 22, 2025 05:32
@matiasdaloia matiasdaloia added the enhancement New feature or request label Jul 22, 2025
Copy link

coderabbitai bot commented Jul 22, 2025

Caution

Review failed

An error occurred during the review process. Please try again later.

Walkthrough

This update introduces a new "export dt" CLI subcommand for exporting SBOM files to Dependency Track, adds CycloneDX file validation functionality, and bumps the project version to 1.30.0. It also adds the required dependency for CycloneDX validation and documents the changes in the changelog.

Changes

File(s) Change Summary
CHANGELOG.md Added 1.30.0 release notes: new "export dt" subcommand, CycloneDX validation, and version link.
requirements.txt, setup.cfg Added cyclonedx-python-lib[validation] as a new dependency.
src/scanoss/init.py Updated __version__ from 1.29.0 to 1.30.0.
src/scanoss/cli.py Added "export" subcommand group with "dt" subcommand for Dependency Track export; parser updates.
src/scanoss/cyclonedx.py Added CycloneDX JSON validation method; minor formatting changes.
src/scanoss/export/init.py New module, exports DependencyTrackExporter.
src/scanoss/export/dependency_track.py New module: Dependency Track exporter class, config dataclass, and upload logic.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant CLI
    participant DependencyTrackExporter
    participant DependencyTrack API

    User->>CLI: scanoss export dt --input INPUT --dt-url URL --dt-apikey KEY ...
    CLI->>DependencyTrackExporter: Initialize with config and flags
    CLI->>DependencyTrackExporter: upload_sbom(INPUT)
    DependencyTrackExporter->>DependencyTrackExporter: Read and validate SBOM (CycloneDX)
    DependencyTrackExporter->>DependencyTrackExporter: Encode SBOM as base64
    DependencyTrackExporter->>DependencyTrack API: PUT /api/v1/bom with payload
    DependencyTrack API-->>DependencyTrackExporter: Response (success/failure)
    DependencyTrackExporter-->>CLI: Success/failure result
    CLI-->>User: Print result or error
Loading

Estimated code review effort

3 (~45 minutes)

Suggested reviewers

  • scanossmining
  • eeisegn

Poem

A new command hops in, "export dt" in tow,
To Dependency Track, your SBOMs now go!
CycloneDX checked, with validation in place,
Version bumped up, we're keeping the pace.
🐇✨

Hop along, dear code, to new export delight—
The future is bright, and the changelog is right!


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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@matiasdaloia matiasdaloia changed the title feat: add export dt sub-command, add cyclonedx input file validation [SP-2879] feat: add export dt sub-command, add cyclonedx input file validation Jul 22, 2025
@matiasdaloia matiasdaloia force-pushed the feature/mdaloia/SP-2879-Add-DepTrack-SBOM-upload-to-scanoss-py branch from b6cb249 to 026a627 Compare July 22, 2025 05:33
@matiasdaloia matiasdaloia merged commit f36a713 into main Jul 22, 2025
3 of 4 checks passed
@matiasdaloia matiasdaloia deleted the feature/mdaloia/SP-2879-Add-DepTrack-SBOM-upload-to-scanoss-py branch July 22, 2025 10:31
@coderabbitai coderabbitai bot mentioned this pull request Aug 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants