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
fix: address all CodeRabbit review comments on PR 101
cve.fix.md:
- Deduplicate TARGET_BRANCHES to prevent processing DEFAULT_BRANCH twice
- Fix branch naming: include target branch in fix branch name to avoid
collisions (fix/cve-...-urllib3-rhoai-3.4-attempt-1)
- Replace shared-dir branch loop with isolated git worktree per branch
to prevent cross-branch state contamination
- Fix version_is_safe: replace undefined function with sort -V comparison
- Fix govulncheck condition: check for Informational section (not
"No vulnerabilities found") for execute path detection
- Fix unsafe JSON in curl: use jq -n --arg to safely encode Jira comment
- Add skopeo error handling: check exit code, warn and skip on failure
- Fix semantic version comparison: use sort -V + awk instead of awk string compare
- Clarify fork vs direct-push as two separate repo examples (not sequential)
cve.find.md:
- Remove HTTP 403 case: /rest/api/3/myself only returns 401 for all auth failures
- Add retry loop: attempt auth test call twice before giving up on network timeout
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
TEST_RESPONSE=$(curl -s -o /dev/null -w "%{http_code}" -X GET \
63
-
--connect-timeout 10 --max-time 15 \
64
-
-H "Authorization: Basic ${AUTH}" \
65
-
-H "Content-Type: application/json" \
66
-
"${JIRA_BASE_URL}/rest/api/3/myself")
62
+
63
+
# Retry once on network failure (curl exit code 000 = timeout/no response)
64
+
forATTEMPTin 1 2;do
65
+
TEST_RESPONSE=$(curl -s -o /dev/null -w "%{http_code}" -X GET \
66
+
--connect-timeout 10 --max-time 15 \
67
+
-H "Authorization: Basic ${AUTH}" \
68
+
-H "Content-Type: application/json" \
69
+
"${JIRA_BASE_URL}/rest/api/3/myself")
70
+
[ "$TEST_RESPONSE"!="000" ] &&break
71
+
echo"⚠️ Network timeout on attempt ${ATTEMPT}, retrying..."
72
+
sleep 3
73
+
done
67
74
```
68
75
69
76
-**HTTP 200** → credentials valid, proceed
70
-
-**HTTP 401** → credentials missing or invalid. Only now inform the user:
77
+
-**HTTP 401** → credentials missing or invalid. Note: `/rest/api/3/myself` returns 401 for all authentication failures — there is no separate 403 for this endpoint. Only now inform the user:
71
78
- Check if `JIRA_API_TOKEN` and `JIRA_EMAIL` are configured as Ambient session secrets
72
79
- If not, generate a token at https://id.atlassian.com/manage-profile/security/api-tokens and export:
80
+
73
81
```bash
74
82
export JIRA_API_TOKEN="your-token-here"
75
83
export JIRA_EMAIL="your-email@redhat.com"
76
84
```
77
-
- **HTTP 403** → token valid but insufficient permissions — inform user
78
-
- **Other / timeout** → network issue — inform user and retry once
85
+
- **HTTP 000 after retry** → persistent network issue — inform user and stop
79
86
80
87
**Do NOT pre-check env vars with `[ -z"$JIRA_API_TOKEN" ]` and stop.** The variables may be available to the API call even if not visible to the shell check (e.g. Ambient secrets injection).
VEX_JUSTIFICATION="Vulnerable Code not in Execute Path"
490
-
VEX_EVIDENCE="govulncheck found module ${PACKAGE} in dependency tree but confirmed vulnerable symbol is not called in code path"
524
+
VEX_EVIDENCE="govulncheck found module ${PACKAGE} in dependency tree but reported it as Informational — vulnerable symbol is not called in the code path"
491
525
fi
492
526
```
493
527
@@ -498,21 +532,25 @@ Summary:
498
532
- Print: "✅ CVE-YYYY-XXXXX not present in [repo]. VEX justification added to [JIRA-KEY]: [justification]"
499
533
500
534
```bash
501
-
# Add Jira comment with VEX justification
502
-
COMMENT="*VEX Justification (auto-detected by CVE fixer workflow)*\n\n"
0 commit comments