Skip to content

feat(collab): add addTeamUser to CollabsClient - #110

Draft
ehennestad wants to merge 2 commits into
add-environment-preferencefrom
add-collab-team-user-method
Draft

ehennestad wants to merge 2 commits into
add-environment-preferencefrom
add-collab-team-user-method

Conversation

@ehennestad

@ehennestad ehennestad commented Nov 11, 2026 •

Copy link
Copy Markdown
Owner

ebrains.collab.api.CollabsClient could create a collab but not give anyone access to it. This PR adds addTeamUser(collabId, role, username), which sends PUT /rest/v1/collabs/{collabId}/team/{role}/users/{username} without a body.

  • collabId is the name of the collab, the name field of the collabs that searchCollabs returns.
  • role must be "viewer", "editor" or "administrator", the role names the OpenAPI spec of the Collaboratory API gives for collabs.
  • A 204 (No Content) response is the success case. Any other status is reported through throwError. The spec documents 400 when the user does not exist, 403 when the account sending the request is not an administrator of the collab, and 404 when the collab does not exist.

The spec has the same endpoint for units and groups (.../team/{role}/units/{unitId}, .../team/{role}/groups/{groupName}); this PR covers users only.

The request and response shapes come from the spec.

🤖 Generated with Claude Code

@ehennestad
ehennestad added this pull request to stack #107 November 11, 2026 10:29
@github-actions

github-actions Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Test Results

873 tests   862 ✅  42s ⏱️
 40 suites   11 💤
  1 files      0 ❌

Results for commit 38e10c6.

♻️ This comment has been updated with latest results.

@codecov-commenter

codecov-commenter commented Nov 11, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.46%. Comparing base (6c5409a) to head (38e10c6).

Additional details and impacted files
@@                      Coverage Diff                       @@
##           add-environment-preference     #110      +/-   ##
==============================================================
+ Coverage                       90.43%   90.46%   +0.03%     
==============================================================
  Files                             137      137              
  Lines                            3555     3567      +12     
==============================================================
+ Hits                             3215     3227      +12     
  Misses                            340      340              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ehennestad
ehennestad force-pushed the add-collab-team-user-method branch 2 times, most recently from da99193 to 7b6ba1f Compare November 11, 2026 10:42
ehennestad and others added 2 commits November 11, 2026 19:57
addTeamUser sends PUT /rest/v1/collabs/{collabId}/team/{role}/users/
{username}, which gives a user the role "viewer", "editor" or
"administrator" in a collab. A 204 (No Content) response is the
success case, as documented in the OpenAPI spec of the Collaboratory
API; any other status is reported through throwError.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The team endpoint is a PUT without a body. MATLAB warns
(MATLAB:http:BodyExpectedFor) when such a request is sent, so every
call to addTeamUser printed the warning. The warning is turned off for
the request and restored afterwards, as BucketsClient does for its
PUT requests without a body.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@ehennestad
ehennestad force-pushed the add-collab-team-user-method branch from f8231d3 to 38e10c6 Compare November 11, 2026 18:58
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.

2 participants