Skip grant listing for empty Google Workspace groups#83
Open
c1-dev-bot[bot] wants to merge 1 commit into
Open
Conversation
Add SkipGrants annotation to groups with DirectMembersCount == 0 during groupToResource(). This prevents the SDK from calling Members.List() for empty groups, avoiding unnecessary API calls and transient errors (e.g., TLS handshake timeouts) that can fail the entire sync. When a group has no direct members, there are no grants to list, so skipping the grants step is both an optimization and a resilience improvement. Ref: EPD-1604
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
SkipGrantsannotation to Google Workspace groups withDirectMembersCount == 0in thegroupToResource()functionMembers.List()for that group, avoiding unnecessary API callsBackground
An issue was reported where the Google Workspace connector was experiencing persistent sync failures. The root cause was TLS handshake timeouts when listing members for Google groups. The baton-sdk uses a fail-fast approach where one resource's grant failure stops the entire sync.
The Google Admin API's
Groupstruct includes aDirectMembersCountfield that indicates the number of direct members. By annotating groups with 0 members with theSkipGrantsannotation, the SDK skips theGrants()call entirely for those resources. This reduces API call volume and eliminates a source of transient failures for empty groups.Test plan
go build ./...passesgo test ./...passesAutomated PR Notice
This PR was automatically created by c1-dev-bot as a potential implementation.
This code requires: