V2 connectorbuilder migration and CI modernization - #52
Conversation
RunConnector is the SDK's current entrypoint and owns config decoding, the capabilities subcommand, and process exit codes (gRPC status codes), but it only accepts a ConnectorBuilderV2. All ten syncers therefore move from the V1 List/Entitlements/Grants contract to the V2 one: the page token arrives in SyncOpAttrs and the next token rides back in SyncOpResults. The translation is mechanical and no syncer's logic changes; three nil-token guards that can no longer trigger are dropped. Provisioning methods are unchanged, since the SDK registers them by type assertion regardless of builder version. The default-capabilities option stays so `capabilities` keeps working without a DSN. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Replace the hand-rolled grant/revoke and create/delete steps with the sync-test and account-provisioning actions from github-workflows. Together they cover what the old steps did plus idempotent double grant and double revoke, and credential rotation on the created account, which had no automated coverage before. The actions fetch the baton CLI themselves, so the install step goes with the script the previous commit removed. The account-provisioning action requires an email; the SDK validates it as an address and this connector names the created role after it, so the lookup goes by email. The storage-engine override is dropped since pebble is the default. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Connector PR Review: V2 connectorbuilder migration and CI modernizationBlocking Issues: 0 | Suggestions: 1 | Threads Resolved: 0 Review SummaryThe new commit addresses both prior findings: Security IssuesNone found. The new CI action inputs match the v4 Correctness IssuesNone found. Suggestions
Prompt for AI agentsReviewed head SHA a5cec08, base SHA a5b669f. The machine-readable review-state marker could not be written this run because the CI shell blocked every JSON-bearing command form; the next run will fall back to a full review. |
Review follow-ups on the shared-actions change. - postgres.New attaches a gRPC status to connection failures the server attributes to the client's authorization: SQLSTATE class 28 maps to Unauthenticated (exit 16) and 42501 to PermissionDenied (exit 7). The original pgx error stays in the chain. - ci.yaml hands the sync-test auth-error check a bad DSN through bad-credentials; it was skipping because BATON_DSN is not credential-shaped. Document why the shared actions' unpinned baton CLI is acceptable for reading this connector's c1z files. - getConnector no longer logs the error it returns; RunConnector prints it on exit and the pool constructor already logs the failure. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Follow-ups from the review of #51: move the connector onto the SDK's current entrypoint and replace the hand-rolled integration job with the shared connector test actions.
Changes
config.RunConnectorand V2 resource syncers (7109cae)main.gonow usesconfig.RunConnector, which owns config decoding, thecapabilitiessubcommand, and process exit codes (gRPC status codes: a bad DSN exits 2, an invalid argument 3, a missing grant 5).RunConnectoronly accepts aConnectorBuilderV2, so all ten syncers move from the V1List/Entitlements/Grantscontract to the V2 one: the page token arrives inSyncOpAttrsand the next token returns inSyncOpResults. The translation is mechanical; no syncer's logic changes. Three nil-token guards that can no longer trigger are dropped.Grant,Revoke,Create,Delete,CreateAccount,Rotate) are untouched; the SDK registers them by type assertion regardless of builder version../connector capabilitieskeeps working without a DSN.scripts/get-baton.shis removed; the shared actions fetchbatonthemselves.Integration tests through the shared actions (cbb02f3)
testjob's grant/revoke and create/fetch/delete steps are replaced bygithub-workflows/actions/sync-test@v4andactions/account-provisioning@v4. Together they cover what the old steps did, plus idempotent double grant and double revoke, and credential rotation on the created account, which previously had no automated coverage.account-provisioningrequires an email. The SDK validates it as an address, and this connector names the created role after it, so the lookup usessearch-method: email.BATON_STORAGE_ENGINE: pebbleis dropped since pebble is the default.Verification
go build,go vet, golangci-lint (0 issues), gofmt, actionlint.go test ./...including the six Postgres-container tests and the zero-value connector test.entitlement:role:3375:memberforrole:10with the grant gone afterwards; create account with the exact flags the action sends, find it by email, rotate (password hash changed), delete, idempotent second delete, role gone. Bad DSN exits 2../connector capabilitiesoutput is byte-identical to the committedbaton_capabilities.json; re-vendoring is a no-op.