Skip to content

Migrate off deprecated trait profile/status attributes - #34

Merged
laurenleach merged 1 commit into
mainfrom
lauren.leach/migrate-deprecated-trait-attrs
Jul 31, 2026
Merged

Migrate off deprecated trait profile/status attributes#34
laurenleach merged 1 commit into
mainfrom
lauren.leach/migrate-deprecated-trait-attrs

Conversation

@laurenleach

Copy link
Copy Markdown
Contributor

baton-sdk v0.20.6 moved profile, status, and created_at off the trait
messages onto attributes on Resource, deprecating the trait-level options and
getters. staticcheck flags every remaining call with SA1019, so verify / lint
is red on main.

This migrates the connector to the resource-level API:

  • With{User,Group,Role,App}Profile -> WithResourceProfile
  • WithStatus / WithDetailedStatus -> WithResourceStatus
  • WithCreatedAt / WithSecretCreatedAt -> WithResourceCreatedAt
  • trait GetProfile() / GetStatus() reads -> the equivalent read on the resource

The option type changes from a *TraitOption to a ResourceOption, so the calls
move out of the trait slice and into the variadic tail of the New*Resource call.
The two status enums are numerically identical, so the values map 1:1. Non-deprecated
trait data (login, aliases, emails, secret type/expiry) is untouched.

No behavioural change intended: the deprecated options already populated the
resource-level fields. golangci-lint run ./... reports 0 issues after this
change, and the package tests pass.

baton-sdk v0.20.6 moved `profile`, `status`, and `created_at` off the trait
messages onto attributes on `Resource`, deprecating the trait-level options and
getters. staticcheck flags every remaining call with `SA1019`, so `verify / lint`
is red on `main`.

This migrates the connector to the resource-level API:

- `With{User,Group,Role,App}Profile` -> `WithResourceProfile`
- `WithStatus` / `WithDetailedStatus` -> `WithResourceStatus`
- `WithCreatedAt` / `WithSecretCreatedAt` -> `WithResourceCreatedAt`
- trait `GetProfile()` / `GetStatus()` reads -> the equivalent read on the resource

The option type changes from a `*TraitOption` to a `ResourceOption`, so the calls
move out of the trait slice and into the variadic tail of the `New*Resource` call.
The two status enums are numerically identical, so the values map 1:1. Non-deprecated
trait data (login, aliases, emails, secret type/expiry) is untouched.

No behavioural change intended: the deprecated options already populated the
resource-level fields. `golangci-lint run ./...` reports 0 issues after this
change, and the package tests pass.
@laurenleach
laurenleach requested a review from a team July 31, 2026 19:29
@github-actions

Copy link
Copy Markdown
Contributor

CONNECTOR PR REVIEW: Migrate off deprecated trait profile/status attributes

Blocking Issues: 0 -- Suggestions: 0 -- Threads Resolved: 0
Criteria status: loaded .claude/skills/ci-review.md from trusted base bcb1211
Review mode: full
View review run: https://github.com/ConductorOne/baton-atlassian/actions/runs/30659282735

== Review Summary ==
Scanned the full PR diff for security and correctness. This is a mechanical SDK-deprecation migration that moves profile, status, and created_at from trait-level options to resource-level options (WithResourceProfile, WithResourceStatus, WithResourceCreatedAt) in users.go, groups.go, and api_tokens.go. I verified the two status enums are numerically identical (UNSPECIFIED=0, ENABLED=1, DISABLED=2) so the resource-status cast is safe, the new option signatures match, the New-Resource constructors accept the variadic ResourceOption tail, no deprecated trait getters or setters remain in pkg, and the SDK confirms the deprecated options already mirrored onto the resource-level fields so there is no behavioural change. 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.

@laurenleach
laurenleach merged commit c415fb1 into main Jul 31, 2026
9 checks passed
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.

2 participants