Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: run os.exit on persistent post run only when executor has non-zero exitcode #4138

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kraashen
Copy link

@kraashen kraashen commented Oct 18, 2023

As described in issue #4137 and linked reproduction sample, when running golangci-lint in a Magefile target in a serial flow with other targets with SerialCtxDeps, the serially executed target pipeline is exited prematurely due to os.exit.

Not sure if this PR is applicable for the context in the PersistentPostRunE handler that is passed to Cobra, but this PR attempts to by implementing a check where:

  • os.Exit is run only when exit code of the executor was non-zero
  • return nil otherwise

Fixes #4137

@boring-cyborg
Copy link

boring-cyborg bot commented Oct 18, 2023

Hey, thank you for opening your first Pull Request !

@CLAassistant
Copy link

CLAassistant commented Oct 18, 2023

CLA assistant check
All committers have signed the CLA.

@ldez ldez self-requested a review October 18, 2023 13:22
@ldez ldez added area: CLI Related to CLI blocked Need's direct action from maintainer labels Oct 18, 2023
@kraashen kraashen force-pushed the bugfix/persistent-post-run-early-exit branch from 34382d0 to 23c16fa Compare October 19, 2023 16:41
@kraashen kraashen force-pushed the bugfix/persistent-post-run-early-exit branch from 23c16fa to e861ab3 Compare October 23, 2023 13:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: CLI Related to CLI blocked Need's direct action from maintainer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Persistent post run exits early when run is successful in Magefile targets
3 participants