Refactor to use StaticEntitlements for standard resource types#145
Refactor to use StaticEntitlements for standard resource types#145
Conversation
This change refactors the Entitlements implementation for Org, Team, Repository, OrgRole, and EnterpriseRole to use StaticEntitlements. By moving these to static templates, we reduce the number of tasks generated during a sync, as the SDK can now define these entitlements once per resource type instead of per resource instance. This is especially impactful for connectors with a large number of repositories or teams. Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Claude finished @btipling's task in 2m 40s —— View job PR Review: Refactor to use StaticEntitlements
Overall: This looks good. The refactor is clean, consistent across all five files, and correctly implements the What the PR doesEach of the five resource types (Org, Team, Repository, OrgRole, EnterpriseRole) is refactored in the same way:
This is the correct pattern — the SDK type-checks for Correctness
Nits (non-blocking)
SummaryClean refactor, consistent pattern across all resource types, no correctness issues. The performance win from reducing per-resource entitlement tasks (especially for connectors with many repos/teams) is a clear benefit. LGTM. |
luisina-santos
left a comment
There was a problem hiding this comment.
Without SkipEntitlements annotation I think baton-sdk still goes for each resources trying to sync Entitlements also with StaticEntitlements implemented
…ments Prevents the syncer from calling the per-resource Entitlements() method (which now returns nil) for types that define their entitlements via StaticEntitlements instead. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Claude finished @btipling's task in 1m 57s —— View job PR Review: Refactor to use StaticEntitlements
Overall: This looks good. The refactor is clean and consistent, and the follow-up commit correctly addresses luisina-santos' feedback about needing What the PR does (2 commits)Commit 1 (
Commit 2 ( Provisioning compatibility (Grant/Revoke)I verified all four Grant methods that parse entitlement IDs:
All Grant/Revoke methods derive resource context from Nits (non-blocking)
SummaryClean refactor with correct SDK interface implementation. The |
This PR refactors the Entitlements implementation for Org, Team, Repository, OrgRole, and EnterpriseRole to use StaticEntitlements.
By moving these to static templates, we reduce the number of tasks generated during a sync, as the SDK can now define these entitlements once per resource type instead of per resource instance. This is especially impactful for connectors with a large number of repositories or teams.