fix: remove enterpriseLicensesAvailable gate from ResourceSyncers - #138
Conversation
The SDK calls ResourceSyncers() during connector initialization (newBuilder), which runs BEFORE Validate(). The enterpriseLicensesAvailable flag was set in Validate, so it was always false when ResourceSyncers ran — causing enterprises to never be passed to userBuilder or enterpriseRoleBuilder. Found during end-to-end validation: SAML emails were missing because checkOrgSAML saw an empty enterprises slice and defaulted to samlStateDisabled. Fix: always pass gh.enterprises through in ResourceSyncers. Graceful degradation for inaccessible APIs is already handled at sync time by fetchAndStoreEnterpriseSAML (which warns and falls back to samlStateDisabled). The Validate probe is kept as a diagnostic debug log only. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Claude finished @madison-c-evans's task in 56s —— View job PR Review: fix: remove enterpriseLicensesAvailable gate from ResourceSyncers
Verdict: Looks good ✅ This is a clean, well-scoped fix for a real ordering bug. The analysis is correct: The bug: The fix: Remove the dead gate entirely and pass
One minor observation: The No issues found. Ship it. |
|
Email loading issue still seen when I tried validation. The SDK calls |
Summary
enterpriseLicensesAvailablegate fromResourceSyncers()— it was alwaysfalsebecause the SDK callsResourceSyncers()duringnewBuilder()initialization, beforeValidate()runsfetchAndStoreEnterpriseSAMLWhat went wrong
During end-to-end validation on the sandbox, SAML emails were missing. Debug logs showed
checkOrgSAMLhittingsamlStateDisabled("no SAML identity provider found for org, disabling SAML enrichment") becauselen(u.enterprises) == 0— the enterprises slice was empty despite being configured. Root cause:ResourceSyncers()was gating on a flag set inValidate(), but the SDK callsResourceSyncers()first.Test plan
go mod replacepointing baton-github-enterprise at this fixgo buildandgo testpass🤖 Generated with Claude Code