Repository navigation
fix(participants): add service accounts to a workspace by name - #724
Merged
educalleja merged 1 commit intoOct 20, 2026
Merged
educalleja merged 1 commit into
educalleja merged 1 commit into
Conversation
`tw participants add -t MEMBER -n <service-account>` failed with "Service accounts cannot be added as workspace collaborators": the organization members list excludes service accounts, so the command fell back to adding by user name, which the platform rejects for service accounts. Look the name up among the organization's service accounts and add it by member ID instead. The by-name service account lookup moves to AbstractApiCmd so both the participants and service-accounts commands share it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
educalleja
marked this pull request as ready for review
October 20, 2026 09:47
cristianrcv
pushed a commit
that referenced
this pull request
Oct 22, 2026
`tw participants add -t MEMBER -n <service-account>` failed with "Service accounts cannot be added as workspace collaborators": the organization members list excludes service accounts, so the command fell back to adding by user name, which the platform rejects for service accounts. Look the name up among the organization's service accounts and add it by member ID instead. The by-name service account lookup moves to AbstractApiCmd so both the participants and service-accounts commands share it. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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.
Stacked on #702.
Makes the service account operations in Tower CLI commands on 26.2 work end to end. No other operations from that page are included.
What was broken
The
tw service-accounts add|list|view|update|deletecommands from #702 already match the page (options, output, and the not-found error). Workspace assignment didn't work:failed with
Service accounts cannot be added as workspace collaborators. The platform's organization members list (GET /orgs/{orgId}/members) leaves out service accounts, because theservice_accountorg role isn't assignable. So the CLI fell back to adding byuserNameOrEmail, and the platform rejects service accounts on that path.Fix
-t MEMBERdoesn't match an organization member,participants addlooks the name up among the organization's service accounts and adds it bymemberId. The platform then assigns the service account to the workspace with theVIEWrole by default.@, or the caller can't list service accounts (feature disabled or not an org admin), the command falls back to the old add-by-user-name behavior. Existing invite flows are unaffected.AbstractServiceAccountsCmdtoAbstractApiCmdso both commands share it.VIEWrole and how to change it.tw participants updateandtw participants deletealready work with no changes: the participants list returns service accounts asMEMBERand matches them by user name (which is the service account name), and the platform routes role updates for service accounts through its service account service.Tests
ParticipantsCmdTest.testAddServiceAccountParticipant../gradlew test: 774 tests, 0 failures.🤖 Generated with Claude Code