Skip to content

fix: policy behavior when no data capture#10

Merged
gusfcarvalho merged 2 commits into
mainfrom
gc-fix-some-policies-fixes
May 12, 2026
Merged

fix: policy behavior when no data capture#10
gusfcarvalho merged 2 commits into
mainfrom
gc-fix-some-policies-fixes

Conversation

@gusfcarvalho
Copy link
Copy Markdown
Contributor

No description provided.

Signed-off-by: Gustavo Carvalho <gustavo.carvalho@container-solutions.com>
Copilot AI review requested due to automatic review settings May 12, 2026 14:19
Copy link
Copy Markdown

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

Adjusts GitHub organization policies to treat missing/undisclosed telemetry as “skipped” rather than incorrectly failing (e.g., when data capture is disabled or the token lacks permissions), by introducing skip_reason outputs and refining null/missing input handling.

Changes:

  • Add skip_reason to SSO and IP allow-list policies when relevant input data is unavailable.
  • Change input defaults from empty object/list to null to distinguish “missing telemetry” from “misconfigured setting”.
  • Update/add policy tests to validate skip behavior for IP allow-list and expose skip reason for SSO.

Reviewed changes

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

File Description
policies/gh_org_sso_enabled.rego Introduces skip_reason when sso data is unavailable, but currently leaves violation evaluation unguarded.
policies/gh_org_sso_enabled_test.rego Adds a test asserting skip_reason for sso: null (but doesn’t assert expected violation behavior).
policies/gh_org_ip_allowlist_enabled.rego Introduces skip_reason and prevents violations when ip_allow_list data is missing/null.
policies/gh_org_ip_allowlist_enabled_test.rego Updates tests to ensure missing/null input yields no violations and produces the expected skip_reason.

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

Comment thread policies/gh_org_sso_enabled.rego Outdated
Comment thread policies/gh_org_sso_enabled.rego Outdated
Comment thread policies/gh_org_sso_enabled_test.rego
Signed-off-by: Gustavo Carvalho <gustavo.carvalho@container-solutions.com>
Copy link
Copy Markdown

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 4 out of 4 changed files in this pull request and generated no new comments.

@gusfcarvalho gusfcarvalho merged commit a038386 into main May 12, 2026
6 checks passed
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