Merged 1 month agoOctober 28, 2025
Related#7299Introduces new glab repo members commands to add and remove members from a project in the GitLab CLI, supporting various access levels and expiration dates.
What was done
- Added two main commands:
glab repo members addandglab repo members remove. - Implemented functionality to add users by username or user ID, with configurable access levels (guest, reporter, developer, maintainer, owner) and optional expiration dates.
- Developed functionality to remove project members using either username or user ID.
- Established core functionality for project member management within the GitLab CLI.
Impact
- Users can now manage project members directly from the command line, improving efficiency for project administrators.
- Enhanced
glab repocapabilities with new subcommands for member operations. - Provides flexible and granular control over project access via the CLI.
Technical details
- Extensive unit tests were implemented for both the add and remove commands.
- HTTP mocking was utilized to simulate API interactions during testing.
- Test data files were used to cover various scenarios, including edge cases like invalid inputs or users not found.
- Support for all GitLab permission levels was implemented, including their numeric mappings.
- The commands are designed to accept both usernames and user IDs for member identification.
Related issues
Metadata
- Source: gitlab
- Repo: gitlab-org/cli
- URL: https://gitlab.com/gitlab-org/cli/-/merge_requests/2451
- Merged: 2025-10-28T12:06:40Z