Skip to content

Keep the security smoke from waiting behind scans it caused - #1015

Merged
cpojer merged 3 commits into
mainfrom
fix/scanner-smoke-slow
Dec 4, 2026
Merged

cpojer merged 3 commits into
mainfrom
fix/scanner-smoke-slow

Conversation

@Brooooooklyn

Copy link
Copy Markdown
Member

The 1.13 release spent about an hour on the staging security smoke (scan_tglrq85sjqv2, scan_mw5gklue3p4j).

What happened

02:29:53  smoke run 1 starts while staging still deploys the same push
02:44–46  staging platform replaced while scan 1 runs
02:47:51  scan 1 ends incomplete:run_incomplete
02:47:55  kitchen-sink deployed while scanning is on → its own scan, started at once
02:48:00  smoke turns scanning Off (Off cancels queued scans only)
02:51:42  scan 2 queued → waits: only 1 running scan per @cf model
03:17:22  kitchen-sink scan ends (~29.5 min) → scan 2 starts
03:26:09  scan 2 succeeds (~9 min)

Times come from the logs of both smoke runs and the two "Deploy Platform Staging" runs beside them. The smoke deletes its project, and the scan rows go with it, so which session made scan 1 run_incomplete can no longer be read.

Changes

Change Fixes
The CI job waits until no platform-deploy-staging.yml run is active (.github/scripts/wait-for-staging-deploys.ts, actions: read, timeout 270 min) platform replaced mid-scan; kitchen-sink scan taking the slot
The smoke records the platform's scans before it turns the policy on. While its own scan waits, it cancels other projects' new deploy/recovery/exposure/sweep/backfill/fallback scans, only while the policy still has the settings it applied. Gate, rescan and local scans are never touched. the 26-minute queue
Cleanup turns the policy Off first, then cancels such scans that still run (only when this run turned it Off), then deletes the project the 02:47:55 gap
It prints other running scans its scan may wait for easier diagnosis

Not changed

Each scan still takes about 8–15 minutes. The proxy allows 10 @cf calls a minute per model (call-ledger.ts:13, spec D24), so each call waits about 6 s, and a scan of the fixture makes about 90–150 calls. The default model allows 20 a minute (50 with prepaid gateway credits). Raising the guard is a product call and is left out of this PR.

Tests

  • platform/packages/api/test/smoke-security-flow.test.ts: 25 pass, 7 new. The fake API now refuses calls with an aborted signal, as the real client does. The signal case fails when the bug is put back.
  • The wait script was run against this repo (read-only).

🤖 Generated with Claude Code

While the smoke has scanning on, other staging deploys (kitchen-sink) get their own
scan. Only one scan runs per @cf model, and turning the policy Off cancels queued
scans only, so on the 1.13 release a 29-minute kitchen-sink scan held the next smoke
scan in the queue for 26 minutes. The first run also started while staging was still
deploying the same push, so the platform was replaced mid-scan.

- CI waits until no staging deploy is running before the smoke starts.
- The smoke cancels other projects' policy-driven scans that appear during its run,
  while its own scan waits and after it turns the policy Off. It turns the policy Off
  before deleting its project, and names other running scans it may wait for.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Brooooooklyn
Brooooooklyn requested a review from a team as a code owner December 3, 2026 06:01
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Dec 3, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-12-03T06:03:37.644479Z 581dc3d PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 581dc3d206

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread platform/scripts/security-smoke-flow.ts Resolved
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Dec 3, 2026 •

Copy link
Copy Markdown

Cloudflare builds and deploys previews for this pull request. Learn more about Cloudflare previews.

Worker Status Deployment Commit
void-cloud Deployed Preview 429250a

Updated: Dec 3, 2026, 06:25 UTC | Dashboard

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@cpojer

cpojer commented Dec 3, 2026

Copy link
Copy Markdown
Member

Slop Review:

…cked before Off.

GitHub checks the permissions of every job in a called workflow, even skipped ones,
so the staging deploy must grant the security job's `actions: read`. Cleanup picks
the scans this run caused before it turns the policy Off, so a scan someone starts
after Off is left alone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@cpojer cpojer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@cpojer
cpojer merged commit f927faa into main Dec 4, 2026
22 checks passed
@cpojer
cpojer deleted the fix/scanner-smoke-slow branch December 4, 2026 00:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants