Skip to content

test(migrated): cover the image drive path that reddened develop's Sonar gate - #765

Merged
ffroliva merged 1 commit into
developfrom
test/760-migrated-image-drive-coverage
Sep 8, 2026
Merged

ffroliva merged 1 commit into
developfrom
test/760-migrated-image-drive-coverage

Conversation

@ffroliva

@ffroliva ffroliva commented Sep 8, 2026

Copy link
Copy Markdown
Owner

Why develop is red

#750's own checks were 14/14 green, but SonarCloud analysis is skipped on fork PRs — so the gate first ran on the merge commit b4746204 and failed there:

new_coverage  77.4%  vs  80  ->  ERROR

Only that one condition. No new smells, no unreviewed hotspots. 42 uncovered new lines in migrated_composer.py, 3 in batchexecute.py; the single biggest block was run_images (2094-2124), entirely unexecuted because every image test mocked it away.

What is covered now

The coverage gap and the risk were the same thing — what was untested is the orchestration that decides whether a run is trustworthy:

Test Pins
run_images happy t2i the whole guard -> project -> editor -> settings -> prompt -> submit chain
unported form refused before the page is touched (no goto, no submit)
no --project ConfigurationError up front, not a mid-run failure with the editor already mounted
references uploaded but never bound the silent-degrade-to-T2I case — Flow accepts the submit, bills it, and returns a plausible image that ignored the reference
image submit missing + credits warning InsufficientCreditsError, not drift
image submit missing, no warning drift, so the guard cannot swallow real frontend change
image submit stays disabled drift, not a hang

The credits pair matters because the image path carries its own copy of the video path's check, so it needed its own proof: a drained wallet REPLACES Flow's submit button (#721), and calling that selector drift tells the user to file a frontend bug no code change can fix.

Verification

migrated_composer.py   88% -> 92%   (uncovered 92 -> 67)
run_images (2094-2124) unexecuted -> fully covered
pytest tests/api/transports tests/features   1083 passed, 1 skipped
ruff check - ruff format --check - pyright   clean (0 errors)

Scope

No src/ change, so no Flow surface is touched and an e2e run is explicitly out of scope for this PR rather than left blank.

Separately: pip-audit is also red on develop, and is NOT from this or #750

Dependency audit (pip-audit) fails on b4746204 with 5 CVEs in httpx2/httpcore2 2.9.1 (fixes at 2.10.0/2.11.0/2.12.0). Neither #750 nor #762 touched uv.lock or pyproject.toml, and the same job passed on #750's PR run about an hour earlier — so this is a newly published advisory against an unchanged lock, and it needs a lock bump in its own PR.

Refs #639

…nar gate

`run_images` and the trust branches of `submit_images_and_observe` had no offline
coverage at all — every image test mocked `run_images` away. That put
`new_coverage` at 77.4% against an 80% gate, so #750's merge turned develop's
SonarCloud check red even though the PR itself was 14/14 green: SonarCloud is
skipped on fork PRs, so the gate first ran on the merge commit.

The coverage gap and the risk were the same thing. What was untested was the
orchestration that decides whether a run is trustworthy:

- `run_images` end to end against the existing FakePage — the happy t2i path, the
  pre-submit refusal of an unported form, the missing-`--project` ConfigurationError,
  and the case where references upload but never become mention chips. That last one
  is the silent-degrade-to-T2I failure: Flow accepts the submit, bills it, and returns
  a plausible image that ignored the reference.
- The image submit's own credits check. It is a second copy of the video path's, so it
  needed its own proof: a drained wallet REPLACES Flow's submit button (#721), and
  reporting that as selector drift tells the user to file a frontend bug that no code
  change can fix. Both directions are pinned — warning present means insufficient
  credits, warning absent means the anchor really is gone and drift is correct.
- The submit-stays-disabled timeout.

migrated_composer.py coverage 88% -> 92%, uncovered lines 92 -> 67; `run_images`
(2094-2124) goes from entirely unexecuted to fully covered.

No src/ change, so no Flow surface is touched and an e2e run is out of scope for
this commit rather than left blank.
@ffroliva
ffroliva force-pushed the test/760-migrated-image-drive-coverage branch from 4832592 to 638198e Compare September 8, 2026 22:03
@ffroliva
ffroliva merged commit 9b11517 into develop Sep 8, 2026
15 checks passed
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.

1 participant