Skip to content

feat: support skips for policy-manager#83

Merged
gusfcarvalho merged 2 commits into
mainfrom
gc-feat-policy-manager-skip
May 11, 2026
Merged

feat: support skips for policy-manager#83
gusfcarvalho merged 2 commits into
mainfrom
gc-feat-policy-manager-skip

Conversation

@gusfcarvalho
Copy link
Copy Markdown
Contributor

@gusfcarvalho gusfcarvalho commented May 11, 2026

Behavior:

  • When skip_reason="non-empty" in a policy, no evidence is produced
  • When skip_reason=="" or not set (for compatibility), evidence is produced normally
  • Skip check bypasses title validation
    Debug log message: "Skipping evidence for policy {policy_file} {policy_package}: reason"

Signed-off-by: Gustavo Carvalho <gustavo.carvalho@container-solutions.com>
Copilot AI review requested due to automatic review settings May 11, 2026 12:02
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

This PR adds first-class support for “skipped” policies in the policy-manager pipeline, allowing a policy to explicitly opt out of evidence generation via a skip field in Rego output.

Changes:

  • Extend policy evaluation output (EvalOutput) with a Skip boolean decoded from policy results.
  • Update PolicyProcessor.GenerateResults to bypass evidence creation when skip=true.
  • Add unit tests covering skip=true, skip=false, missing skip defaulting to false, and validating that skip bypasses title validation.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
policy-manager/policy-manager.go Adds Skip to EvalOutput and short-circuits evidence generation when a policy result is marked skipped.
policy-manager/policy-manager_test.go Adds test coverage for skip decoding and for ensuring skipped policies produce no evidence (and no title-validation errors).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Signed-off-by: Gustavo Carvalho <gustavo.carvalho@container-solutions.com>
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

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

Comment thread policy-manager/policy-manager.go
Comment thread policy-manager/policy-manager.go
@gusfcarvalho gusfcarvalho merged commit 27f350b into main May 11, 2026
7 checks passed
@gusfcarvalho gusfcarvalho deleted the gc-feat-policy-manager-skip branch May 11, 2026 12:17
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.

2 participants