-
Notifications
You must be signed in to change notification settings - Fork 39
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
Error creating comment on new code #365
Comments
Hello, I'm not fully able to replicate your problem with what you've provided. It seems from your issue description that you're trying to make a comment on an entirely new file, is that right? This works for me, but my payload to Gitlab looks pretty different from yours: {
"body": "Some comment",
"position": {
"base_sha": "e8a1d2dca7db01e3a2302d767e50587b3172f1cc",
"head_sha": "e2d75ecc0dc351fc6a5f7bba04bf1d3bc2766fe2",
"start_sha": "e8a1d2dca7db01e3a2302d767e50587b3172f1cc",
"new_path": "new-file.txt",
"old_path": "new-file.txt",
"position_type": "text",
"new_line": 1,
"line_range": {
"start": {
"line_code": "2f95178383a678e9b374564a79ba273396494739_0_1",
"type": "new"
},
"end": {
"line_code": "2f95178383a678e9b374564a79ba273396494739_0_1",
"type": "new"
}
}
}
} Specifically, your payload looks like it's missing two different pieces: The actual content of the note, and the line code.
demo.mov |
Ohhhh.... I'm seeing potentially what's happening, are you trying to make a comment on the file tree? That's not how the plugin works, when leaving comments (code-linked comments) you're supposed to leave them on the code itself, like in Gitlab, not the file tree. Is that what's happening here? I'm able to replicate your error by doing this. |
Hi. I've noticed something similar - a comment on the code was refused with the same error (invalid line code), but since it was in a real MR, I couldn't really experiment with it in order to debug this. Now when I create a comment on a new file in a testing repo, the command works as expected. Could you, @tcordel, provide more information, such as:
|
@jakubbortlik Please see this MR, this particular error occurs when attempting to leave a comment in the file tree or the discussion tree, which were not intended to support line-specific comments. |
I see, that's nice. But I still think I was experiencing the problem of not being able to create a comment on added code just a few days ago (that means, on a recent version of the plugin), but I was not able at the moment to debug it. |
Hi, Sorry for the delay, i'm trying to investigate on my own to report efficient feedback... I don't think i misuse shortcuts:
Note: On some of my project this routine works. It seems non-working for multi-modules projects... I'll try to investigate on the plugin (adding logs) to have a better understanding. |
I've figured out the issue and it's addressed in #378 Apologies! I'll merge this into develop/main right away, this was caused by a recent refactor to the Go codebase. |
Ow mate no worries! Glad you found it out !
I just checked out your request, it fixes my bug: i'm able to create a
comment.
Thanks for the plugin,
Cya
Le lun. 16 sept. 2024, 22:18, Harrison (Harry) Cramer <
***@***.***> a écrit :
… I've figured out the issue and it's addressed in #378
<#378>
Apologies! I'll merge this into develop/main right away, this was caused
by a recent refactor to the Go codebase.
—
Reply to this email directly, view it on GitHub
<#365 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AOEC35N2JTKQAQ7SLVOW6ZLZW44IRAVCNFSM6AAAAABOCPBQHGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNJTHA3TEMBUGE>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Hi, i'm facing this issue, maybe it can be fixed but i'm feeling a bit lost.
Maybe you may help me :)
Prerequsities
:h gitlab.nvim.troubleshooting
and followed the steps thereSetup Configuration and Environment
Bug Description
Failed to post comment for new code:
Reproduction Steps
Screenshots
thanks!
The text was updated successfully, but these errors were encountered: