Skip to content

Commit

Permalink
Adding script to fiddle with DiffNote
Browse files Browse the repository at this point in the history
  • Loading branch information
tomasbjerre committed Oct 6, 2018
1 parent 7c6fad9 commit 403f2d5
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
5 changes: 5 additions & 0 deletions sandbox/comment_diffnote.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
project=tomas.bjerre85%2Fviolations-test
mergeRequestIid=1
url=https://gitlab.com/api/v4/projects/$project/merge_requests/$mergeRequestIid/discussions

curl $url -H 'Content-Type", "application/json' -H "PRIVATE-TOKEN: $GITLAB_TOKEN" --data '@comment_diffnote.txt' -v 2>&1
12 changes: 12 additions & 0 deletions sandbox/comment_diffnote.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"position[old_line]":9,
"position[base_sha]":"e746f44de4cac5b4a4362e6713a3416e1e6617d3",
"position[head_sha]":"7e23c9a980197fe49fae67fb23687c857ff42f86",
"position[position_type]":"text",
"body":"**Reporter**: PMD\n\n**Rule**: EmptyIfStmt\n\n**Severity**: WARN\n\n**File**: /home/bjerre/workspace/violations/violation-comments-to-gitlab-plugin/work/workspace/pipe2/src/main/java/se/bjurr/violations/lib/example/MyClass.java L9\n\n\nAvoid empty if statements&#10;&#10;&#10;Empty Code http://pmd.sourceforge.net/pmd-5.2.3/pmd-java/rules/java/empty.html#EmptyIfStmt\n\n\n*<this is a auto generated comment from violation-comments-lib F7F8ASD8123FSDF>* *<a-113352401>*",
"type":"DiffNote",
"position[new_path]":"src/main/java/se/bjurr/violations/lib/example/MyClass.java",
"position[start_sha]":"a06971bdc77855da448a35da3313d20123320240",
"position[new_line]":9,
"position[old_path]":"src/main/java/se/bjurr/violations/lib/example/MyClass.java"
}

0 comments on commit 403f2d5

Please sign in to comment.