Skip to content

Conversation

@ctron
Copy link
Contributor

@ctron ctron commented Nov 6, 2025

Summary by Sourcery

Add and document a new sample_data flag in the profile API to enable injection of example importer configurations during startup

New Features:

  • Add a sample_data CLI flag to inject example importer configurations at startup

Documentation:

  • Document the sample_data flag in the Run struct
  • Add doc comment for the sample_data function explaining its behavior

@ctron ctron requested a review from gildub November 6, 2025 09:35
@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Nov 6, 2025

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

This PR adds documentation for the new sample_data CLI switch in the Run struct and annotates the sample_data function with a descriptive doc comment.

Class diagram for updated Run struct with sample_data switch

classDiagram
    class Run {
        +bool devmode
        +bool sample_data
    }
Loading

Class diagram for sample_data function documentation

classDiagram
    class sample_data {
        +sample_data(db: Database): Result
    }
Loading

File-Level Changes

Change Details Files
Document sample_data CLI switch
  • Add doc comment on sample_data flag in Run struct
  • Include sample_data in arg attributes for CLI help
server/src/profile/api.rs
Annotate sample_data function
  • Insert /// Insert example importers, ignoring existing ones above function
server/src/sample_data.rs

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@ctron ctron enabled auto-merge November 6, 2025 09:36
@ctron ctron added the backport release/0.4.z Backport (0.4.z) label Nov 6, 2025
Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey there - I've reviewed your changes and they look great!

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location> `server/src/sample_data.rs:173` </location>
<code_context>
     .await
 }

+/// Insert example importers, ignoring existing ones
 pub async fn sample_data(db: trustify_common::db::Database) -> anyhow::Result<()> {
     let importer = ImporterService::new(db);
</code_context>

<issue_to_address>
**suggestion:** The doc comment could clarify what 'ignoring existing ones' means.

Please clarify whether existing importers are skipped, updated, or left unchanged to improve the doc comment's precision.

```suggestion
/**
 * Insert example importers.
 *
 * Existing importers are left unchanged; only new importers are inserted.
 * Importers that already exist are skipped and not updated.
 */
```
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@codecov
Copy link

codecov bot commented Nov 6, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 68.02%. Comparing base (2381bef) to head (73679b0).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2084      +/-   ##
==========================================
- Coverage   68.03%   68.02%   -0.01%     
==========================================
  Files         367      367              
  Lines       20590    20590              
  Branches    20590    20590              
==========================================
- Hits        14008    14007       -1     
+ Misses       5746     5742       -4     
- Partials      836      841       +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ctron ctron added this pull request to the merge queue Nov 6, 2025
Merged via the queue into guacsec:main with commit b9dfe4f Nov 6, 2025
8 checks passed
@ctron ctron deleted the feature/docs_1 branch November 6, 2025 14:26
@trustify-ci-bot
Copy link

Successfully created backport PR for release/0.4.z:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport release/0.4.z Backport (0.4.z)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants