Skip to content

Return failure exit code from log replay when errors are present (#1389)#1389

Open
anushamukka-dev wants to merge 1 commit into
facebook:mainfrom
anushamukka-dev:export-D112730861
Open

Return failure exit code from log replay when errors are present (#1389)#1389
anushamukka-dev wants to merge 1 commit into
facebook:mainfrom
anushamukka-dev:export-D112730861

Conversation

@anushamukka-dev

@anushamukka-dev anushamukka-dev commented Jul 21, 2026

Copy link
Copy Markdown

Summary:

Fixes the FIXME(JakobDegen)(easy) in buck2_cmd_log_client/src/replay.rs.

Previously, buck2 log replay printed any errors from the replayed
command to stderr but then unconditionally returned
ExitResult::success(), so a replay of a failed command exited 0.

Now, when res.errors is non-empty, we return
ExitResult::from_command_result_errors(res.errors), which derives the
appropriate exit code from the errors' tags (the errors were already
emitted to stderr by the loop above, so they are passed as emitted
errors and not re-printed).

Reviewed By: 8Keep

Differential Revision: D112730861

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jul 21, 2026
@meta-codesync

meta-codesync Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

@anushamukka-dev has exported this pull request. If you are a Meta employee, you can view the originating Diff in D112730861.

@8Keep 8Keep left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Review automatically exported from Phabricator review in Meta.

…acebook#1389)

Summary:

Fixes the `FIXME(JakobDegen)(easy)` in `buck2_cmd_log_client/src/replay.rs`.

Previously, `buck2 log replay` printed any errors from the replayed
command to stderr but then unconditionally returned
`ExitResult::success()`, so a replay of a failed command exited 0.

Now, when `res.errors` is non-empty, we return
`ExitResult::from_command_result_errors(res.errors)`, which derives the
appropriate exit code from the errors' tags (the errors were already
emitted to stderr by the loop above, so they are passed as emitted
errors and not re-printed).

Reviewed By: 8Keep

Differential Revision: D112730861
@meta-codesync meta-codesync Bot changed the title Return failure exit code from log replay when errors are present Return failure exit code from log replay when errors are present (#1389) Jul 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants