Picture of the author

Introduces 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 add and glab 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 repo capabilities 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.

Metadata