Skip to content

fix: migrate off deprecated SDK trait options to fix lint#43

Merged
luisina-santos merged 1 commit into
mainfrom
luisinasantos/fix-lint-sdk-deprecations
Jul 21, 2026
Merged

fix: migrate off deprecated SDK trait options to fix lint#43
luisina-santos merged 1 commit into
mainfrom
luisinasantos/fix-lint-sdk-deprecations

Conversation

@luisina-santos

Copy link
Copy Markdown
Contributor

Why lint broke on main

baton-sdk was bumped v0.18.4 → v0.19.0 (commit 89aee42), which added SA1019 deprecation annotations to several trait-level resource options. PR #42's verify / lint had passed because its branch was last linted against v0.18.4, where those functions weren't yet deprecated — GitHub doesn't re-run a PR's checks against latest main at merge time. Once #42 merged, the post-merge push to main linted the SDK bump and the connector code together for the first time, and staticcheck fired on all 6 call sites.

Fix

Migrate off the deprecated trait options to the resource-level equivalents:

Deprecated Replacement
WithGroupProfile / WithUserProfile WithResourceProfile
WithCreatedAt WithResourceCreatedAt
WithStatus (UserTrait_Status_Status) WithResourceStatus (Status_ResourceStatus)
groupTrait.GetProfile() resourceSdk.GetProfile(resource)

The profile/created_at/status options move out of the trait-option slice into the variadic ResourceOptions of NewUserResource/NewGroupResource.

Verification

  • go build ./cmd/baton-procore
  • golangci-lint run --timeout=6m0 issues
  • go test -mod=vendor ./...

🤖 Generated with Claude Code

baton-sdk v0.19.0 marked the trait-level profile/created_at/status
options and group-trait GetProfile as deprecated (SA1019). Migrate to
the resource-level equivalents:

- WithGroupProfile/WithUserProfile -> WithResourceProfile
- WithCreatedAt -> WithResourceCreatedAt
- WithStatus -> WithResourceStatus (status enum: UserTrait_Status_Status
  -> Status_ResourceStatus)
- groupTrait.GetProfile() -> resourceSdk.GetProfile(resource)

Fixes the 6 SA1019 staticcheck failures on the Verify / lint job.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@luisina-santos
luisina-santos requested a review from a team July 21, 2026 15:22
@github-actions

Copy link
Copy Markdown
Contributor

Connector PR Review: fix: migrate off deprecated SDK trait options to fix lint

Blocking Issues: 0 | Suggestions: 0 | Threads Resolved: 0
Criteria: Criteria status: loaded .claude/skills/ci-review.md from trusted base 377b13c50912.
Review mode: full
View review run

Review Summary

The full PR diff was scanned for security and correctness. This change migrates companies.go, projects.go, and users.go off deprecated trait-level SDK options (WithGroupProfile/WithUserProfile/WithCreatedAt/WithStatus and the UserTrait_Status_* enum) onto resource-level equivalents (WithResourceProfile/WithResourceCreatedAt/WithResourceStatus and Status_RESOURCE_STATUS_*). The write/read pair is consistent: the only profile reader (getCompanyId at projects.go:24) now uses GetProfile, matching the new WithResourceProfile writer, no un-migrated readers of the old trait profiles/status remain, and go.mod/go.sum are unchanged. No new issues found.

Security Issues

None found.

Correctness Issues

None found.

Suggestions

None.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No blocking issues found.

@luisina-santos
luisina-santos merged commit 86ab466 into main Jul 21, 2026
8 of 9 checks passed
@luisina-santos
luisina-santos deleted the luisinasantos/fix-lint-sdk-deprecations branch July 21, 2026 17:33
laurenleach added a commit to ConductorOne/baton-zoom that referenced this pull request Jul 25, 2026
Recent baton-sdk versions moved profile, status, icon, and created_at from the
individual traits to attributes on Resource, deprecating the trait-level
options. CI's staticcheck flags the old ones as SA1019.

Following the same migration as ConductorOne/baton-procore#43:
  WithUserProfile / WithGroupProfile / WithRoleProfile -> WithResourceProfile
  WithStatus(v2.UserTrait_Status_STATUS_*)             -> WithResourceStatus(v2.Status_RESOURCE_STATUS_*, "")
  userTrait.GetProfile()                               -> resource.GetProfile(res)

The trait options move out of the trait slice and into the variadic
ResourceOption list. Traits themselves are unchanged: users keep their email
trait, groups keep GroupTrait, roles keep RoleTrait. resource.GetProfile falls
back to the deprecated trait-level profile, so reads still work against data
written by earlier connector versions.

Co-Authored-By: Claude Opus 5 (1M context) <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.

3 participants