You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: workflows/cve-fixer/.claude/commands/cve.fix.md
+40-37Lines changed: 40 additions & 37 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -132,22 +132,21 @@ Summary:
132
132
**3.1: Use container to scope repos (preferred)**
133
133
134
134
If a `CONTAINER` was extracted in Step 1:
135
-
-Look up `CONTAINER` in `container_to_repo_mapping` for the component
136
-
-**If container not found in mapping**:
135
+
-Search all repos in `.components[COMPONENT].repos[]` for one whose `.containers[]` includes `CONTAINER`
136
+
-**If container not found**:
137
137
- Log a warning: "⚠️ Container [CONTAINER] not in mapping — may be a new container not yet registered. Processing all component repos."
138
138
- Fall back to processing all repos in the component (scan in Step 5 filters irrelevant ones)
139
-
-**If container found**: gives the **primary repo** (e.g., `opendatahub-io/workload-variant-autoscaler`)
140
-
- Check if the primary repo has a `subcomponent` field in the `repositories` section
139
+
-**If container found**: note which repo it belongs to, read its `subcomponent` field
141
140
-**If `subcomponent` is defined**: collect all repos in the component with the same `subcomponent` value — this is the chain (upstream + midstream + downstream)
142
-
-**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)
141
+
-**If `subcomponent` is not defined**: process ALL repos in the component (safe fallback — the CVE scan in Step 5 will filter out repos where the CVE doesn't exist)
143
142
-**This ensures only the repos relevant to that specific container get PRs** — not repos belonging to other subcomponents
144
143
145
-
Example: `rhoai/odh-workload-variant-autoscaler-controller-rhel9`→ primary repo `opendatahub-io/workload-variant-autoscaler` →`subcomponent: autoscaler` → only process `llm-d/llm-d-workload-variant-autoscaler`, `opendatahub-io/workload-variant-autoscaler`, `red-hat-data-services/workload-variant-autoscaler`.
144
+
Example: `rhoai/odh-workload-variant-autoscaler-controller-rhel9`found in repo with`subcomponent: autoscaler` → only process `llm-d/llm-d-workload-variant-autoscaler`, `opendatahub-io/workload-variant-autoscaler`, `red-hat-data-services/workload-variant-autoscaler`.
146
145
147
146
**3.2: Fallback — use all repos**
148
147
149
148
If no `CONTAINER` was extracted (summary doesn't match expected pattern):
150
-
- Process ALL repositories listed under the component
149
+
- Process all entries in `.components[COMPONENT].repos[]`
151
150
- The CVE scan in Step 5 acts as the safety net — it will skip repos where the CVE doesn't exist
152
151
- Log a warning: "⚠️ Could not extract container from summary — processing all component repos"
153
152
@@ -1173,12 +1172,13 @@ the fix requires additional changes beyond a version bump."
1173
1172
- Risk assessment table
1174
1173
- Links to CVE advisories
1175
1174
- **Jira issue references**: List the extracted Jira issue IDs as plain text WITHOUT hyperlinks
@@ -1475,37 +1484,31 @@ After completing this phase:
1475
1484
- Filter the repository list to only those that contain the CVE
1476
1485
- **Multi-Repository Support**: A single component can map to MULTIPLE repositories
1477
1486
- Common pattern: an **upstream** repo (e.g., `opendatahub-io/models-as-a-service`) and one or more **downstream** repos (e.g., `red-hat-data-services/models-as-a-service`)
1478
-
- Each repository has its own `default_branch`, `cve_fix_workflow`, and `repo_type`
1479
-
- The `repo_type` field can be `"upstream"`or `"downstream"` to indicate the relationship
1480
-
- When fixing CVEs, iterate through ALL repositoriesfor the component and apply fixes to each one independently
1481
-
- Downstream repos often track different branches (e.g., `rhoai-3.0`) than upstream (`main`)
1482
-
- Each repository gets its own clone directory, feature branch, verification, test run, and PR
1483
-
- **Mapping File Structure**:
1487
+
- Each repo entry has its own `default_branch`, `active_branches`, and `type`
1488
+
- The `type` field is `"upstream"`, `"midstream"`, or `"downstream"`
1489
+
- When fixing CVEs, iterate through ALL reposfor the component and apply fixes to each one independently
1490
+
- Downstream repos often track different branches (e.g., `rhoai-3.4`) than upstream (`main`)
1491
+
- Each repo gets its own clone directory, feature branch, verification, test run, and PR
0 commit comments