Skip to content

fix(fix): exit 5 when computed fixes go unapplied - #1624

Merged
Martin Torp (mtorp) merged 1 commit into
v1.xfrom
martin/pass-through-not-applied-exit-code
Oct 16, 2026
Merged

Martin Torp (mtorp) merged 1 commit into
v1.xfrom
martin/pass-through-not-applied-exit-code

Conversation

@mtorp

@mtorp Martin Torp (mtorp) commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Follow-up to #1584. Coana exits with 5 when it computed fixes it could not apply, and lists them under notApplied in its --output-file. Local-mode socket fix already reads that list and fails with "Some computed fixes were not applied" or "No computed fixes were applied". But that result had no exit code, so outputFixResult fell back to 1. A CI job running socket fix could not tell "some fixes were left out" from "the run failed".

What changes

  • The not-applied result in local mode now carries code: 5, so socket fix exits with 5, the same code Coana uses.
  • Any other failure still exits with 1. PR mode is unchanged.
  • [Unreleased] changelog entry under Changed.

Testing

The two not-applied cases in handle-fix-limit.test.mts now assert code: 5. That file passes, and check:tsc and lint are clean.

Expected reviewer effort: Stamp


Note

Low Risk
Small, targeted change to local-mode exit semantics and tests; no change to fix application logic or PR mode.

Overview
Local socket fix now exits with code 5 when Coana computed fixes that could not be applied (none or only some), matching Coana’s behavior so CI can distinguish that outcome from a hard failure (still exit 1).

The local-mode failure path in coanaFix now sets code: COANA_FIXES_NOT_APPLIED_EXIT_CODE on the result object, which outputFixResult already maps to process.exitCode. PR mode is unchanged. Tests assert code: 5 for the not-applied scenarios; changelog documents the behavior and notApplied in --output-file JSON.

Reviewed by Cursor Bugbot for commit cbbdbfa. Configure here.

Coana exits with 5 when it computed fixes it could not apply, and lists
them under notApplied in its output file. Local-mode socket fix already
reads that list and fails with "Some computed fixes were not applied",
but the result carried no exit code, so the command exited with 1.
Automation could not tell a partly applied run from a failed one.

The not-applied result now carries code 5, which outputFixResult uses
as the process exit code. Other failures still exit with 1.
@mtorp
Martin Torp (mtorp) marked this pull request as ready for review October 16, 2026 10:41
@mtorp
Martin Torp (mtorp) merged commit e88e81c into v1.x Oct 16, 2026
11 checks passed
@mtorp
Martin Torp (mtorp) deleted the martin/pass-through-not-applied-exit-code branch October 16, 2026 10:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant