Skip to content

Containerize baton-notion connector#12

Draft
laurenleach wants to merge 9 commits intomainfrom
containerize-baton-notion
Draft

Containerize baton-notion connector#12
laurenleach wants to merge 9 commits intomainfrom
containerize-baton-notion

Conversation

@laurenleach
Copy link

@laurenleach laurenleach commented Jan 29, 2026

Containerizes the connector following baton-databricks#35 and baton-contentful#48.

Co-Authored-By: Claude Sonnet 4.5 noreply@anthropic.com

Summary by CodeRabbit

  • New Features

    • Notion connector configuration: optional SCIM token (stored as a secret), connector display name, help URL and app icon; includes safer, type-checked configuration access.
  • Chores

    • Bumped Go toolchain and updated several dependencies to newer versions; cleaned up dependency declarations.

- Update baton-sdk to v0.7.10
- Create pkg/config package with generated configuration
- Update main.go to use config.RunConnector API
- Update connector to use V2 interface
- Update Makefile for config generation and lambda support
- Update GitHub workflows

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@laurenleach laurenleach requested a review from a team January 29, 2026 23:17
@coderabbitai
Copy link

coderabbitai bot commented Jan 29, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

  • 🔍 Trigger a full review

Walkthrough

Adds Notion connector configuration: a generated config accessor (Notion struct with typed getters), a configuration schema defining a scim-token secret field and Config object, and dependency version updates in go.mod.

Changes

Cohort / File(s) Summary
Dependency Management
go.mod
Bumped Go toolchain and several dependencies; moved github.com/spf13/viper to an indirect require and updated versions for conductorone/baton-sdk, tklauser/go-sysconf, tklauser/numcpus, and golang.org/x/sys.
Generated Config Accessors
pkg/config/conf.gen.go
Added generated Notion struct with ScimToken field (mapstructure:"scim-token") and typed getters: GetStringSlice, GetString, GetInt, GetBool, GetStringMap. Uses reflection helper to resolve fields by tag.
Configuration Schema
pkg/config/config.go
Added ScimTokenField (secret, optional string), ConfigurationFields slice, empty FieldRelationships, and Config created via field.NewConfiguration with connector metadata (display name, help URL, icon).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐇 I nibble on bytes and hop with delight,
A SCIM token tucked snug, out of sight,
Fields mapped with tags and getters that sing,
Configs stacked neatly—ready for spring,
I thump my foot: the connector's set right.

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Title check ⚠️ Warning The PR title 'Containerize baton-notion connector' does not align with the actual changes, which focus on Go dependency upgrades and configuration schema setup. Update the title to reflect the actual changes, such as 'Update Go toolchain and baton-sdk dependencies, add Notion SCIM configuration schema' or similar.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch containerize-baton-notion

Comment @coderabbitai help to get the list of available commands and usage tips.

- Added WithDisplayName() to SCIM token field
- Marked SCIM token as secret with WithIsSecret(true)
- Converted Config to use field.NewConfiguration pattern
- Added connector display name, help URL, and icon URL

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
go.mod (1)

5-6: ⚠️ Potential issue | 🟠 Major

SDK version mismatch with PR description.

The PR description states the SDK was bumped to v0.7.10, but this file shows github.com/conductorone/baton-sdk v0.4.2. Please verify which version is intended and update accordingly.

🧹 Nitpick comments (2)
pkg/config/conf.gen.go (1)

10-10: Minor: Inconsistent pointer receiver formatting.

The pointer receiver on line 10 uses c* Notion (space after asterisk) while other methods use c *Notion (space before asterisk). Since this is generated code, consider updating the generator template for consistency.

-func (c* Notion) findFieldByTag(tagValue string) (any, bool) {
+func (c *Notion) findFieldByTag(tagValue string) (any, bool) {
pkg/config/config.go (1)

37-43: Consider adding validation for the SCIM token.

ValidateConfig currently returns nil without performing any validation. If there are constraints on the SCIM token format (e.g., minimum length, prefix pattern), consider adding validation here to fail fast with a descriptive error rather than at runtime during API calls.

Example validation pattern
func ValidateConfig(c *Notion) error {
	token := c.GetString("scim-token")
	if token != "" && len(token) < 10 {
		return fmt.Errorf("scim-token appears to be too short")
	}
	return nil
}

laurenleach and others added 2 commits January 30, 2026 13:39
@laurenleach laurenleach marked this pull request as draft February 3, 2026 19:21
laurenleach and others added 5 commits February 3, 2026 11:25
…pabilities generation

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Migrate main.go from DefineConfiguration to RunConnector with WithDefaultCapabilitiesConnectorBuilder
- Update connector.New signature to accept config.Notion type instead of scimToken string
- Add config package import to connector.go
- ResourceSyncers already uses V2 types (connectorbuilder.ResourceSyncer)
- config.go already exists (no need to rename from schema.go)
- Run go mod tidy to clean up unused dependencies

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Replace pagination.Token with rs.SyncOpAttrs and return *rs.SyncOpResults instead of string/annotations in all List, Entitlements, and Grants methods. Simplify helpers to use direct token conversion functions matching the V2 pattern.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
WithDefaultCapabilitiesConnectorBuilderV2 enables capabilities generation
without credentials. Original workflow had no secrets.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
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.

1 participant