fix: return distinct exit code 2 on internal errors#7468
Open
raajheshkannaa wants to merge 1 commit intobridgecrewio:mainfrom
Open
fix: return distinct exit code 2 on internal errors#7468raajheshkannaa wants to merge 1 commit intobridgecrewio:mainfrom
raajheshkannaa wants to merge 1 commit intobridgecrewio:mainfrom
Conversation
When checkov encounters internal errors (e.g., failed API calls to get mappings/guidelines, report errors), it now returns exit code 2 instead of silently continuing with exit code 0. Exit code semantics: - 0: all checks passed (or soft-fail) - 1: one or more checks failed - 2: internal error occurred during the scan The --no-fail-on-crash flag still suppresses exit code 2 to 0. Internal errors are tracked via _internal_error_occurred flag on the Checkov instance and internal_error_occurred on bc_integration, so errors caught silently (like get_public_run_config JSON decode failures) are properly surfaced in the exit code. Closes bridgecrewio#7393
Author
|
Hi, could a maintainer approve the CI workflow run? The security scan check appears to be waiting for approval since this is an external contributor PR. Thanks! |
Author
|
Friendly bump. CI workflow has been waiting for maintainer approval since March 17. Could someone approve the workflow run so CI can validate this? Happy to address any feedback once tests run. |
Author
|
Friendly bump. CI workflow approval is still pending. Could a maintainer approve the workflow run? Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #7393
Summary
get_public_run_config) now return exit code 2 instead of being silently swallowed--no-fail-on-crashflag support: returns 0 on internal errors when setExit code semantics
When
--no-fail-on-crashis set, internal errors return 0 instead of 2. Check failures (exit 1) still take precedence over suppressed internal errors.Test plan
--no-fail-on-crashoverride, platform integration flag, exit code helper