|
18 | 18 | TARGET_END_CUSTOM_FIELD = "customfield_12313942" |
19 | 19 | EMBARGO_CUSTOM_FIELD = "customfield_12324750" |
20 | 20 |
|
21 | | -PRIORITY_LABELS = ["compliance-priority", "contract-priority"] |
22 | 21 |
|
23 | 22 | RH_EMPLOYEE_GROUP = "Red Hat Employee" |
24 | 23 |
|
@@ -232,27 +231,19 @@ async def check_cve_triage_eligibility( |
232 | 231 | rhel_config = await load_rhel_config() |
233 | 232 | current_z_streams = rhel_config.get("current_z_streams", {}) |
234 | 233 |
|
| 234 | + needs_internal_fix = False |
| 235 | + severity = fields.get(SEVERITY_CUSTOM_FIELD, {}).get("value", "") |
| 236 | + |
235 | 237 | # Check if z-stream is not in current z-streams - always needs internal fix |
236 | 238 | if target_version.lower() not in [v.lower() for v in current_z_streams.values()]: |
237 | 239 | needs_internal_fix = True |
238 | 240 | reason = f"Z-stream CVE ({target_version}) not in current z-streams, needs RHEL fix first" |
| 241 | + # Determine if internal fix is needed based on severity |
| 242 | + elif severity not in [Severity.LOW.value, Severity.MODERATE.value]: |
| 243 | + needs_internal_fix = True |
| 244 | + reason = f"High severity CVE ({severity}) eligible for Z-stream, needs RHEL fix first" |
239 | 245 | else: |
240 | | - # Determine if internal fix is needed based on severity and priority |
241 | | - severity = fields.get(SEVERITY_CUSTOM_FIELD, {}).get("value", "") |
242 | | - priority_labels = [label for label in labels if label in PRIORITY_LABELS] |
243 | | - |
244 | | - needs_internal_fix = ( |
245 | | - severity not in [Severity.LOW.value, Severity.MODERATE.value] or |
246 | | - bool(priority_labels) |
247 | | - ) |
248 | | - |
249 | | - if needs_internal_fix: |
250 | | - if severity not in [Severity.LOW.value, Severity.MODERATE.value]: |
251 | | - reason = f"High severity CVE ({severity}) eligible for Z-stream, needs RHEL fix first" |
252 | | - else: |
253 | | - reason = f"Priority CVE with labels {priority_labels} eligible for Z-stream, needs RHEL fix first" |
254 | | - else: |
255 | | - reason = "CVE eligible for Z-stream fix in CentOS Stream" |
| 246 | + reason = "CVE eligible for Z-stream fix in CentOS Stream" |
256 | 247 |
|
257 | 248 | return CVEEligibilityResult( |
258 | 249 | is_cve=True, |
|
0 commit comments