fix(account-status-lifecycle-test): read resource-level status for SDK compatibility#102
Merged
luisina-santos merged 2 commits intoJul 22, 2026
Conversation
…ust deprecated trait The account-status-lifecycle-test read user status only from the deprecated UserTrait annotation (`UserTrait_Status_Status`). In baton-sdk versions that moved status to a resource-level attribute (`Status_ResourceStatus`), a connector that sets only the resource-level status leaves the trait status unset, and the SDK defaults an unset trait status to STATUS_ENABLED. As a result the test always read STATUS_ENABLED and disable verifications failed even when the account was correctly disabled. get_user_status now reads both locations, prefers the resource-level value (normalized from RESOURCE_STATUS_* to the trait form STATUS_*), and falls back to the trait value only when no resource-level status is present. This keeps the action compatible with connectors built against any baton-sdk version. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
agustin-conductor
approved these changes
Jul 21, 2026
…esource Addresses review feedback: explicitly call out that baton-sdk v0.19.0 (ConductorOne/baton-sdk#996) is where status moved from the deprecated UserTrait field to the resource-level attribute. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
mateoHernandez123
approved these changes
Jul 22, 2026
ggreer
approved these changes
Jul 22, 2026
ggreer
left a comment
Contributor
There was a problem hiding this comment.
Oops. Whenever baton-sdk is upgraded in all the connector repos, we can simplify this.
luisina-santos
deleted the
luisinasantos/status-lifecycle-test-resource-status
branch
July 22, 2026 18:14
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The
account-status-lifecycle-testaction reads user status only from the deprecatedUserTraitannotation (UserTrait_Status_Status, e.g.STATUS_ENABLED).Recent
baton-sdkversions moved status to a resource-level attribute (Status_ResourceStatus, e.g.RESOURCE_STATUS_ENABLED). When a connector migrates toWithResourceStatus(...)and sets only the resource-level status:NewUserTraitdefaults an unset trait status toSTATUS_ENABLED.So the test always reads
STATUS_ENABLEDfrom the trait, and disable verifications fail even when the account was correctly disabled:(Hit while migrating
baton-lookeroff the deprecated trait options — the connector builds and disables correctly, but this shared test couldn't observe the resource-level status.)Fix
get_user_statusnow reads both locations and:resource.status.status, normalizingRESOURCE_STATUS_*→ the trait formSTATUS_*.status.statusonly when no resource-level status is present.*_UNSPECIFIEDas absent, so the unreliable defaulted trait value never masks a real resource-level status.Downstream comparisons (
is_user_enabled, summaries) are unchanged — they still compare againstSTATUS_ENABLED/STATUS_DISABLED.This keeps the action compatible with connectors built against any baton-sdk version (trait-only, resource-only, or both).
Validation
Verified the jq logic against all shapes:
STATUS_DISABLED✅ (wasSTATUS_ENABLED❌)STATUS_ENABLED✅STATUS_DISABLED✅STATUS_ENABLED✅STATUS_DISABLED✅unknown✅bash -npasses on the script.🤖 Generated with Claude Code