Skip to content

fix: migrate trait profile/status to resource-level APIs (SA1019) - #143

Merged
btipling merged 1 commit into
mainfrom
bt/fix-main-golangci-sa1019
Jul 25, 2026
Merged

fix: migrate trait profile/status to resource-level APIs (SA1019)#143
btipling merged 1 commit into
mainfrom
bt/fix-main-golangci-sa1019

Conversation

@btipling

Copy link
Copy Markdown
Contributor

Summary

Fixes Verify workflow golangci-lint SA1019 failures on main (18 staticcheck issues) after baton-sdk deprecations moved profile/status off trait protos onto Resource.

Changes

  • pkg/bcel/bcel.go: CEL resource.profile now uses sdkResource.GetProfile (resource-level with trait fallback) instead of deprecated Get*Trait(...).GetProfile().
  • pkg/bsql/resources.go:
    • User/app/group/role/agent profile mapping → WithResourceProfile
    • User/agent status mapping → WithResourceStatus (Status_ResourceStatus; agent READY maps to ENABLED)
  • pkg/bsql/nhi_test.go: assertions updated to resource-level status/profile

Non-goals

  • No CE-1007 feature work
  • No dependency version bumps
  • No new metrics

Test plan

  • golangci-lint v2.11.4 (CI version): 0 issues
  • go test ./... green
  • GitHub Actions Verify green on this PR

Resolve golangci-lint SA1019 failures on main by using
WithResourceProfile/WithResourceStatus and GetProfile/GetStatus
instead of deprecated trait-level profile and status APIs.

Co-authored-by: c1-squire-dev[bot] <c1-squire-dev[bot]@users.noreply.github.com>
@btipling
btipling requested a review from a team July 25, 2026 21:13
@github-actions

Copy link
Copy Markdown
Contributor

Connector PR Review: fix: migrate trait profile/status to resource-level APIs (SA1019)

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

Review Summary

Full PR diff scanned for security and correctness. This is a clean deprecation migration moving profile/status off trait protos onto Resource via WithResourceProfile/WithResourceStatus, with reads going through GetProfile/GetStatus (resource-level first, trait fallback). Verified against the vendored SDK v0.20.2: the option and getter functions exist and behave as described, and the AgentTrait_AgentStatus to Status_ResourceStatus mapping is safe because both enums share identical numeric values (UNSPECIFIED=0, READY/ENABLED=1, DISABLED=2, DELETED=3). All trait-level profile/status readers were migrated (only pkg/bcel/bcel.go read them), status-detail handling is preserved, and no dependency, scope, or public-behavior changes are present. 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.

@btipling
btipling merged commit 9f01eeb into main Jul 25, 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.

1 participant