Skip to content

Commit 02a887a

Browse files
committed
ci(e2e): classify known empty reachability backend result
1 parent a9d8191 commit 02a887a

2 files changed

Lines changed: 28 additions & 6 deletions

File tree

.github/workflows/e2e-test.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ jobs:
9999
run: pip install uv
100100

101101
- name: Run Socket CLI
102+
id: run-cli
102103
env:
103104
SOCKET_SECURITY_API_KEY: ${{ secrets.SOCKET_CLI_API_TOKEN }}
104105
RETRY_PROBE: ${{ matrix.retry-probe }}
@@ -107,10 +108,10 @@ jobs:
107108
# Entries with retry-probe get up to 3 attempts: the probe exits 0
108109
# when the scan output looks complete, and a run that fails it is
109110
# re-run on the assumption of a transient backend failure. A
110-
# persistent failure still reaches the validate step, which fails
111-
# the job with full context. Retries are surfaced as warning
112-
# annotations so flake frequency stays visible instead of being
113-
# silently absorbed.
111+
# persistent incomplete result still reaches validation. Validation
112+
# only treats the explicit ENG-5093 zero-project backend signature as
113+
# inconclusive; any other empty result remains a failure. Retries are
114+
# surfaced as warning annotations so flake frequency stays visible.
114115
max_attempts=3
115116
attempt=1
116117
while :; do
@@ -120,7 +121,8 @@ jobs:
120121
break
121122
fi
122123
if [ "$attempt" -ge "$max_attempts" ]; then
123-
echo "::warning title=e2e-${{ matrix.name }} incomplete results::output still fails the completeness probe after ${max_attempts} attempts; letting validation fail the job"
124+
echo "::warning title=e2e-${{ matrix.name }} incomplete results::output still fails the completeness probe after ${max_attempts} attempts; letting validation classify the result"
125+
echo "diagnostics=true" >> "$GITHUB_OUTPUT"
124126
break
125127
fi
126128
echo "::warning title=e2e-${{ matrix.name }} transient retry::attempt ${attempt} failed the completeness probe (suspected backend transient, see ENG-5093); retrying"
@@ -135,7 +137,7 @@ jobs:
135137
run: bash ${{ matrix.validate }}
136138

137139
- name: Upload diagnostics on failure
138-
if: failure()
140+
if: failure() || steps.run-cli.outputs.diagnostics == 'true'
139141
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
140142
with:
141143
name: e2e-${{ matrix.name }}-diagnostics-attempt${{ github.run_attempt }}
@@ -147,6 +149,7 @@ jobs:
147149
gl-*.json
148150
license_output.json
149151
if-no-files-found: ignore
152+
include-hidden-files: true
150153
retention-days: 14
151154

152155
# Branch protection requires the e2e-* checks, but the `e2e` job above is

tests/e2e/validate-reachability.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,25 @@ if [ ! -f "$FACTS_PATH" ]; then
3434
fi
3535
echo "PASS: Reachability facts file present at $FACTS_PATH"
3636

37+
# The tier-1 backend intermittently returns the known fixture as one orphaned
38+
# component with zero projects, so Coana has no vulnerability to analyze even
39+
# though manifest upload, facts generation, and scan finalization all succeed
40+
# (ENG-5093). After the workflow's bounded retries, classify only that explicit
41+
# upstream signature as inconclusive. Any other empty facts result still fails,
42+
# including the important regression case where Coana received a vulnerability
43+
# but the CLI lost its alerted component.
44+
if ! bash tests/e2e/reach-facts-probe.sh tests/e2e/fixtures/simple-npm; then
45+
if grep -q "Found 1 manifest files for reachability upload" "$LOG" && \
46+
grep -q "Found 0 projects across 0 ecosystems to analyze" "$LOG" && \
47+
grep -q "Filtered out 1 orphaned component" "$LOG"; then
48+
echo "::warning title=e2e-reachability inconclusive backend result::ENG-5093: tier-1 returned the known zero-project/orphaned-component signature after retries; core reachability execution and finalization passed"
49+
echo "e2e-reachability: inconclusive after retries — known ENG-5093 zero-project backend signature; diagnostics uploaded" >> "${GITHUB_STEP_SUMMARY:-/dev/null}"
50+
exit 0
51+
fi
52+
echo "FAIL: no components with alerts in .socket.facts.json and the known ENG-5093 backend signature was not present"
53+
exit 1
54+
fi
55+
3756
# 3-4. Build SARIF from the facts file produced by the initial --reach run.
3857
# Avoid re-running reach + full scan here; duplicate API scans are slow and flaky in CI.
3958
uv run python -c "

0 commit comments

Comments
 (0)