Skip to content

Commit f67e906

Browse files
authored
Feature/pr acceptance criteria (#98)
* Transpose rows with columns * Add acceptance criteria to merge a PR with framework modifications
1 parent 01e93f5 commit f67e906

2 files changed

Lines changed: 28 additions & 2 deletions

File tree

.github/workflows/probe-comment.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
name: Post PR Comment
1111
if: >
1212
github.event.workflow_run.event == 'pull_request' &&
13-
github.event.workflow_run.conclusion == 'success'
13+
github.event.workflow_run.conclusion != 'cancelled'
1414
runs-on: ubuntu-latest
1515

1616
permissions:

.github/workflows/probe.yml

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,18 @@ jobs:
199199
print('::warning::No probe results found — nothing to report')
200200
sys.exit(0)
201201
202+
# ── Baseline gate ─────────────────────────────────────────────
203+
BASELINE_TESTS = {'COMP-BASELINE', 'COMP-POST-CL-BODY'}
204+
baseline_failures = []
205+
for sv in server_data:
206+
for r in sv['results']:
207+
if r['id'] in BASELINE_TESTS and r['verdict'] == 'Fail':
208+
baseline_failures.append(f"{sv['name']}: {r['id']} — got {r['got']}")
209+
210+
if baseline_failures:
211+
for f in baseline_failures:
212+
print(f'::error::{f}')
213+
202214
# ── Write data.js ────────────────────────────────────────────
203215
output = {
204216
'commit': {'id': commit_id, 'message': commit_msg, 'timestamp': commit_time},
@@ -238,6 +250,17 @@ jobs:
238250
def short(tid):
239251
return re.sub(r'^(RFC\d+-[\d.]+-|COMP-|SMUG-|MAL-|NORM-)', '', tid)
240252
253+
# Baseline status
254+
if baseline_failures:
255+
lines.append('### ❌ Baseline Failed')
256+
lines.append('')
257+
for bf in baseline_failures:
258+
lines.append(f'- `{bf}`')
259+
lines.append('')
260+
else:
261+
lines.append('### ✅ Baseline Passed')
262+
lines.append('')
263+
241264
for cat_name, title in [('Compliance', 'Compliance'), ('Smuggling', 'Smuggling'), ('MalformedInput', 'Malformed Input'), ('Normalization', 'Header Normalization')]:
242265
cat_tests = [tid for tid in test_ids if lookup[names[0]][tid]['category'] == cat_name]
243266
if not cat_tests:
@@ -268,6 +291,9 @@ jobs:
268291
269292
with open('probe-comment.md', 'w') as f:
270293
f.write('\n'.join(lines))
294+
295+
if baseline_failures:
296+
sys.exit(1)
271297
PYEOF
272298
273299
# ── Upload / publish ───────────────────────────────────────────
@@ -284,7 +310,7 @@ jobs:
284310
run: echo '${{ github.event.number }}' > pr-number.txt
285311

286312
- name: Upload PR comment
287-
if: github.event_name == 'pull_request' && steps.changes.outputs.servers != '[]'
313+
if: always() && github.event_name == 'pull_request' && steps.changes.outputs.servers != '[]'
288314
uses: actions/upload-artifact@v4
289315
with:
290316
name: probe-pr-comment

0 commit comments

Comments
 (0)