Skip to content

Commit 932ae11

Browse files
committed
feat(v3.2.0): parallel analysis, sandbox hardening & workflow improvements
## Core Improvements - Parallel file processing with errgroup (check.go, scan.go) - Panic recovery in SSA/analysis goroutines for robustness - PrepareSandboxDB() for PebbleDB compatibility in sandboxed environments ## Security Hardening - Symlink resolution in sandbox mounts (prevents escape attacks) - Root path mounting prevention - Secure temp directory creation with MkdirTemp - Skip symlinks during DB copy operations ## Workflow & Action Updates - Restored *_generated.go filter in diff/audit modes - Added stderr capture (2>&1) for better error diagnostics - New/Deleted file status reporting in analysis workflow - runsc --version verification after gVisor install ## Fixes - Fixed ssautil.AllPackages return type handling - Added rootModule filtering to prevent internal packages as deps - Updated collectDependencies signature for module-aware filtering
1 parent dcf8bb0 commit 932ae11

7 files changed

Lines changed: 573 additions & 294 deletions

File tree

.github/workflows/semantic_analysis.yml

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,22 @@ jobs:
5050
run: |
5151
# 1. Determine Refs
5252
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
53-
BASE_REF="origin/${{ github.event.pull_request.base.ref }}"
53+
PR_BASE="${{ github.event.pull_request.base.ref }}"
54+
if [[ -n "$PR_BASE" ]]; then
55+
BASE_REF="origin/$PR_BASE"
56+
else
57+
# Fallback for local testing with act (PR context not fully populated)
58+
echo "::warning::PR base ref not available. Falling back to HEAD~1."
59+
BASE_REF="HEAD~1"
60+
fi
5461
HEAD_REF="HEAD"
5562
else
56-
git fetch origin main --depth=100
57-
BASE_REF=$(git merge-base origin/main HEAD)
63+
git fetch origin main --depth=100 2>/dev/null || true
64+
BASE_REF=$(git merge-base origin/main HEAD 2>/dev/null || echo "HEAD~1")
5865
HEAD_REF="HEAD"
5966
fi
67+
68+
echo "::notice::Base ref: $BASE_REF, Head ref: $HEAD_REF"
6069
6170
# 2. Setup Base Worktree
6271
# We create the worktree in the workspace so it is mounted into the sandbox.
@@ -156,8 +165,8 @@ jobs:
156165
continue
157166
fi
158167
159-
# Execute SFW
160-
if ! OUTPUT=$(./bin/sfw diff "$OLD_FILE" "$NEW_FILE"); then
168+
# Execute SFW with stderr capture
169+
if ! OUTPUT=$(./bin/sfw diff "$OLD_FILE" "$NEW_FILE" 2>&1); then
161170
echo "::error::sfw failed to process $NEW_FILE_REF"
162171
ERROR_COUNT=$((ERROR_COUNT + 1))
163172
continue
@@ -170,7 +179,6 @@ jobs:
170179
continue
171180
fi
172181
173-
# Parse Results
174182
PCT=$(echo "$OUTPUT" | jq -r '.summary.semantic_match_pct // 0')
175183
MODIFIED=$(echo "$OUTPUT" | jq -r '.summary.modified // 0')
176184
IS_BELOW_100=$(echo "$OUTPUT" | jq -r 'if (.summary.semantic_match_pct // 0) < 100 then "true" else "false" end')

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,4 @@ __debug_bin*
3636
# Local environment files
3737
.env
3838
.env.local
39+
signatures.db/

0 commit comments

Comments
 (0)