Conversation
for future frontend use
Reviewer's GuideCherry-picks a feature-flag status endpoint for CVEs without errata. The endpoint authenticates via the existing API key or basic-auth schemes, resolves the organization from the user context, retrieves its RHAccount flag, and returns the status through a newly documented response contract while preserving a distinct PATCH response schema. Sequence diagram for retrieving CVEs without errata statussequenceDiagram
participant Client
participant GetCvesWithoutErrata
participant RHAccount
Client->>GetCvesWithoutErrata: GET /v1/feature/cves_without_errata
GetCvesWithoutErrata->>GetCvesWithoutErrata: Authenticate with ApiKeyAuth or BasicAuth
GetCvesWithoutErrata->>GetCvesWithoutErrata: handle_get()
GetCvesWithoutErrata->>RHAccount: get(RHAccount.org_id == org_id)
RHAccount-->>GetCvesWithoutErrata: cves_without_errata and org_id
GetCvesWithoutErrata-->>Client: 200 CvesWithoutErrataOut
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've found 1 issue
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="manager.spec.yaml" line_range="3952-3963" />
<code_context>
type: number
CvesWithoutErrataOut:
+ type: object
+ properties:
+ cves_without_errata:
+ type: object
+ properties:
+ enabled:
+ type: boolean
+ required:
+ - cves_without_errata
+ - org_id
+
+ CvesWithoutErrataPatchOut:
type: object
</code_context>
<issue_to_address>
**nitpick (bug_risk):** The response schema requires `org_id` but does not declare it under `properties`, so the OpenAPI contract omits the type and description of a field that the handler always returns. Generated clients and schema consumers therefore cannot reliably model the complete response shape.
**Suggested fix:** Add an `org_id` property, with its actual string type, to `CvesWithoutErrataOut` and mark `enabled` as required inside `cves_without_errata` if both fields are guaranteed in every response.
</issue_to_address>| CvesWithoutErrataOut: | ||
| type: object | ||
| properties: | ||
| cves_without_errata: | ||
| type: object | ||
| properties: | ||
| enabled: | ||
| type: boolean | ||
| required: | ||
| - cves_without_errata | ||
| - org_id | ||
|
|
There was a problem hiding this comment.
nitpick (bug_risk): The response schema requires org_id but does not declare it under properties, so the OpenAPI contract omits the type and description of a field that the handler always returns. Generated clients and schema consumers therefore cannot reliably model the complete response shape.
Suggested fix: Add an org_id property, with its actual string type, to CvesWithoutErrataOut and mark enabled as required inside cves_without_errata if both fields are guaranteed in every response.
This reverts commit 47845b9.
RHINENG-30727
RHINENG-30910
cherry-pick: "feat(manager): add simple endpoint to get cves_without_errata status"
Secure Coding Practices Checklist GitHub Link
Secure Coding Checklist
Summary by Sourcery
Expose the CVEs-without-errata feature status through a dedicated manager API endpoint.
New Features:
Enhancements: