Skip to content

Return 1 only in case of error#1282

Merged
robertwoj-microsoft merged 1 commit into
devfrom
robertwoj/38218580
Jun 3, 2026
Merged

Return 1 only in case of error#1282
robertwoj-microsoft merged 1 commit into
devfrom
robertwoj/38218580

Conversation

@robertwoj-microsoft
Copy link
Copy Markdown
Contributor

@robertwoj-microsoft robertwoj-microsoft commented Jun 2, 2026

Description

Currently the compliance-engine-assessor returns an error in case of incompliance. I want the tool to return 1 only if there was an actual error and treat incompliance as regular state.

Use RAII to release the log handle automatically.

Checklist

  • I have read the contribution guidelines.
  • I added unit-tests to validate my changes. All unit tests are passing.
  • I have merged the latest dev branch prior to this PR submission.
  • I ran pre-commit on my changes prior to this PR submission.
  • I submitted this PR against the dev branch.

@robertwoj-microsoft robertwoj-microsoft requested review from a team as code owners June 2, 2026 13:04
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 2, 2026

Test Results

1 176 tests   1 176 ✅  1m 17s ⏱️
   66 suites      0 💤
    1 files        0 ❌

Results for commit f648c6c.

♻️ This comment has been updated with latest results.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates the Compliance Engine assessor CLI to treat “non-compliant” results as a normal outcome (exit code 0) and reserve exit code 1 for actual execution/engine errors, while also improving log-handle lifetime management.

Changes:

  • Change assessor exit code semantics to return 1 only for errors (not for non-compliance).
  • Add --continue-on-error (-e) to skip rules that fail due to engine errors and continue processing, tracking whether any error occurred.
  • Wrap the log handle in an RAII-managed std::unique_ptr with a custom deleter.

Comment thread src/modules/complianceengine/src/assessor/Main.cpp
kkanas
kkanas previously approved these changes Jun 3, 2026
danielszot
danielszot previously approved these changes Jun 3, 2026
Base automatically changed from robertwoj/38214321 to dev June 3, 2026 10:39
@robertwoj-microsoft robertwoj-microsoft dismissed stale reviews from danielszot and kkanas June 3, 2026 10:39

The base branch was changed.

@robertwoj-microsoft robertwoj-microsoft merged commit 592a2d2 into dev Jun 3, 2026
83 of 84 checks passed
@robertwoj-microsoft robertwoj-microsoft deleted the robertwoj/38218580 branch June 3, 2026 14:58
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.

4 participants