Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions scripts/ci/strix_quick_gate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1295,6 +1295,7 @@ import sys
text = Path(sys.argv[1]).read_text(encoding='utf-8', errors='replace')
patterns = [
re.compile(r'(?P<path>/workspace/[^\s`]+|[A-Za-z0-9_./\[\]-]+\.[A-Za-z0-9_]+):\d+'),
re.compile(r'<file>\s*(?P<path>/workspace/[^\s<`│]+|[A-Za-z0-9_./\[\]-]+\.[A-Za-z0-9_]+)\s*</file>'),
re.compile(r'^[^\S\r\n│]*[│]?[ \t]*(?:\*\*)?Target:(?:\*\*)?[ \t]*(?:File:[ \t]*)?(?P<path>/workspace/[^\s`│]+|[A-Za-z0-9_./\[\]-]+\.[A-Za-z0-9_]+)', re.MULTILINE),
re.compile(r'^[^\S\r\n│]*[│]?[ \t]*(?:\*\*)?Endpoint:(?:\*\*)?[ \t]*(?P<path>/workspace/[^\s`│]+|[A-Za-z0-9_./\[\]-]+\.[A-Za-z0-9_]+)', re.MULTILINE),
re.compile(r'(?i)(?:in\s+)?file\s+`(?P<path>(?:\.\.?/)?[A-Za-z0-9_./\[\]-]+\.[A-Za-z0-9_]+)`'),
Expand Down
36 changes: 36 additions & 0 deletions scripts/ci/test_strix_quick_gate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1144,6 +1144,21 @@ EOS
echo "Penetration test failed: changed bracketed Next.js route finding"
exit 1
;;
pr-critical-changed-xml-file-location)
mkdir -p "$STRIX_REPORTS_DIR/fake-pr-changed-xml/vulnerabilities"
cat >"$STRIX_REPORTS_DIR/fake-pr-changed-xml/vulnerabilities/vuln-0001.md" <<'EOS'
Severity: HIGH
<parameter=code_locations>
<location>
<file>sync-module-system/smart-crawling-biz/src/main/java/org/empasy/sync/modules/system/controller/SysPositionController.java</file>
<start_line>120</start_line>
Comment thread
greptile-apps[bot] marked this conversation as resolved.
Resolved
<end_line>124</end_line>
</location>
</parameter=code_locations>
EOS
echo "Penetration test failed: changed XML file location finding"
exit 1
;;
pr-critical-unmapped)
mkdir -p "$STRIX_REPORTS_DIR/fake-pr-unmapped/vulnerabilities"
cat >"$STRIX_REPORTS_DIR/fake-pr-unmapped/vulnerabilities/vuln-0001.md" <<'EOS'
Expand Down Expand Up @@ -4301,6 +4316,27 @@ run_gate_case "pr-critical-changed-bracketed-next-route" \
"pull_request" \
"frontend/src/app/labels/[slug]/page.tsx"

run_gate_case "pr-critical-changed-xml-file-location" \
"openai/gpt-4o-mini" \
"" \
"1" \
"Strix finding intersects files changed in this pull request." \
"1" \
"openai/gpt-4o-mini" \
"https://example.invalid" \
"vertex_ai" \
"__DEFAULT__" \
"" \
"0" \
"MEDIUM" \
"0" \
"" \
"" \
"1200" \
"0" \
"pull_request" \
"sync-module-system/smart-crawling-biz/src/main/java/org/empasy/sync/modules/system/controller/SysPositionController.java"
Comment thread
greptile-apps[bot] marked this conversation as resolved.
Resolved

run_gate_case "pr-critical-changed-absolute-target" \
"openai/gpt-4o-mini" \
"" \
Expand Down
Loading