toggle_discussions() doesn't open new window - draft_notes error 404
Một pull request liên quan đã được merge.
- #552 của @jakubbortlik — đã merge
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 25/100
Hướng nghiên cứu
Bắt đầu với require("gitlab").toggle_discussions() và yêu cầu draft_notes đã được ghi lại, sau đó so sánh khả năng cung cấp API được ghi trong tài liệu với instance GitLab 13.12 được báo cáo. Kiểm tra lịch sử pull request liên quan trước khi thực hiện thay đổi. Công việc được xem là hoàn tất khi hành vi của cửa sổ thảo luận đối với phiên bản máy chủ này đã rõ ràng, либо thông qua khả năng tương thích hoặc thông qua một giới hạn được ghi trong tài liệu.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Prerequsities
- I'm on the latest version of the plugin
- I've installed the required dependencies
- I've run
:h gitlab.nvim.troubleshootingand followed the steps there
Setup Configuration and Environment
return {
"harrisoncramer/gitlab.nvim",
dependencies = {
"MunifTanjim/nui.nvim",
"nvim-lua/plenary.nvim",
"sindrets/diffview.nvim",
"nvim-tree/nvim-web-devicons"
},
lazy = false,
build = function() require("gitlab.server").build(true) end, -- Builds the Go binary
keys = function()
local map = require('map')
map.map('n', '<leader>gm', function() require("gitlab").choose_merge_request() end, { desc = "[m]erge request view (gitlab)" } )
map.exportKeys()
end,
config = function()
require("gitlab").setup({
auth_provider = function()
return "<redacted>", "<redacted>", nil
end,
connection_settings = {
insecure = true,
},
debug = {
request = true,
response = true,
gitlab_request = true,
gitlab_response = true,
},
})
end,
}
Bug Description
require("gitlab").toggle_discussions() does not open discussion window.
Error notificaiton:
gitlab.nvim: Could not get draft notes: 404 Not Found
Reproduction Steps
- Add my plugin configuration file to neovim with Lazy.nvim installed (tested without other plugins).
- Run
require("gitlab").choose_merge_request(), select MR. - Use
gldto open discussion window. - Result: No new windows is opened. Error message about draft_notes being not found appears.
Additional info
Output's of commands from gitlab.nvim.troubleshooting:
- checkhealth gitlab
==============================================================================
gitlab: require("gitlab.health").check()
gitlab.nvim ~
- ⚠️ WARNING stevearc/dressing.nvim is a recommended dependency
-
require("gitlab").print_settings() - prints defaults + changes from my config as expected.
-
require("gitlab.server").build(true)
gitlab.nvim: Installed successfully!
- require("gitlab.server").start(function() print("Server started") end)
gitlab.nvim: Failed to initialize Gitlab client: GitLab instance URL cannot be empty
gitlab.nvim: Golang gitlab server exited: job_id: 3, exit_code: 1
but if I first use require("gitlab").choose_merge_request() and then do require("gitlab.server").restart() then server is restarted without any issue:
gitlab.nvim: Restarted server
- I've enabled debug logs and here is example of failure in logs:
-- REQUEST TO GO SERVER --
GET /mr/draft_notes/ HTTP/1.1
Host: localhost:45393
Accept: */*
Private-Token: REDACTED
User-Agent: curl/7.81.0
-- REQUEST TO GITLAB --
GET /api/v4/projects/2253/merge_requests/710/draft_notes HTTP/1.1
Host: <redacted>
Accept: application/json
Private-Token: REDACTED
User-Agent: go-gitlab
-- RESPONSE FROM GITLAB --
HTTP/1.1 404 Not Found
Content-Length: 25
Cache-Control: no-cache
Connection: keep-alive
Content-Type: application/json
Date: Tue, 16 Sep 2025 17:25:01 GMT
Server: nginx
Vary: Origin
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-Gitlab-Feature-Category: not_owned
X-Request-Id: 01K59RXX1PQGGYRNDE1B63SDFV
X-Runtime: 0.011073
{"error":"404 Not Found"}
-- RESPONSE FROM GO SERVER --
HTTP/0.0 500 Internal Server Error
Content-Length: 66
Content-Type: application/json
{"message":"Could not get draft notes","details":"404 Not Found"}
Update
One more observation. I am able to create comments, but creation of draft comment fails.
After I create a comment diagnostic symbols for comments are finally loaded and I can list comments via diagnostic listing.
Also:
curl --insecure --header "PRIVATE-TOKEN: <redacted>" --url "https://<redacted>/api/v4/projects/2253/merge_requests/710/draft_note"
fails with error 404, but:
curl --insecure --header "PRIVATE-TOKEN: <redacted>" --url "https://<redacted>/api/v4/projects/2253/merge_requests/710/discussions"
returns valid JSON.
And
curl --insecure --header "PRIVATE-TOKEN: <redacted>" --url "https://<redacted>/api/v4/projects/2253/merge_requests/710/notes"
also returns valid JSON.
Update 2
I've found the root cause, it seems like draft_notes API was introduced in version 16.0 (or at least somewhere between 15.0 and 16.0). The gitlab that I have to use is version 13.12.
Am I correct to assume that there is nothing I can do to make it work?
- Ngôn ngữ chính
- Lua
- Star
- 404
- Fork
- 64
- Merge trung bình
- 4 ngày 5 giờ
- Pull request đã merge (30 ngày)
- 6
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của harrisoncramer/gitlab.nvim
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
harrisoncramer/gitlab.nvim#585 · 1 bình luận ·
-
Security/Bug: Go server leaks auth_token to ps and leaves zombie processesCó thể đã có người làm @jakubbortlik đã nhận 26 ngày trước. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 46/100
harrisoncramer/gitlab.nvim#583 · 2 bình luận · 1 người được giao ·
-
feature request
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
harrisoncramer/gitlab.nvim#516 · 1 bình luận ·
-
Oauth Login the pluginCó thể làm lại được @vamshi567bh đã nhận 267 ngày trước và không có pull request nào đang mở. Đang mởfeature request
harrisoncramer/gitlab.nvim#515 · 2 bình luận · 1 người được giao ·
-
Support for custom Gitlab URLsĐang mởfeature request
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 56/100
harrisoncramer/gitlab.nvim#505 · 6 bình luận ·
Tất cả issue của harrisoncramer/gitlab.nvim
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 75/100
dense-analysis/ale#5174 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
LuaLS/lua-language-server#3477 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
valhalla/valhalla#6431 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày