Skip to content

Add TRAIT_LICENSE_PROFILE to license resources#48

Open
c1-dev-bot[bot] wants to merge 2 commits into
mainfrom
feat/add-license-profile-trait
Open

Add TRAIT_LICENSE_PROFILE to license resources#48
c1-dev-bot[bot] wants to merge 2 commits into
mainfrom
feat/add-license-profile-trait

Conversation

@c1-dev-bot

@c1-dev-bot c1-dev-bot Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds TRAIT_LICENSE_PROFILE to the license resource type alongside the existing TRAIT_ROLE trait
  • Annotates each license resource with a LicenseProfileTrait containing the license name and a link to the member entitlement that tracks which users hold that license
  • Enables the License Management via MCP feature to discover and manage Tableau license data (Creator, Explorer, Viewer, Unlicensed)

Details

The existing license implementation already models Tableau's site-role-based licensing as role resources with entitlements and grants. This change adds the TRAIT_LICENSE_PROFILE annotation so that the license management system can identify these resources as licenses and correlate seat usage via the linked entitlement IDs.

Tableau's REST API does not expose purchased seat counts, so seat counts are omitted from the trait. Consumed seats can be derived from the existing grants (users with the member entitlement on each license).

Test plan

  • go build ./... passes
  • go test ./... passes
  • Manual testing with a Tableau instance to verify license resources include the license profile trait annotation

Fixes: CXH-1933


Automated PR Notice

This PR was automatically created by c1-dev-bot as a potential implementation.

This code requires:

  • Human review of the implementation approach
  • Manual testing to verify correctness
  • Approval from the appropriate team before merging

Add the license profile trait alongside the existing role trait on
license resources so that the License Management via MCP feature can
discover and manage Tableau license data.

Each license resource now carries a LicenseProfileTrait annotation with
the license name and a link to the member entitlement that tracks which
users hold that license.

Fixes: CXH-1933
@c1-dev-bot c1-dev-bot Bot requested a review from a team June 29, 2026 16:28
@linear-code

linear-code Bot commented Jun 29, 2026

Copy link
Copy Markdown

CXH-1933

Add the TRAIT_LICENSE_PROFILE trait to the license resource type in the
capabilities metadata to match the code change.
Comment thread pkg/connector/license.go
}

ret, err := rs.NewRoleResource(license, resourceTypeLicense, licenseID, roleTraitOptions)
licenseResource := &v2.Resource{

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.

🟡 Suggestion: The local variable licenseResource shadows the enclosing function licenseResource. It's harmless here (no recursion), but renaming it (e.g. licRes) avoids reader confusion. (confidence: high)

@github-actions

Copy link
Copy Markdown
Contributor

Connector PR Review: Add TRAIT_LICENSE_PROFILE to license resources

Blocking Issues: 0 | Suggestions: 1 | Threads Resolved: 0
Criteria: Criteria status: loaded .claude/skills/ci-review.md from trusted base 3ca3118883bb.
Review mode: full
View review run: https://github.com/ConductorOne/baton-tableau/actions/runs/28387243065

Review Summary

Scanned the full PR diff for security and correctness. This change adds TRAIT_LICENSE_PROFILE to the license resource type and annotates each license with a LicenseProfileTrait carrying the license name and the linked member entitlement ID. I verified the constructed entitlement ID license:LICENSEID:member matches the format of the static member assignment entitlement the connector emits, so the link resolves correctly. The SDK helpers used WithLicenseProfileTrait, WithLicenseName, WithLicenseEntitlementIDs, NewEntitlementID exist in the vendored baton-sdk, and the baton_capabilities.json update mirrors the resource type change. No security or correctness issues found.

Security Issues

None found.

Correctness Issues

None found.

Suggestions

  • pkg/connector/license.go:50 — local variable licenseResource shadows the enclosing function licenseResource; rename for clarity, harmless today.
Prompt for AI agents

Verify each finding against the current code and only fix it if needed.

Suggestions

In pkg/connector/license.go:

  • Around line 50: The local variable licenseResource shadows the enclosing function licenseResource. It works because the function does not recurse, but it is confusing to read. Rename the local variable, for example to licRes, and update its use on the ent.NewEntitlementID call a few lines below.

@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.

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.

0 participants