Skip to content

Bugfix for destination_namespace empty string

Carla Drago requested to merge 383760-empty-string-fix into master

What does this MR do and why?

This fixes a bug where the bulk_import POST params validation for destination_namespace was incorrectly failing in the case of an empty string.

How to set up and validate locally

  1. ensure that the gdk is running gdk start
  2. make a request with the destination_namespace set as an empty string eg:
curl --request POST --header "PRIVATE-TOKEN: [YOUR GDK TOKEN]" "http://gdk.test:3000/api/v4/bulk_imports" \
  --header "Content-Type: application/json" \
  --data '{
    "configuration": {
      "url": "https://gitlab.com/",
      "access_token": [YOUR PRODUCTION TOKEN]
    },
    "entities": [
      {
        "source_full_path": "https://gitlab.com/carld-gl/high-on-a-hill",
        "source_type": "group_entity",
        "destination_slug": "high-on-a-hill",
        "destination_namespace": ''
      }
    ]
  }'
  1. The response should not return an error but success
{"id":83,"status":"created","source_type":"gitlab","created_at":"2023-01-11T17:04:58.051Z","updated_at":"2023-01-11T17:04:58.051Z"}%

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #383760 (closed)

Edited by Carla Drago

Merge request reports

Loading