Skip to content

Commit 9373f43

Browse files
vmrh21claude
andcommitted
fix: address PR review feedback on CVE fixer workflow
- Update JQL query: remove project=RHOAIENG, add labels=SecurityTracking to make workflow usable by teams outside of RHOAIENG - Add case-insensitive component name lookup against mapping file - Add llm-d component with inference-scheduler and routing-sidecar repos - Add llm-d Batch Gateway and auto-scaler repos under llm-d component - Add AI Evaluations component (eval-hub repos) - Clean up metadata: remove stale count fields from mapping file - Fix ambient.json startupPrompt: trim verbose FIRST TIME USER checklist - Fix README example JSON to match actual mapping schema - Fix README ProdSec contact to reference feature refinement process - Remove RHOAIENG-specific references to make docs team-agnostic Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
1 parent 83c0fc7 commit 9373f43

4 files changed

Lines changed: 185 additions & 42 deletions

File tree

workflows/cve-fixer/.ambient/ambient.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "CVE Fixer",
33
"description": "Automate remediation of CVE issues reported by ProdSec team in Jira by creating pull requests with dependency updates and patches",
44
"systemPrompt": "You are a CVE remediation assistant for the Ambient Code Platform. Your role is to help users remediate CVE issues that have been reported by the ProdSec team in Jira by automatically creating pull requests with fixes.\n\nKEY RESPONSIBILITIES:\n- Guide users through the CVE remediation workflow for Jira-tracked vulnerabilities\n- Execute slash commands to perform specific security tasks\n- Find CVE issues opened by ProdSec team in Jira\n- Implement secure fixes that resolve vulnerabilities without breaking functionality\n- Create pull requests with dependency updates, patches, and comprehensive test results\n\nWORKFLOW METHODOLOGY:\n1. FIND - Find CVEs already reported in Jira for a component\n2. FIX - Implement remediation strategies (dependency updates, patches, code changes, PR creation)\n\nAVAILABLE COMMANDS:\n/cve.find - Find CVEs reported in Jira for a specific component\n/cve.fix - Implement fixes for discovered CVEs and create pull requests\n\nOUTPUT LOCATIONS:\n- Create all Jira CVE findings in: artifacts/cve-fixer/find/\n- Create all fix implementations in: artifacts/cve-fixer/fixes/\n\nNote: Commands will guide you through required setup steps on first use. If the user's component is not in component-repository-mappings.json, direct them to the \"Team Onboarding\" section in README.md.",
5-
"startupPrompt": "Welcome! I'm your CVE Remediation assistant.\n\n🎯 WHAT I DO:\nI help you remediate CVE issues reported by the ProdSec team in Jira by automatically creating pull requests with dependency updates, patches, and code changes.\n\n⚠️ FIRST TIME USER?\nNew teams must complete onboarding before using this workflow. See README.md section \"Team Onboarding\" for requirements:\n- Component-to-repository mapping must be configured\n- ProdSec team must set up your Jira component\n- Jira API credentials required (JIRA_API_TOKEN, JIRA_EMAIL)\n- GitHub CLI authentication required\n\n📋 WORKFLOW PHASES:\n1. **Find** - Discover CVE issues opened by ProdSec in Jira for a component\n2. **Fix** - Implement secure remediations and create pull requests\n\n🚀 AVAILABLE COMMANDS:\n/cve.find - Find CVE issues reported by ProdSec in Jira\n/cve.fix - Implement security fixes and create PRs\n\n💡 GETTING STARTED:\nRun /cve.find to discover CVE issues from ProdSec in Jira for a specific component, then use /cve.fix to automatically remediate them with pull requests.\n\n**Note:** This workflow is designed for CVE issues tracked in Jira by your Product Security team.\n\nWhat would you like to accomplish today?",
5+
"startupPrompt": "Welcome! I'm your CVE Remediation assistant.\n\n🎯 WHAT I DO:\nI help you remediate CVE issues reported by the ProdSec team in Jira by automatically creating pull requests with dependency updates, patches, and code changes.\n\n📋 WORKFLOW PHASES:\n1. **Find** - Discover CVE issues opened by ProdSec in Jira for a component\n2. **Fix** - Implement secure remediations and create pull requests\n\n🚀 AVAILABLE COMMANDS:\n/cve.find - Find CVE issues reported by ProdSec in Jira\n/cve.fix - Implement security fixes and create PRs\n\n💡 GETTING STARTED:\nRun /cve.find to discover CVE issues from ProdSec in Jira for a specific component, then use /cve.fix to automatically remediate them with pull requests.\n\nFirst time? See README.md → \"Team Onboarding\" for setup requirements.\n\nWhat would you like to accomplish today?",
66
"results": {
77
"Jira CVE Issues": "artifacts/cve-fixer/find/**/*.md",
88
"Fix Implementations": "artifacts/cve-fixer/fixes/**/*"

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

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,19 @@ Report: artifacts/cve-fixer/find/cve-issues-20260226-145018.md
9999
100100
b. Construct JQL query and execute API call:
101101
```bash
102+
# Normalize component name with case-insensitive lookup against mapping file
103+
MAPPING_FILE="$(dirname "$0")/../component-repository-mappings.json"
104+
if [ -f "$MAPPING_FILE" ]; then
105+
CANONICAL_NAME=$(jq -r --arg name "${COMPONENT_NAME}" \
106+
'.components | keys[] | select(ascii_downcase == ($name | ascii_downcase))' \
107+
"$MAPPING_FILE" | head -1)
108+
if [ -n "$CANONICAL_NAME" ]; then
109+
COMPONENT_NAME="$CANONICAL_NAME"
110+
fi
111+
fi
112+
102113
# Build JQL query
103-
JQL="project = RHOAIENG AND component = \"${COMPONENT_NAME}\" AND summary ~ \"CVE*\""
114+
JQL="component = \"${COMPONENT_NAME}\" AND summary ~ \"CVE*\" AND labels = SecurityTracking"
104115
105116
# Append resolved filter if --ignore-resolved flag was provided
106117
if [ "$IGNORE_RESOLVED" = "true" ]; then
@@ -332,7 +343,7 @@ Report: artifacts/cve-fixer/find/cve-issues-20260226-145018.md
332343
**Ignored Issues:** ${IGNORED_COUNT}
333344
334345
## Query Parameters
335-
- **JQL Query:** project = RHOAIENG AND component = "${COMPONENT_NAME}" AND summary ~ "CVE*"$( [ "$IGNORE_RESOLVED" = "true" ] && echo ' AND status not in ("Resolved")' )
346+
- **JQL Query:** component = "${COMPONENT_NAME}" AND summary ~ "CVE*" AND labels = SecurityTracking$( [ "$IGNORE_RESOLVED" = "true" ] && echo ' AND status not in ("Resolved")' )
336347
- **Columns:** KEY, SUMMARY, STATUS, PRIORITY, CREATED, COMPONENTS
337348
- **Jira Instance:** ${JIRA_BASE_URL}
338349

workflows/cve-fixer/README.md

Lines changed: 25 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -24,44 +24,30 @@ Before your team can use the CVE Fixer workflow, the following setup must be com
2424
Your team's Jira components must be mapped to GitHub repositories in `component-repository-mappings.json`.
2525

2626
**What you need to provide:**
27-
- Jira component name (as it appears in RHOAIENG project)
28-
- GitHub repository URLs (upstream and/or downstream)
29-
- Primary target branch for each repository
30-
- Build location (directory containing go.mod, package.json, etc.)
27+
- Jira component name (as it appears in your Jira project)
28+
- GitHub repository URLs (upstream, midstream, and/or downstream)
29+
- Default and active release branches for each repository
3130

3231
**Example mapping:**
3332
```json
3433
{
3534
"Your Component Name": {
35+
"container_to_repo_mapping": {
36+
"rhoai/odh-your-container-rhel9": "org/upstream-repo"
37+
},
3638
"repositories": {
3739
"org/upstream-repo": {
3840
"github_url": "https://github.com/org/upstream-repo",
3941
"default_branch": "main",
40-
"protected_branches": ["main", "release"],
41-
"active_release_branches": [],
42-
"branch_strategy": "Fix in main, cherry-pick to release branches as needed",
43-
"cve_fix_workflow": {
44-
"primary_target": "main",
45-
"backport_targets": "Active release branches",
46-
"automation": "Auto-create PRs to main",
47-
"manual_intervention": "Cherry-pick to release branches"
48-
},
49-
"build_location": ".",
42+
"active_release_branches": ["release-1.0"],
43+
"branch_strategy": "Fix in main. Release branches follow pattern release-X.Y.",
5044
"repo_type": "upstream"
5145
},
5246
"org/downstream-repo": {
5347
"github_url": "https://github.com/org/downstream-repo",
54-
"default_branch": "rhoai-2.19",
55-
"protected_branches": ["rhoai-2.19"],
56-
"active_release_branches": ["rhoai-2.19"],
57-
"branch_strategy": "Direct fixes to release branch",
58-
"cve_fix_workflow": {
59-
"primary_target": "rhoai-2.19",
60-
"backport_targets": "rhoai-2.19",
61-
"automation": "Auto-create PRs to release branch",
62-
"manual_intervention": "Manual backport from upstream if needed"
63-
},
64-
"build_location": ".",
48+
"default_branch": "main",
49+
"active_release_branches": ["rhoai-3.4"],
50+
"branch_strategy": "Fork of midstream. RHOAI release branches follow pattern rhoai-X.Y.",
6551
"repo_type": "downstream"
6652
}
6753
}
@@ -72,11 +58,11 @@ Your team's Jira components must be mapped to GitHub repositories in `component-
7258
#### 2. ProdSec Team Coordination
7359

7460
The Product Security (ProdSec) team must:
75-
- Create Jira component for your team in the RHOAIENG project
61+
- Create Jira component for your team in your Jira project
7662
- Configure CVE issue templates for your component
7763
- Set up automated CVE discovery and Jira issue creation
7864

79-
**Contact:** Your ProdSec team representative to request component setup
65+
**Contact:** Make sure your component repos are actively scanned by ProdSec team. If your component is not onboarded please follow the feature refinement process.
8066

8167
#### 3. GitHub Access Configuration
8268

@@ -99,7 +85,7 @@ export GITHUB_TOKEN="your-personal-access-token"
9985
#### 4. Jira API Access
10086

10187
Each team member using the workflow needs:
102-
- Red Hat Jira account with access to RHOAIENG project
88+
- Red Hat Jira account with access to your Jira project
10389
- Jira API token for authentication
10490
- Read access to CVE issues for their component
10591

@@ -251,18 +237,23 @@ The workflow uses `component-repository-mappings.json` to map Jira components to
251237
```json
252238
{
253239
"Model as a Service": {
240+
"container_to_repo_mapping": {
241+
"rhoai/odh-maas-api-rhel9": "opendatahub-io/models-as-a-service"
242+
},
254243
"repositories": {
255244
"opendatahub-io/models-as-a-service": {
256245
"github_url": "https://github.com/opendatahub-io/models-as-a-service",
257-
"repo_type": "upstream",
258-
"primary_target": "main",
259-
"build_location": "."
246+
"default_branch": "main",
247+
"active_release_branches": [],
248+
"branch_strategy": "Fix in main.",
249+
"repo_type": "upstream"
260250
},
261251
"red-hat-data-services/models-as-a-service": {
262252
"github_url": "https://github.com/red-hat-data-services/models-as-a-service",
263-
"repo_type": "downstream",
264-
"primary_target": "rhoai-2.19",
265-
"build_location": "."
253+
"default_branch": "rhoai-3.0",
254+
"active_release_branches": ["rhoai-3.0"],
255+
"branch_strategy": "Fork of midstream. Fixes backported from upstream.",
256+
"repo_type": "downstream"
266257
}
267258
}
268259
}

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

Lines changed: 146 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -374,14 +374,155 @@
374374
"github_url": "https://github.com/opendatahub-io/codeflare-operator"
375375
}
376376
}
377+
},
378+
"llm-d": {
379+
"container_to_repo_mapping": {
380+
"rhoai/odh-llm-d-inference-scheduler-rhel9": "opendatahub-io/llm-d-inference-scheduler",
381+
"rhoai/odh-llm-d-routing-sidecar-rhel9": "red-hat-data-services/llm-d-routing-sidecar",
382+
"rhoai/odh-workload-variant-autoscaler-controller-rhel9": "opendatahub-io/workload-variant-autoscaler"
383+
},
384+
"repositories": {
385+
"llm-d/llm-d-inference-scheduler": {
386+
"github_url": "https://github.com/llm-d/llm-d-inference-scheduler",
387+
"default_branch": "main",
388+
"active_release_branches": [
389+
"release-0.5",
390+
"release-0.6"
391+
],
392+
"branch_strategy": "Fix in main. Release branches follow pattern release-X.Y.",
393+
"repo_type": "upstream"
394+
},
395+
"opendatahub-io/llm-d-inference-scheduler": {
396+
"github_url": "https://github.com/opendatahub-io/llm-d-inference-scheduler",
397+
"default_branch": "main",
398+
"active_release_branches": [
399+
"release-0.2",
400+
"release-0.3.1",
401+
"release-v0.4",
402+
"stable-2.x"
403+
],
404+
"branch_strategy": "Fork of upstream llm-d/llm-d-inference-scheduler. Synced via sync branches. ODH release branches via Konflux replicator.",
405+
"repo_type": "midstream"
406+
},
407+
"red-hat-data-services/llm-d-inference-scheduler": {
408+
"github_url": "https://github.com/red-hat-data-services/llm-d-inference-scheduler",
409+
"default_branch": "main",
410+
"active_release_branches": [
411+
"rhoai-3.3",
412+
"rhoai-3.4",
413+
"rhoai-3.4-ea.1",
414+
"rhoai-3.4-ea.2"
415+
],
416+
"branch_strategy": "Fork of midstream. RHOAI release branches follow pattern rhoai-X.Y.",
417+
"repo_type": "downstream"
418+
},
419+
"red-hat-data-services/llm-d-routing-sidecar": {
420+
"github_url": "https://github.com/red-hat-data-services/llm-d-routing-sidecar",
421+
"default_branch": "main",
422+
"active_release_branches": [
423+
"rhoai-2.25",
424+
"rhoai-3.0",
425+
"rhoai-3.2"
426+
],
427+
"branch_strategy": "Fork of upstream (now archived). Downstream only — upstream code migrated into llm-d-inference-scheduler. No branches beyond rhoai-3.2.",
428+
"repo_type": "downstream",
429+
"notes": "Upstream llm-d/llm-d-routing-sidecar is archived; code moved to llm-d-inference-scheduler (cmd/pd_sidecar). This downstream repo may be phased out in future releases."
430+
},
431+
"llm-d-incubation/batch-gateway": {
432+
"github_url": "https://github.com/llm-d-incubation/batch-gateway",
433+
"default_branch": "main",
434+
"active_release_branches": [],
435+
"branch_strategy": "Fix in main. No formal release branching documented.",
436+
"repo_type": "upstream"
437+
},
438+
"opendatahub-io/batch-gateway": {
439+
"github_url": "https://github.com/opendatahub-io/batch-gateway",
440+
"default_branch": "main",
441+
"active_release_branches": [
442+
"release-v0.5"
443+
],
444+
"branch_strategy": "Fork of upstream llm-d-incubation/batch-gateway.",
445+
"repo_type": "midstream"
446+
},
447+
"red-hat-data-services/batch-gateway": {
448+
"github_url": "https://github.com/red-hat-data-services/batch-gateway",
449+
"default_branch": "main",
450+
"active_release_branches": [
451+
"rhoai-3.4",
452+
"rhoai-3.4-ea.1",
453+
"rhoai-3.4-ea.2"
454+
],
455+
"branch_strategy": "Fork of midstream. RHOAI release branches follow pattern rhoai-X.Y.",
456+
"repo_type": "downstream"
457+
},
458+
"llm-d/llm-d-workload-variant-autoscaler": {
459+
"github_url": "https://github.com/llm-d/llm-d-workload-variant-autoscaler",
460+
"default_branch": "main",
461+
"active_release_branches": [
462+
"release-0.4.2"
463+
],
464+
"branch_strategy": "Fix in main. Release branches follow pattern release-X.Y.Z.",
465+
"repo_type": "upstream"
466+
},
467+
"opendatahub-io/workload-variant-autoscaler": {
468+
"github_url": "https://github.com/opendatahub-io/workload-variant-autoscaler",
469+
"default_branch": "main",
470+
"active_release_branches": [
471+
"release-v0.5"
472+
],
473+
"branch_strategy": "Fork of upstream llm-d/llm-d-workload-variant-autoscaler. Note: repo name differs from upstream (no llm-d- prefix).",
474+
"repo_type": "midstream"
475+
},
476+
"red-hat-data-services/workload-variant-autoscaler": {
477+
"github_url": "https://github.com/red-hat-data-services/workload-variant-autoscaler",
478+
"default_branch": "main",
479+
"active_release_branches": [
480+
"rhoai-3.4",
481+
"rhoai-3.4-ea.1",
482+
"rhoai-3.4-ea.2"
483+
],
484+
"branch_strategy": "Fork of midstream. RHOAI release branches follow pattern rhoai-X.Y.",
485+
"repo_type": "downstream"
486+
}
487+
}
488+
},
489+
"AI Evaluations": {
490+
"container_to_repo_mapping": {},
491+
"repositories": {
492+
"eval-hub/eval-hub": {
493+
"github_url": "https://github.com/eval-hub/eval-hub",
494+
"default_branch": "main",
495+
"active_release_branches": [],
496+
"branch_strategy": "Fix in main. Feature branches follow pattern feature/name or fix/issue.",
497+
"repo_type": "upstream"
498+
},
499+
"opendatahub-io/eval-hub": {
500+
"github_url": "https://github.com/opendatahub-io/eval-hub",
501+
"default_branch": "main",
502+
"active_release_branches": [
503+
"release/odh-3.4",
504+
"stable"
505+
],
506+
"branch_strategy": "Fork of upstream eval-hub/eval-hub.",
507+
"repo_type": "midstream"
508+
},
509+
"red-hat-data-services/eval-hub": {
510+
"github_url": "https://github.com/red-hat-data-services/eval-hub",
511+
"default_branch": "main",
512+
"active_release_branches": [
513+
"rhoai-3.4",
514+
"rhoai-3.4-ea.1",
515+
"rhoai-3.4-ea.2"
516+
],
517+
"branch_strategy": "Fork of midstream. RHOAI release branches follow pattern rhoai-X.Y.",
518+
"repo_type": "downstream"
519+
}
520+
}
377521
}
378522
},
379523
"metadata": {
380524
"description": "Component to repository and branch mappings for CVE fix workflow automation",
381-
"purpose": "Maps RHOAI Jira components to GitHub repositories and their branch strategies for automated CVE patching",
382-
"last_updated": "2026-03-16",
383-
"components_analyzed": 7,
384-
"components_with_branch_info": 1,
385-
"components_pending_branch_analysis": 6
525+
"purpose": "Maps Jira components to GitHub repositories and their branch strategies for automated CVE patching",
526+
"last_updated": "2026-03-29"
386527
}
387528
}

0 commit comments

Comments
 (0)