Skip to content

Skip grant listing for empty Google Workspace groups#83

Open
c1-dev-bot[bot] wants to merge 1 commit into
mainfrom
c1-dev-bot/epd-1604-skip-empty-groups
Open

Skip grant listing for empty Google Workspace groups#83
c1-dev-bot[bot] wants to merge 1 commit into
mainfrom
c1-dev-bot/epd-1604-skip-empty-groups

Conversation

@c1-dev-bot
Copy link
Copy Markdown

@c1-dev-bot c1-dev-bot Bot commented Feb 20, 2026

Summary

  • Adds SkipGrants annotation to Google Workspace groups with DirectMembersCount == 0 in the groupToResource() function
  • When a group has no direct members, the SDK will skip calling Members.List() for that group, avoiding unnecessary API calls
  • This prevents transient errors (e.g., TLS handshake timeouts) on empty groups from failing the entire sync

Background

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 Group struct includes a DirectMembersCount field that indicates the number of direct members. By annotating groups with 0 members with the SkipGrants annotation, the SDK skips the Grants() call entirely for those resources. This reduces API call volume and eliminates a source of transient failures for empty groups.

Test plan

  • go build ./... passes
  • go test ./... passes
  • Verify that empty groups are correctly skipped during sync
  • Verify that groups with members still have their grants synced correctly

Automated PR Notice

This PR was automatically created by c1-dev-bot as a potential implementation.

This code requires:

  • Human review of the implementation approach
  • Manual testing to verify correctness
  • Approval from the appropriate team before merging

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
@c1-dev-bot c1-dev-bot Bot requested a review from a team February 20, 2026 17:38
@linear
Copy link
Copy Markdown

linear Bot commented Feb 20, 2026

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.

0 participants