Skip to content

Add a REST API to create an organization

Abdul Wadood requested to merge 470613-api-create-organization into master

What does this MR do and why?

This change introduces a new POST API for organization creation. The functionality is controlled by a feature flag named allow_organization_creation. The change also modifies workhorse to enable file uploads on the /api/v4/organizations endpoint.

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Before After
image image

How to set up and validate locally

  1. Enable the feature flags in the rails console:
Feature.enable(:allow_organization_creation)
Feature.enable(:ui_for_organizations)
  1. Install the workhorse changes:
cd gitlab/workhorse
make install
  1. Create an API token on https://gdk.test:3000/-/user_settings/personal_access_tokens with read/write API permissions.
  2. Create an organization with avatar using the following curl command:
curl "https://gdk.test:3000/api/v4/organizations" \
     --header "PRIVATE-TOKEN: $GITLAB_API_TOKEN" \
     --form "name=My New Organization" \
     --form "path=my-new-organization" \
     --form "description=This is a great new organization" \
     --form "avatar=@/path-to-avatar.png"

Related to #470613 (closed)

Edited by Abdul Wadood

Merge request reports

Loading