Skip to content

fix: composer non-zero exit still parses results and uploads#3

Merged
PrestaEdit merged 1 commit into
mainfrom
fix/composer-nonzero-still-report
Jul 11, 2026
Merged

fix: composer non-zero exit still parses results and uploads#3
PrestaEdit merged 1 commit into
mainfrom
fix/composer-nonzero-still-report

Conversation

@PrestaEdit

Copy link
Copy Markdown
Contributor

Bug

The PHP library's composer script (composer run prestaflow:json:file) exits 1 whenever any test fails — that's its normal reporting channel. On top of that, the CLI may exit non-zero for benign PHP warnings.

The action was doing:

try { await runComposer(...) }
catch (e) { stepFailed = true; throw e; }

Rethrowing meant parseResults(), uploadToApi(), uploadArtifacts(), setOutputs() and the PR comment were all skipped. Result: any workflow where at least one test failed showed completely empty outputs and no upload, defeating the whole point of the action.

Fix

Log a core.warning, keep stepFailed=true (so Flashlight teardown captures logs), and continue to the parse/upload/report path. The final core.setFailed() still fires when report.failed > 0, so job status stays honest.

Reproduced by

The smoke run at github-action-smoke/actions/runs/29165011362 shows composer exiting 1 (one test asserting PRESTAFLOW_FO_URL != null failing in the no-Flashlight job) and every output coming out empty.

Test plan

  • Existing 41 unit tests still pass.
  • Bundle rebuilt.
  • Re-run smoke workflow after merge — expect populated outputs.

🤖 Generated with Claude Code

The library's composer script exits 1 whenever any test fails — that's
its normal reporting channel. Rethrowing on exec.exec's non-zero exit
made the action skip parse + API upload + artifact upload + PR comment
+ outputs, leaving observers with completely empty outputs whenever a
single test failed.

Now: log a core.warning, keep stepFailed=true (so Flashlight teardown
captures logs), and continue to the parse/upload/report path. The
final core.setFailed still fires when report.failed > 0.

If composer literally could not launch (missing binary), the caller
sees the message in the warning; parsing will find no results.json and
fall through to zero-report + warning.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@PrestaEdit
PrestaEdit merged commit 653e274 into main Jul 11, 2026
1 check passed
@PrestaEdit
PrestaEdit deleted the fix/composer-nonzero-still-report branch July 11, 2026 19:33
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