Closed Xiaobo2020 closed 1 year ago
I dont know if gitlab have the same constraints as github - but inline comments there can only be added to files in the diff. So if the package.json line one is not changed, then it would show up in the main body
Hi @orta . Here you can think that there are some changes in package.json. So theoretically inline comment should show up. But I found some instructions about Danger in gitlab. It is mentioned that danger will only post one comment, I am not sure if this is related to the problem I am encountering. https://docs.gitlab.com/ee/development/dangerbot.html#danger-comments-in-merge-requests
That's Danger in Ruby, so it has different constraints. Without being able to show a repro, there's not much I can tell you - I'd recommend running with DEBUG=true
or -verbose
and looking into what its sending then sending us a PR with what you think should fix it
I try to run DEBUG='*' npx danger ci -v -f
in my gitlab pipeline. Through the printed information, I did find a strange phenomenon. It seems that danger did create an inline comment through createMergeRequestDiscussion
, but then the inline comment was deleted.
Create | Delete |
---|---|
This is my dangerfile.js and I'm sure there are some diff in both file.
message('@xiaobo_wang inline comment', 'danger/tools/rules/common/mrDescription.js', 19);
message('@xiaobo_wang inline comment', 'package.json', 35);
These two inline comments have the same performance, first created and then deleted
I think I can use --newComment
and --removePreviousComments
to avoid this issue. But it indeed exists in GitLab.
BTW, I found another bug about createComment
called in Executor.ts
.
Re-created https://github.com/danger/danger-js/pull/1381 PR using review notes:
Describe the bug
I need both normal comment and maybe inline comment.
To Reproduce Steps to reproduce the behavior:
message("inline comment", "package.json", 1)
message("normal comment")
Expected behavior
Both comments should display
Screenshots
Your Environment
11.2.6
16.14.0
8.3.1
MacOS