commit description returned by graphql contains also commit title
Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
gitlab graphql appears to be confused when working with commits which have multi-line title.
For example: redhat/centos-stream/src/kernel/centos-stream-10!363 (13983509)
$ git log -1 --format=%s 13983509b016c0f1890809843f342f8f69ccb187
redhat: create 'debug' addon for UKI Upstream Status: RHEL-only ARK commit 6a31cd855fb40564e1b96bfc82e6cca9c8d93898 JIRA: https://issues.redhat.com/browse/RHEL-70836
$ git log -1 --format=%b 13983509b016c0f1890809843f342f8f69ccb187
Create 'debug' addon for RHEL UKI.
Signed-off-by: Li Tian <litian@redhat.com>
If I query this commit with graphql:
query mrCommits($mr_id: String!, $namespace: ID!, $per_page: Int = 100, $before: String = "", $after: String = "") {
project(fullPath: $namespace) {
mr: mergeRequest(iid: $mr_id) {
...MrCommits
}
}
}
fragment MrCommits on MergeRequest {
commits: commitsWithoutMergeCommits(
first: $per_page
before: $before
after: $after
) {
pageInfo {
hasNextPage
endCursor
}
nodes {
description
fullTitle
sha
title
}
}
}
with parameters
{
"namespace": "redhat/centos-stream/src/kernel/centos-stream-10",
"mr_id": "363"
}
I get:
{
"data": {
"project": {
"mr": {
"commits": {
"pageInfo": {
"hasNextPage": false,
"endCursor": "MQ"
},
"nodes": [
{
"description": "redhat: create 'debug' addon for UKI Upstream Status: RHEL-only ARK commit 6a31cd855fb40564e1b96bfc82e6cca9c8d93898 JIRA: https://issues.redhat.com/browse/RHEL-70836\n\nCreate 'debug' addon for RHEL UKI.\nSigned-off-by: Li Tian <litian@redhat.com>\n",
"fullTitle": "redhat: create 'debug' addon for UKI Upstream Status: RHEL-only ARK commit 6a31cd855fb40564e1b96bfc82e6cca9c8d93898 JIRA: https://issues.redhat.com/browse/RHEL-70836",
"sha": "13983509b016c0f1890809843f342f8f69ccb187",
"title": "redhat: create 'debug' addon for UKI Upstream Status: RHEL-only ARK commit..."
}
]
}
}
}
},
"correlationId": "d04d2f2429c3d020321457553505badf"
}
where description isn't just description, it also contains title.
Edited by 🤖 GitLab Bot 🤖