Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion .github/workflows/probe-comment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
name: Post PR Comment
if: >
github.event.workflow_run.event == 'pull_request' &&
github.event.workflow_run.conclusion == 'success'
github.event.workflow_run.conclusion != 'cancelled'
runs-on: ubuntu-latest

permissions:
Expand Down
46 changes: 34 additions & 12 deletions .github/workflows/probe.yml
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,18 @@ jobs:
print('::warning::No probe results found — nothing to report')
sys.exit(0)

# ── Baseline gate ─────────────────────────────────────────────
BASELINE_TESTS = {'COMP-BASELINE', 'COMP-POST-CL-BODY'}
baseline_failures = []
for sv in server_data:
for r in sv['results']:
if r['id'] in BASELINE_TESTS and r['verdict'] == 'Fail':
baseline_failures.append(f"{sv['name']}: {r['id']} — got {r['got']}")

if baseline_failures:
for f in baseline_failures:
print(f'::error::{f}')

# ── Write data.js ────────────────────────────────────────────
output = {
'commit': {'id': commit_id, 'message': commit_msg, 'timestamp': commit_time},
Expand Down Expand Up @@ -238,40 +250,50 @@ jobs:
def short(tid):
return re.sub(r'^(RFC\d+-[\d.]+-|COMP-|SMUG-|MAL-|NORM-)', '', tid)

# Baseline status
if baseline_failures:
lines.append('### ❌ Baseline Failed')
lines.append('')
for bf in baseline_failures:
lines.append(f'- `{bf}`')
lines.append('')
else:
lines.append('### ✅ Baseline Passed')
lines.append('')

for cat_name, title in [('Compliance', 'Compliance'), ('Smuggling', 'Smuggling'), ('MalformedInput', 'Malformed Input'), ('Normalization', 'Header Normalization')]:
cat_tests = [tid for tid in test_ids if lookup[names[0]][tid]['category'] == cat_name]
if not cat_tests:
continue
lines.append(f'### {title}')
lines.append('')
# Header row: Server | test1 | test2 | ...
hdr = '| Server | ' + ' | '.join(f'`{short(tid)}`' for tid in cat_tests) + ' |'
sep = '|---' + ''.join('|:---:' for _ in cat_tests) + '|'
# Header row: Test | Expected | Server1 | Server2 | ...
hdr = '| Test | Expected | ' + ' | '.join(f'**{n}**' for n in names) + ' |'
sep = '|---|---' + ''.join('|:---:' for _ in names) + '|'
lines.append(hdr)
lines.append(sep)
# Expected row
exp_cells = []
# One row per test
for tid in cat_tests:
first = lookup[names[0]][tid]
exp_cells.append(first['expected'])
lines.append('| **Expected** | ' + ' | '.join(exp_cells) + ' |')
# Server rows
for n in names:
expected = first['expected']
cells = []
for tid in cat_tests:
for n in names:
r = lookup[n].get(tid)
if not r:
cells.append('—')
else:
icon = '✅' if r['verdict'] == 'Pass' else ('⚠️' if r['verdict'] == 'Warn' else '❌')
cells.append(f"{icon}`{r['got']}`")
lines.append(f"| **{n}** | " + ' | '.join(cells) + ' |')
lines.append(f"| `{short(tid)}` | {expected} | " + ' | '.join(cells) + ' |')
lines.append('')

lines.append(f"<sub>Commit: {commit_id[:7]}</sub>")

with open('probe-comment.md', 'w') as f:
f.write('\n'.join(lines))

if baseline_failures:
sys.exit(1)
PYEOF

# ── Upload / publish ───────────────────────────────────────────
Expand All @@ -288,7 +310,7 @@ jobs:
run: echo '${{ github.event.number }}' > pr-number.txt

- name: Upload PR comment
if: github.event_name == 'pull_request' && steps.changes.outputs.servers != '[]'
if: always() && github.event_name == 'pull_request' && steps.changes.outputs.servers != '[]'
uses: actions/upload-artifact@v4
with:
name: probe-pr-comment
Expand Down
Loading