Conversation
Reviewer's GuideIntroduces a feature-flagged evaluator path that resolves VMAAS affected/fixed EVRAs and synchronizes both system vulnerability package metadata and detailed package associations, while preserving backward-compatible evaluation behavior when disabled. Sequence diagram for feature-flagged vulnerability package detail synchronizationsequenceDiagram
participant VMAAS
participant EvaluatorLogic
participant SystemVulnerability
participant PackageDetail
participant Database
VMAAS->>EvaluatorLogic: _perform_vmaas_request()
EvaluatorLogic->>EvaluatorLogic: _get_affected_package_details()
EvaluatorLogic->>EvaluatorLogic: _get_or_upsert_package_name()
EvaluatorLogic->>EvaluatorLogic: _get_or_upsert_evra()
EvaluatorLogic->>SystemVulnerability: _compare_system_vulnerable_package()
alt feature flag enabled
EvaluatorLogic->>Database: _insert_system_vulnerable_package()
EvaluatorLogic->>Database: _update_system_vulnerable_package()
else feature flag disabled
EvaluatorLogic->>Database: _insert_system_vulnerable_package()
end
EvaluatorLogic->>PackageDetail: SystemVulnerabilitiesRow.affected_package_details
PackageDetail->>Database: _sync_system_vulnerability_package_details()
Database-->>PackageDetail: Insert missing and delete obsolete associations
Flow diagram for synchronizing affected and fixed package detailsflowchart TD
A[VMAAS affected package data] --> B[Resolve package names and EVRAs]
B --> C[Build affected_package_details]
C --> D[Evaluate system vulnerabilities]
D --> E{Feature flag enabled?}
E -- No --> F[Preserve legacy package evaluation]
E -- Yes --> G[Compare affected EVRAs]
G --> H[Insert new or update changed system packages]
G --> I[Load existing package details]
I --> J[Compare associations]
J --> K[Insert missing affected/fixed details]
J --> L[Delete obsolete details]
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="evaluator/logic.py" line_range="487-489" />
<code_context>
"strategy": "default",
"parameters": {}
+ },
+ {
+ "name": "vulnerability.evaluator_system_vulnerabilities_pkg_detail",
+ "type": "release",
</code_context>
<issue_to_address>
**issue (bug_risk):** The dictionary comprehensions key affected records only by `package_name`, so multiple VMAAS affected entries for the same package name overwrite one another and only one architecture/affected EVRA/fixed EVRA is stored. The evaluator therefore loses package-detail associations when VMAAS returns the same package in more than one affected form.
**Triggers:** When VMAAS returns duplicate package names with different architectures or EVRA values.
**Suggested fix:** Group affected records by package name and preserve all records, or include the architecture/EVRA identity in the association key.
</issue_to_address>| { | ||
| affected_package["package_name"]: AffectedPackageEvras(affected_package["evra"], affected_package.get("fixed_evra")) | ||
| for affected_package in cve.get("affected", []) |
There was a problem hiding this comment.
issue (bug_risk): The dictionary comprehensions key affected records only by package_name, so multiple VMAAS affected entries for the same package name overwrite one another and only one architecture/affected EVRA/fixed EVRA is stored. The evaluator therefore loses package-detail associations when VMAAS returns the same package in more than one affected form.
Triggers: When VMAAS returns duplicate package names with different architectures or EVRA values.
Suggested fix: Group affected records by package name and preserve all records, or include the architecture/EVRA identity in the association key.
RHINENG-28512
Secure Coding Practices Checklist GitHub Link
Secure Coding Checklist
Summary by Sourcery
Enable the evaluator to persist and synchronize affected and fixed package associations for system vulnerabilities.
New Features:
Enhancements: