Skip to content

chore: update baton-sdk to v0.7.16#40

Open
gontzess wants to merge 3 commits intomainfrom
task-sdk-upgrade-batch-10
Open

chore: update baton-sdk to v0.7.16#40
gontzess wants to merge 3 commits intomainfrom
task-sdk-upgrade-batch-10

Conversation

@gontzess
Copy link

@gontzess gontzess commented Jan 27, 2026

Summary

  • Upgrade baton-sdk to v0.7.16
  • Upgrade Go to 1.25.x
  • Remove toolchain directive
  • Add WithDefaultCapabilitiesConnectorBuilder option for configless capabilities
  • Fix test expectation for service providers count (4 providers, not 5)

Build Status

  • go build ./... passes locally

Test plan

  • Build passes
  • Verify CI passes

@gontzess gontzess requested a review from a team January 27, 2026 16:01
@coderabbitai
Copy link

coderabbitai bot commented Jan 27, 2026

Walkthrough

Go toolchain and numerous dependencies updated; a new SCIM configuration schema, validation, and generated Batonconfig accessors were added; and a unit test expectation for service providers was adjusted.

Changes

Cohort / File(s) Summary
Dependency & Toolchain Updates
go.mod
Bump Go to 1.25.2; update github.com/conductorone/baton-sdk v0.3.34→v0.7.4, github.com/stretchr/testify v1.10.0→v1.11.1; add indirect deps (github.com/Masterminds/semver/v3, github.com/ebitengine/purego); multiple transitive version updates (x/sys, gopsutil v3→v4, otter v2, etc.)
Configuration Schema & Validation
pkg/batonconfig/config.go
Add SCIM connector field definitions (service provider, scim sources, API/user/password, SCIM client creds, account id), FieldRelationships placeholder, public Config, and ValidateConfig(cfg *Batonconfig) error enforcing authentication and SCIM source presence
Generated Config Accessors
pkg/batonconfig/conf.gen.go
Add generated Batonconfig struct with mapstructure-tagged fields and reflection-based accessors: GetStringSlice, GetString, GetInt, GetBool, GetStringMap; includes internal findFieldByTag helper and panics on type mismatches
Test Update
pkg/config/scim_config_test.go
Adjust expected count in TestServiceProviders from 5 → 4

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐇 I hopped through module fields and spring-cleaned each line,

Updated the versions, aligned tags to shine.
New config leaves sprout, with getters in tow,
One provider less, but the garden will grow.
— a cheerful rabbit 🥕

🚥 Pre-merge checks | ✅ 1 | ❌ 2
❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ⚠️ Warning The PR title states 'chore: update baton-sdk to v0.7.16' but the actual changes upgrade baton-sdk from v0.3.34 to v0.7.4 (not v0.7.16), upgrade Go to 1.25.2, and add configuration schema changes. Update the PR title to accurately reflect the main changes, such as 'chore: upgrade baton-sdk to v0.7.4 and Go to 1.25.2' or include the configuration schema additions if they are significant.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

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

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch task-sdk-upgrade-batch-10

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

@gontzess gontzess changed the title Upgrade baton-sdk to v0.7.x and Go to 1.25.2 Upgrade baton-sdk to v0.7.4 and Go to 1.25.2 Jan 27, 2026
@gontzess gontzess marked this pull request as draft January 27, 2026 18:59
@gontzess gontzess force-pushed the task-sdk-upgrade-batch-10 branch 2 times, most recently from 588d19a to 082b2ea Compare January 27, 2026 21:56
@gontzess gontzess marked this pull request as ready for review January 27, 2026 22:03
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: 3

🤖 Fix all issues with AI agents
In `@pkg/batonconfig/config.go`:
- Line 85: The error string returned in pkg/batonconfig/config.go references a
non-existent "token" field; update the message in the failing-return (the
fmt.Errorf call) to only mention the actual configurable credentials used by
this connector (for example "api-key", "username and password", and
"scim-client-id and scim-client-secret"), or otherwise replace "token" with the
correct field name used in this package, so the error accurately reflects the
available fields.
- Around line 14-17: Remove the unused legacy ScimConfigField declaration and
its inclusion in the Config struct (replace usages to use ScimConfigFileField
where appropriate) — ScimConfigField (name "scim-config") is redundant because
the code reads "scim-config-file" via ScimConfigFileField; also update the
erroneous error message that mentions "token" to reference the correct config
field name ("scim-config-file" or ScimConfigFileField) in the validation/error
routine so logs reflect the actual missing/invalid config field (check usages in
cmd/baton-scim/main.go and pkg/scim/client.go to ensure they reference
ScimConfigFileField).

In `@pkg/config/scim_config_test.go`:
- Line 15: The test uses require.Equal with the arguments reversed; update the
assertion in scim_config_test.go to follow testify's convention by calling
require.Equal(t, 4, len(providers)) or, even clearer, replace it with
require.Len(t, providers, 4); locate the current require.Equal(t,
len(providers), 4) (or similar) and swap the expected and actual or use
require.Len to fix it.
🧹 Nitpick comments (1)
pkg/batonconfig/config.go (1)

59-61: Consider using FieldRelationships for declarative validation.

FieldRelationships is defined but empty. The baton-sdk supports declarative field relationships (e.g., mutual exclusivity, required together) that could replace some of the imperative validation in ValidateConfig. This would provide better integration with SDK tooling and clearer configuration requirements.


require.NoError(t, err)
require.Equal(t, len(providers), 5)
require.Equal(t, len(providers), 4)
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# First, examine the test file around line 15
echo "=== Content of scim_config_test.go around line 15 ==="
head -30 pkg/config/scim_config_test.go | cat -n

# Find the getServiceProviders function
echo -e "\n=== Search for getServiceProviders function ==="
rg -n "getServiceProviders|func.*ServiceProviders" --type go | head -20

Repository: ConductorOne/baton-scim

Length of output: 1315


🏁 Script executed:

#!/bin/bash
# Look for provider definitions and initialization
echo "=== Search for provider definitions ==="
rg -n "ServiceProvider|providers\s*=" --type go -B 2 -A 2 | head -50

# Check the scim_config.go file for provider initialization
echo -e "\n=== Check scim_config.go ==="
head -100 pkg/config/scim_config.go | cat -n

Repository: ConductorOne/baton-scim

Length of output: 9199


🌐 Web query:

testify require.Equal argument order convention

💡 Result:

In testify v1.x, the convention (and actual function signature) for require.Equal / assert.Equal is:

require.Equal(t, expected, actual)

This matches the published signature Equal(t, expected, actual, ...). [1][2][3]

Note: there’s an ongoing testify v2.0.0 API discussion proposing switching to actual, expected (i.e., “got, want”) for new/updated assertions, but that’s a guideline proposal—not how v1 works today. [2]


🏁 Script executed:

#!/bin/bash
# Get the getServiceProviders function implementation
echo "=== getServiceProviders function implementation ==="
sed -n '212,250p' pkg/config/scim_config.go | cat -n

# List the service_providers directory
echo -e "\n=== Service providers directory contents ==="
find pkg/config/service_providers -type f | sort

Repository: ConductorOne/baton-scim

Length of output: 1036


🏁 Script executed:

#!/bin/bash
# Get more context from getServiceProviders function
echo "=== Full getServiceProviders function ==="
sed -n '212,230p' pkg/config/scim_config.go | cat -n

Repository: ConductorOne/baton-scim

Length of output: 820


Fix require.Equal argument order to follow testify convention.

The testify convention is require.Equal(t, expected, actual). The arguments are currently reversed—the assertion should be require.Equal(t, 4, len(providers)).

Suggested fix
-	require.Equal(t, len(providers), 4)
+	require.Equal(t, 4, len(providers))

Alternatively, use require.Len(t, providers, 4) for a clearer assertion message.

The provider count of 4 is correct—the service_providers directory currently contains miro.yaml, postman.yaml, slack.yaml, and zoom.yaml.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
require.Equal(t, len(providers), 4)
require.Equal(t, 4, len(providers))
🤖 Prompt for AI Agents
In `@pkg/config/scim_config_test.go` at line 15, The test uses require.Equal with
the arguments reversed; update the assertion in scim_config_test.go to follow
testify's convention by calling require.Equal(t, 4, len(providers)) or, even
clearer, replace it with require.Len(t, providers, 4); locate the current
require.Equal(t, len(providers), 4) (or similar) and swap the expected and
actual or use require.Len to fix it.

@gontzess gontzess force-pushed the task-sdk-upgrade-batch-10 branch from 082b2ea to fca3add Compare January 28, 2026 15:22
@gontzess gontzess changed the title Upgrade baton-sdk to v0.7.4 and Go to 1.25.2 chore: update baton-sdk to v0.7.16 Feb 6, 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.

1 participant