Query MR fails, I think because of missing `source_project_id`
Querying for the following MR on Debian's Gitlab instance https://salsa.debian.org/security-tracker-team/security-tracker/-/merge_requests/29 via this crate doesn't work correctly if I ask to convert the resulting JSON to gitlab::types::MergeRequest
. I get this error: invalid type: null, expected u64
If I do this let d: Vec<serde_json::Value> = d.query(&mut self.gl)?;
it succeeds. I wrote code to convert the results to gitlab::types::MergeRequest
individually and below is the first one which fails.
I see that source_project_id
is Null
below. In types::MergeRequest
it is ProjectId
, not Option<ProjectId>
which I expect is at least one reason why this is failing.
[src/lab.rs:203] json = Object({
"allow_collaboration": Bool(
false,
),
"allow_maintainer_to_push": Bool(
false,
),
"assignee": Null,
"assignees": Array([]),
"author": Object({
"avatar_url": String(
"https://seccdn.libravatar.org/avatar/6795e7dd77b1f1c2ee4bffa0cd02cf77?s=80&d=identicon&gravatarproxy=n",
),
"id": Number(
2153,
),
"name": String(
"Michael R. Crusoe",
),
"state": String(
"active",
),
"username": String(
"crusoe",
),
"web_url": String(
"https://salsa.debian.org/crusoe",
),
}),
"blocking_discussions_resolved": Bool(
true,
),
"closed_at": String(
"2018-12-14T06:34:18.705Z",
),
"closed_by": Object({
"avatar_url": String(
"https://salsa.debian.org/uploads/-/system/user/avatar/1613/avatar.png",
),
"id": Number(
1613,
),
"name": String(
"Salvatore Bonaccorso",
),
"state": String(
"active",
),
"username": String(
"carnil",
),
"web_url": String(
"https://salsa.debian.org/carnil",
),
}),
"created_at": String(
"2018-12-09T02:27:14.369Z",
),
"description": String(
"Hello from one of the package maintainers for htslib. This is my first time interacting with the security-team/CVEs; please let me know if I'm not doing this correctly or could do it better.\n\nThanks!",
),
"discussion_locked": Null,
"downvotes": Number(
0,
),
"force_remove_source_branch": Bool(
true,
),
"has_conflicts": Bool(
true,
),
"id": Number(
6091,
),
"iid": Number(
29,
),
"labels": Array([]),
"merge_commit_sha": Null,
"merge_status": String(
"cannot_be_merged",
),
"merge_when_pipeline_succeeds": Bool(
false,
),
"merged_at": Null,
"merged_by": Null,
"milestone": Null,
"project_id": Number(
555,
),
"reference": String(
"!29",
),
"references": Object({
"full": String(
"security-tracker-team/security-tracker!29",
),
"relative": String(
"!29",
),
"short": String(
"!29",
),
}),
"reviewers": Array([]),
"sha": String(
"919071ec9c62f8a85f3f14ecdf3ba231aab0288f",
),
"should_remove_source_branch": Null,
"source_branch": String(
"fix_CVE-2018-1384{3,4,5}",
),
"source_project_id": Null,
"squash": Bool(
true,
),
"squash_commit_sha": Null,
"state": String(
"closed",
),
"target_branch": String(
"master",
),
"target_project_id": Number(
555,
),
"task_completion_status": Object({
"completed_count": Number(
0,
),
"count": Number(
0,
),
}),
"time_stats": Object({
"human_time_estimate": Null,
"human_total_time_spent": Null,
"time_estimate": Number(
0,
),
"total_time_spent": Number(
0,
),
}),
"title": String(
"Mark CVE-2018-1384{3,4,5} as fixed in htslib 1.9-1",
),
"updated_at": String(
"2018-12-14T07:35:09.543Z",
),
"upvotes": Number(
0,
),
"user_notes_count": Number(
3,
),
"web_url": String(
"https://salsa.debian.org/security-tracker-team/security-tracker/-/merge_requests/29",
),
"work_in_progress": Bool(
false,
),
})