fix: migrate trait profile/status to resource-level APIs (SA1019) - #143
Conversation
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>
Connector PR Review: fix: migrate trait profile/status to resource-level APIs (SA1019)Blocking Issues: 0 | Suggestions: 0 | Threads Resolved: 0 Review SummaryFull 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 IssuesNone found. Correctness IssuesNone found. SuggestionsNone. |
Summary
Fixes Verify workflow golangci-lint SA1019 failures on
main(18 staticcheck issues) after baton-sdk deprecations moved profile/status off trait protos ontoResource.Changes
pkg/bcel/bcel.go: CELresource.profilenow usessdkResource.GetProfile(resource-level with trait fallback) instead of deprecatedGet*Trait(...).GetProfile().pkg/bsql/resources.go:WithResourceProfileWithResourceStatus(Status_ResourceStatus; agent READY maps to ENABLED)pkg/bsql/nhi_test.go: assertions updated to resource-level status/profileNon-goals
Test plan
golangci-lintv2.11.4 (CI version): 0 issuesgo test ./...green