Skip to content

fix: allowlist checks#10

Merged
gusfcarvalho merged 2 commits into
mainfrom
gc-fix-allowlist-behavior
May 12, 2026
Merged

fix: allowlist checks#10
gusfcarvalho merged 2 commits into
mainfrom
gc-fix-allowlist-behavior

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:18
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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

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

Comment thread main.go
Comment thread main.go Outdated
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 7 out of 7 changed files in this pull request and generated 3 comments.

Comments suppressed due to low confidence (1)

internal/data.go:132

  • Admin member collection has the same “missing evidence vs empty list” ambiguity as teams: allAdminMembers is initialized to an empty slice, and on API error the code breaks and returns members: []. This makes it impossible for policies to distinguish “no admin members” from “failed to fetch admin members”, which can lead to incorrect evaluations when collection fails. Consider returning a nil slice on collection failure (or representing collection status explicitly).
	allAdminMembers := make([]*github.User, 0)
	memberOpt := &github.ListMembersOptions{
		Role:        "admin",
		ListOptions: github.ListOptions{PerPage: 100},
	}

	for {
		members, resp, err := df.client.Organizations.ListMembers(ctx, organization, memberOpt)
		if err != nil {
			df.logger.Warn("Skipping admin member collection after GitHub API error", "org", organization, "error", err)
			accumulatedErrors = errors.Join(accumulatedErrors, fmt.Errorf("failed to fetch admin members: %w", err))
			break
		}

		allAdminMembers = append(allAdminMembers, members...)
		if resp.NextPage == 0 {
			break
		}
		memberOpt.Page = resp.NextPage
	}

Comment thread main.go
Comment thread internal/data.go
Comment on lines 94 to 111
@@ -105,7 +110,7 @@ func (df DataFetcher) FetchData(ctx context.Context, organization string) (*Gith
paginationOpt.Page = resp.NextPage
}
Comment thread internal/data.go
@gusfcarvalho gusfcarvalho merged commit 2a018f1 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