Skip to content

Commit 9d8c9c5

Browse files
vmrh21claude
andcommitted
fix: address PR review comments
- Fix subcomponent: trustyai-service-operator repos incorrectly grouped under lm-evaluation-harness — give them their own subcomponent value - Add missing case in Step 3: container extracted but not found in container_to_repo_mapping → fall back to all repos with warning - Add language-specific transitive dependency guidance in Step 5.2.1: Go (replace directive), Python (update parent package), Node (overrides) - Fix package regex to support npm scoped packages (@grpc/grpc-js etc) Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
1 parent 8ce98b4 commit 9d8c9c5

2 files changed

Lines changed: 14 additions & 7 deletions

File tree

workflows/cve-fixer/.claude/commands/cve.fix.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ Summary:
7272
```bash
7373
SUMMARY="CVE-2025-66418 rhoai/odh-llm-d-routing-sidecar-rhel9: urllib3: Unbounded decompression"
7474
CONTAINER=$(echo "$SUMMARY" | grep -oP '(?<=CVE-[0-9]+-[0-9]+ )[\w/.-]+(?=:)')
75-
PACKAGE=$(echo "$SUMMARY" | grep -oP '(?<=: )[\w._-]+(?=:)')
75+
PACKAGE=$(echo "$SUMMARY" | grep -oP '(?<=: )[\w.@/_-]+(?=:)')
7676
```
7777

7878
Store `CONTAINER` and `PACKAGE` per CVE for use in Steps 3 and 5.
@@ -122,7 +122,10 @@ Summary:
122122

123123
If a `CONTAINER` was extracted in Step 1:
124124
- Look up `CONTAINER` in `container_to_repo_mapping` for the component
125-
- This gives the **primary repo** (e.g., `opendatahub-io/workload-variant-autoscaler`)
125+
- **If container not found in mapping**:
126+
- Log a warning: "⚠️ Container [CONTAINER] not in mapping — may be a new container not yet registered. Processing all component repos."
127+
- Fall back to processing all repos in the component (scan in Step 5 filters irrelevant ones)
128+
- **If container found**: gives the **primary repo** (e.g., `opendatahub-io/workload-variant-autoscaler`)
126129
- Check if the primary repo has a `subcomponent` field in the `repositories` section
127130
- **If `subcomponent` is defined**: collect all repos in the component with the same `subcomponent` value — this is the chain (upstream + midstream + downstream)
128131
- **If `subcomponent` is not defined**: process ALL repositories in the component (safe fallback — the CVE scan in Step 5 will filter out repos where the CVE doesn't exist)
@@ -303,8 +306,12 @@ Summary:
303306
- If version is in affected range → proceed with fix
304307
- If version is already patched → mark as already fixed (see below)
305308
- **Package not found in any manifest** → it may be transitive or RPM-installed
306-
- **Still proceed with fix attempt** — try to add/pin the package at a safe version
307-
- Include note in PR: "⚠️ Package not found directly in manifests — may be a transitive or RPM-installed dependency. Manual review required to confirm fix is effective."
309+
- **Do NOT blindly add a direct dependency** — this can cause version conflicts or unnecessary bloat
310+
- Instead, document the situation and create PR with guidance:
311+
- **Go**: transitive deps require a `replace` directive in go.mod — add it only if intentional
312+
- **Python**: adding to requirements.txt may conflict with what pip resolves transitively; prefer updating the parent package that pulls it in
313+
- **Node**: use npm `overrides` to force a safe version without adding a direct dep
314+
- Include note in PR: "⚠️ Package not found directly in manifests — may be a transitive or RPM-installed dependency. Manual review required to confirm the right fix approach."
308315
- **Both scan AND version check find nothing** → mark as already fixed:
309316
- **DO NOT create a PR**
310317
- **Print to stdout**: "✅ CVE-YYYY-XXXXX is already fixed in [repository] ([branch]). No action needed."

workflows/cve-fixer/component-repository-mappings.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -610,7 +610,7 @@
610610
"primary_target": "main",
611611
"backport_targets": "release/1.37.0, release/1.38.0"
612612
},
613-
"subcomponent": "lm-evaluation-harness"
613+
"subcomponent": "trustyai-service-operator"
614614
},
615615
"opendatahub-io/eval-hub": {
616616
"github_url": "https://github.com/opendatahub-io/eval-hub",
@@ -673,7 +673,7 @@
673673
"primary_target": "main",
674674
"backport_targets": "release/odh-3.3, release/odh-3.4, release/odh-3.4-ea2"
675675
},
676-
"subcomponent": "lm-evaluation-harness"
676+
"subcomponent": "trustyai-service-operator"
677677
},
678678
"red-hat-data-services/eval-hub": {
679679
"github_url": "https://github.com/red-hat-data-services/eval-hub",
@@ -740,7 +740,7 @@
740740
"primary_target": "main",
741741
"backport_targets": "rhoai-3.3, rhoai-3.4, rhoai-3.4-ea.1, rhoai-3.4-ea.2"
742742
},
743-
"subcomponent": "lm-evaluation-harness"
743+
"subcomponent": "trustyai-service-operator"
744744
},
745745
"trustyai-explainability/llama-stack-provider-ragas": {
746746
"github_url": "https://github.com/trustyai-explainability/llama-stack-provider-ragas",

0 commit comments

Comments
 (0)