Skip to content

chore: include underlying error when logging failed exploit intelligence job reason - #2568

Merged
Strum355 merged 1 commit into
guacsec:mainfrom
Strum355:TC-5541
Aug 12, 2026
Merged

chore: include underlying error when logging failed exploit intelligence job reason#2568
Strum355 merged 1 commit into
guacsec:mainfrom
Strum355:TC-5541

Conversation

@Strum355

@Strum355 Strum355 commented Aug 11, 2026

Copy link
Copy Markdown
Member

Previously if an EI request job failed, we would log the following which doesnt give much information:
failing job: retries exhausted job_id=019ff11e-3217-7473-938a-28743c159835 error=analysis service temporarily unavailable attempt=3 max_retries=3

With this change, we will log something as such instead:
failing job: retries exhausted job_id=019ff11d-c2c0-7151-82ff-9bb600403776 error=SPDX upload: HTTP 429 Too Many Requests: {"error": "mock upload failure (HTTP 429)"} attempt=3 max_retries=3

Fixes TC-5541

Summary by Sourcery

Improve exploit intelligence job failure handling to surface detailed underlying errors in logs and error classification.

Enhancements:

  • Preserve and propagate detailed EiRequestError information into AnalysisError instead of generic user-facing messages.
  • Simplify EI upload error mapping by directly converting EiRequestError into AnalysisError without additional logging.

@sourcery-ai

sourcery-ai Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Refines how exploit intelligence request errors are propagated into analysis errors so that logs include the full underlying error details instead of generic user-facing messages, and simplifies EI upload error handling to rely on this richer error conversion.

Sequence diagram for updated EI upload error propagation

sequenceDiagram
    participant Caller
    participant upload_sbom
    participant classify_response_error
    participant AnalysisError

    Caller->>upload_sbom: upload_sbom(label, request)
    upload_sbom->>classify_response_error: classify_response_error(label, request.send().await)
    classify_response_error-->>upload_sbom: Result<Response, EiRequestError>
    alt Ok
        upload_sbom-->>Caller: Ok(Response)
    else Err(EiRequestError)
        upload_sbom->>AnalysisError: AnalysisError::from(EiRequestError)
        AnalysisError-->>Caller: Err(AnalysisError)
    end
Loading

File-Level Changes

Change Details Files
Propagate full EiRequestError details into AnalysisError instead of using a generic user_message helper.
  • Remove EiRequestError::user_message helper that mapped internal errors to generic user-facing strings.
  • Update From for AnalysisError to pattern-match on each variant and carry through the full error or message detail.
  • Ensure transient errors become retryable analysis errors with full detail while rejected and permanent errors become permanent analysis errors, preserving underlying error for the permanent case.
modules/exploit-intelligence/src/runner/mod.rs
Simplify EI upload error handling to rely on the new AnalysisError conversion without extra logging.
  • Change upload_sbom to use map_err(AnalysisError::from) instead of wrapping EiRequestError with custom logging and manual conversion.
  • Remove the explicit tracing::warn! call on EI upload failure, relying on the richer error content for downstream logging.
modules/exploit-intelligence/src/runner/analysis.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

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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


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.

Comment thread modules/exploit-intelligence/src/runner/mod.rs

@rh-jfuller rh-jfuller left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@rh-jfuller rh-jfuller left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@Strum355
Strum355 added this pull request to the merge queue Aug 12, 2026
Merged via the queue into guacsec:main with commit 88b1c1d Aug 12, 2026
11 checks passed
@Strum355
Strum355 deleted the TC-5541 branch August 12, 2026 11:50
@github-project-automation github-project-automation Bot moved this to Done in Trustify Aug 12, 2026
@trustify-ci-bot

Copy link
Copy Markdown

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

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants