Skip to content

Error creating comment on new code #365

@tcordel

Description

@tcordel

Hi, i'm facing this issue, maybe it can be fixed but i'm feeling a bit lost.
Maybe you may help me :)

Prerequsities

  • I'm on the latest version of the plugin
  • I've installed the required dependencies
  • I've run :h gitlab.nvim.troubleshooting and followed the steps there

Setup Configuration and Environment

    require("gitlab").setup({
      log_path = vim.fn.stdpath("cache") .. "/gitlab.nvim.log", -- Log path for the Go server
      debug = { go_request = true, go_response = true }, -- Which values to log
      reviewer_settings = {
        diffview = {
          imply_local = true, -- If true, will attempt to use --imply_local option when calling |:DiffviewOpen|
        },
      },
      connection_settings = {
        insecure = true, -- Like curl's --insecure option, ignore bad x509 certificates on connection
      },
    })

Bug Description

Failed to post comment for new code:

image

Reproduction Steps

  1. Check out the feature branch
  2. Open Neovim
  3. start a review
  4. comment on new code

Screenshots

-- REQUEST --
POST /api/v4/projects/832/merge_requests/1167/discussions HTTP/1.1
Host: srv-git
Accept: application/json
Content-Type: application/json
Private-Token: REDACTED
User-Agent: go-gitlab

{"body":"","position":{"base_sha":"71edb6a3b0b3224e394d3de04f7e09851f4a4614","head_sha":"85a3b01ce6382c64cf8ecbd605e67ea3d226d702","start_sha":"71edb6a3b0b3224e394d3de04f7e09851f4a4614","new_path":"eie-front/src/main/app/src/api/StudioResourceService.ts","old_path":"eie-front/src/main/app/src/api/StudioResourceService.ts","position_type":"text","new_line":13,"old_line":1}}

-- RESPONSE --
HTTP/1.1 400 Bad Request
Content-Length: 131
Cache-Control: no-cache
Connection: keep-alive
Content-Type: application/json
Date: Thu, 12 Sep 2024 06:39:38 GMT
Server: nginx
Vary: Origin
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-Gitlab-Meta: {"correlation_id":"01J7JFAXXG1JM5FHEX59RGNPKN","version":"1"}
X-Request-Id: 01J7JFAXXG1JM5FHEX59RGNPKN
X-Runtime: 0.098378

{"message":"400 Bad request - Note {:note=>[\"can't be blank\"], :line_code=>[\"can't be blank\", \"must be a valid line code\"]}"}

thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions