Skip to content

chore(openapi): [main] update client/openapi/trustd.yaml - #1320

Closed
trustify-ci-bot[bot] wants to merge 1 commit into
mainfrom
create-pull-request/patch-055f483
Closed

trustify-ci-bot[bot] wants to merge 1 commit into
mainfrom
create-pull-request/patch-055f483

Conversation

@trustify-ci-bot

@trustify-ci-bot trustify-ci-bot Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

The openapi.yaml of trustify has changed

Summary by Sourcery

Synchronize the trustd client OpenAPI specification with the latest service contract.

New Features:

  • Update the trustd OpenAPI schema to expose capability and variant metadata in the service discovery response.
  • Document the v3 recommendation report endpoint’s disabled-state response.

Enhancements:

  • Update the OpenAPI specification to version 0.7.0 and align disabled or unconfigured endpoint responses with HTTP 422 across recommendation and exploit-intelligence APIs.
  • Mark the legacy exploitIntelligence discovery field as deprecated in favor of capabilities.

@sourcery-ai

sourcery-ai Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Reviewer's Guide

Synchronizes the trustd OpenAPI specification with the updated service contract by adding capability/variant metadata and revising endpoint error responses from service-unavailable semantics to validation-style 422 responses.

Sequence diagram for updated trustd endpoint error responses

sequenceDiagram
    participant Client
    participant Trustd

    Client->>Trustd: POST /api/v3/purl/recommend/report
    alt endpoint disabled
        Trustd-->>Client: 422 Unprocessable Entity
    else package limit exceeded
        Trustd-->>Client: 413 Content Too Large
    end

    Client->>Trustd: GET /api/v2/sbom/{key}/analyze
    alt exploit intelligence not configured
        Trustd-->>Client: 422 Unprocessable Entity
    end
Loading

File-Level Changes

Change Details Files
Expanded the trustd response schema with capability and variant metadata while marking the legacy exploit-intelligence flag as deprecated.
  • Added required capabilities and variants fields.
  • Defined capabilities as an array of strings and variants as a string-keyed map of string arrays.
  • Documented exploitIntelligence as superseded by capabilities.
client/openapi/trustd.yaml
Updated documented error responses for disabled or unavailable recommendation and exploit-intelligence endpoints.
  • Changed relevant 503 responses to 422.
  • Added the missing 422 response for v3 recommendation reports.
client/openapi/trustd.yaml

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 found 1 issue

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

## Individual Comments

### Comment 1
<location path="client/openapi/trustd.yaml" line_range="66" />
<code_context>
               schema:
                 $ref: '#/components/schemas/RecommendResponse'
-        '503':
+        '422':
           description: Endpoint disabled — TRUSTD_RECOMMEND_PATTERNS not configured
       deprecated: true
</code_context>
<issue_to_address>
**Unavailable recommendations stay enabled**

When `TRUSTD_RECOMMEND_PATTERNS` is not configured and the endpoint returns the documented 422, `useIsRecommendationEnabled` only recognizes 503 as disabled, so it returns true and `SbomToolbar` exposes recommendation actions whose requests fail.

Update `useIsRecommendationEnabled` to recognize the documented 422 response as disabled.

Also at `client/openapi/trustd.yaml:3011-3012`.
</issue_to_address>

Sourcery assessment

Approval pending. 1 finding to address first.

Blocking findings: client/openapi/trustd.yaml:66


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

schema:
$ref: '#/components/schemas/RecommendResponse'
'503':
'422':

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.

🟡 Medium · Unavailable recommendations stay enabled

When TRUSTD_RECOMMEND_PATTERNS is not configured and the endpoint returns the documented 422, useIsRecommendationEnabled only recognizes 503 as disabled, so it returns true and SbomToolbar exposes recommendation actions whose requests fail.

Update useIsRecommendationEnabled to recognize the documented 422 response as disabled.

Also at client/openapi/trustd.yaml:3011-3012.

Prompt for AI agents
In `client/openapi/trustd.yaml` at line 66:

**Unavailable recommendations stay enabled**

When `TRUSTD_RECOMMEND_PATTERNS` is not configured and the endpoint returns the documented 422, `useIsRecommendationEnabled` only recognizes 503 as disabled, so it returns true and `SbomToolbar` exposes recommendation actions whose requests fail.

Update `useIsRecommendationEnabled` to recognize the documented 422 response as disabled.

Also at `client/openapi/trustd.yaml:3011-3012`.

@codecov

codecov Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 60.08%. Comparing base (055f483) to head (4110698).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1320      +/-   ##
==========================================
- Coverage   60.10%   60.08%   -0.02%     
==========================================
  Files         266      266              
  Lines        6286     6286              
  Branches     2083     2083              
==========================================
- Hits         3778     3777       -1     
- Misses       2274     2276       +2     
+ Partials      234      233       -1     
Flag Coverage Δ
e2e 69.58% <ø> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@trustify-ci-bot
trustify-ci-bot Bot force-pushed the create-pull-request/patch-055f483 branch from a77e007 to 4110698 Compare October 15, 2026 15:09
@gildub

gildub commented Oct 16, 2026

Copy link
Copy Markdown
Collaborator

Needs adjustement, replaced with #1322

@gildub gildub closed this Oct 16, 2026
@github-project-automation github-project-automation Bot moved this to Done in Trustify Oct 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants