Skip to content

Commit 4dab8d1

Browse files
vmrh21claude
andcommitted
fix: address all CodeRabbit comments on PR 108
cve.find.md: - Update subcomponent jq query for new simplified schema: .repos[].containers instead of container_to_repo_mapping/repositories cve.fix.md: - Fix misleading comment: --label exits non-zero (not silent), fallback exists for that reason; 2>/dev/null only suppresses the label error onboard.md: - Use __ as directory separator (not -) to avoid org/repo-name vs org-repo/name collision ambiguity - Use printf '%s\n' instead of echo for writing generated markdown (echo interprets backslashes, corrupts code fences and regexes) - Make co-author attribution version-agnostic: Claude instead of Claude Sonnet 4.6 (1M context) component-repository-mappings.json: - All repos already have correct types (no unknown values exist) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent f8efd94 commit 4dab8d1

3 files changed

Lines changed: 12 additions & 11 deletions

File tree

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -148,12 +148,12 @@ Report: artifacts/cve-fixer/find/cve-issues-20260226-145018.md
148148

149149
# Append subcomponent filter if provided
150150
if [ -n "$SUBCOMPONENT" ] && [ -n "$MAPPING_FILE" ] && [ -f "$MAPPING_FILE" ]; then
151-
# Reverse lookup: find ALL containers whose primary repo has matching subcomponent
151+
# Reverse lookup: find ALL containers on repos with matching subcomponent (new schema)
152152
PSCOMPONENTS=$(jq -r --arg comp "$COMPONENT_NAME" --arg sub "$SUBCOMPONENT" '
153-
.components[$comp] as $c |
154-
$c.container_to_repo_mapping | to_entries[] |
155-
select($c.repositories[.value].subcomponent == $sub) |
156-
"pscomponent:" + .key
153+
.components[$comp].repos[] |
154+
select(.subcomponent == $sub) |
155+
.containers[]? |
156+
"pscomponent:" + .
157157
' "$MAPPING_FILE")
158158

159159
if [ -n "$PSCOMPONENTS" ]; then

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1251,8 +1251,9 @@ EOF
12511251
--base <target-branch> \
12521252
--title "Security: Fix CVE-YYYY-XXXXX (<package-name>)" \
12531253
--body "$PR_BODY")
1254-
# Note: --label silently fails if the label doesn't exist in the repo.
1255-
# The fallback without --label ensures PR is always created.
1254+
# Note: gh pr create --label exits non-zero if the label doesn't exist.
1255+
# The fallback (without --label) ensures PR is always created even if labelling fails.
1256+
# 2>/dev/null suppresses the label-not-found error from the first attempt.
12561257
12571258
# Enable automerge if --automerge flag was passed and PR was created successfully
12581259
if [ "$AUTOMERGE" = "true" ] && [ -n "$PR_URL" ] && [ "$PR_URL" != "null" ]; then

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ to `ambient-code/workflows` containing both the mapping update and the guidance
320320
321321
Add ${COMPONENT_NAME} to component-repository-mappings.json
322322
323-
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>"
323+
Co-Authored-By: Claude <noreply@anthropic.com>"
324324
325325
git push "$REMOTE" "$BRANCH_NAME"
326326
```
@@ -362,7 +362,7 @@ to `ambient-code/workflows` containing both the mapping update and the guidance
362362
```bash
363363
for i in "${!REPO_URLS[@]}"; do
364364
REPO_FULL=$(echo "${REPO_URLS[$i]}" | sed 's|https://github.com/||')
365-
REPO_DIR="/tmp/onboard-${REPO_FULL//\//-}"
365+
REPO_DIR="/tmp/onboard-${REPO_FULL//\//__}"
366366
367367
# Check write access / fork if needed
368368
PUSH_ACCESS=$(gh api repos/${REPO_FULL} --jq '.permissions.push' 2>/dev/null)
@@ -383,14 +383,14 @@ to `ambient-code/workflows` containing both the mapping update and the guidance
383383
cd "$REPO_DIR"
384384
git checkout -b add-cve-fix-guidance
385385
mkdir -p .cve-fix
386-
echo "${GENERATED_EXAMPLES[$i]}" > .cve-fix/examples.md
386+
printf '%s\n' "${GENERATED_EXAMPLES[$i]}" > .cve-fix/examples.md
387387
git add .cve-fix/examples.md
388388
git commit -m "chore: add CVE fixer guidance file
389389
390390
Generated by /onboard — teaches the CVE fixer workflow how to create
391391
fix PRs matching this repo's conventions.
392392
393-
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>"
393+
Co-Authored-By: Claude <noreply@anthropic.com>"
394394
git push "$REPO_REMOTE" add-cve-fix-guidance
395395
396396
gh pr create \

0 commit comments

Comments
 (0)