Skip to content

fix: update guard policy override test to match []string repos type#5661

Merged
lpcox merged 1 commit into
mainfrom
fix/guard-policy-override-test
May 14, 2026
Merged

fix: update guard policy override test to match []string repos type#5661
lpcox merged 1 commit into
mainfrom
fix/guard-policy-override-test

Conversation

@lpcox
Copy link
Copy Markdown
Collaborator

@lpcox lpcox commented May 14, 2026

Problem

TestResolveGuardPolicyOverride/cli_changed_with_owner_and_repo_builds_scoped_policy fails because BuildAllowOnlyPolicy returns []string{"myorg/myrepo"} for owner+repo scoped policies, but the test asserted against a plain string "myorg/myrepo".

Fix

One-line fix: update the assertion to expect []string{"myorg/myrepo"} instead of "myorg/myrepo".

Verification

make agent-finished passes — all checks green.

BuildAllowOnlyPolicy returns []string for owner+repo scoped policies,
but the test asserted against a plain string. Update the assertion to
match the actual type.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 14, 2026 05:28
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 a failing config unit test to align with the current BuildAllowOnlyPolicy behavior where owner+repo scoped allow-only policies store repos as a []string (rather than a plain string). This keeps the guard policy override tests consistent with the guard policy construction logic.

Changes:

  • Fixes TestResolveGuardPolicyOverride assertion to expect []string{"myorg/myrepo"} for owner+repo scoped allow-only policies.
Show a summary per file
File Description
internal/config/guard_policy_override_test.go Updates the scoped-repo assertion to match AllowOnly.Repos being a []string for owner/repo scopes.

Copilot's findings

Tip

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

  • Files reviewed: 1/1 changed files
  • Comments generated: 0

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