Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gitlab MergeRequestHook parser error #300

Closed
nekator opened this issue Sep 28, 2021 · 1 comment · Fixed by #301 or #355
Closed

Gitlab MergeRequestHook parser error #300

nekator opened this issue Sep 28, 2021 · 1 comment · Fixed by #301 or #355

Comments

@nekator
Copy link

nekator commented Sep 28, 2021

Parsing webhooks of object_kind merge_request results in an error.
Failed to parse webhook: json: cannot unmarshal bool into Go struct field .object_attributes.merge_params.force_remove_source_branch of type string

Webhook payload:

{
...
 "object_attributes": {
    ...
    "merge_params": {
      "force_remove_source_branch": true
    },
...
}

So i looked into the implemation and found that the MergeReqeust and PullRequest struct expects a string and not a boolean.

Is it possible that the payload from Gitlab changed with a newer Version? Or is it broken from the begining?

The testdata indicates that Gitlab send "0" and "1" instead of false and true.

nekator added a commit to nekator/go-scm that referenced this issue Sep 28, 2021
@garethjevans garethjevans linked a pull request Oct 12, 2022 that will close this issue
@zzhzero
Copy link

zzhzero commented Oct 13, 2022

Problem doesn't seem to be resolved

gitlab issue

nekator added a commit to nekator/go-scm that referenced this issue Oct 14, 2022
Gitlab MergeRequestHook have unstable json type for
this property. https://gitlab.com/gitlab-org/gitlab/-/issues/15647

closes jenkins-x#300
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants