Skip to content

Inconsistent data type for force_remove_source_branch in merge request hook

Summary

My GitLab instance (version 13.12.10-ee) generated the following webhook for a merge request event (irrelevant data has been omitted for privacy):

{
...
"changes": {
  "merge_params": {
    "previous": { 
      "force_remove_source_branch":true
    },
    "current": {
      "force_remove_source_branch":"1"
    }
  }
}
...
}

Notice how in previous, the data type for force_remove_source_branch is a boolean but in current, force_remove_source_branch is a string.

Steps to reproduce

I'm not sure. Try create a merge request event that has this data.

Honestly though, just check the code and see what data types are used.

Example Project

I cannot provide an example project.

What is the current bug behavior?

Different data types for force_remove_source_branch in the webhook.

What is the expected correct behavior?

The same data type. Based on https://docs.gitlab.com/ee/system_hooks/system_hooks.html#merge-request-events I think this should be the string data type.

Edited by Tyler Yates