Commit 83a63a17 authored by Brad King's avatar Brad King
Browse files

types: update for 11.6

Merge requests gained fields to report a merge error and whether a
rebase is in progress.
parent a877bca6
{"target_project_id": 855, "web_url": "https://gitlab.kitware.com/utils/rust-gitlab/merge_requests/35", "source_branch": "add_hook-api", "downvotes": 0, "labels": [], "updated_at": "2016-10-04T16:18:57.940-04:00", "work_in_progress": false, "assignee": {"username": "brad.king", "web_url": "https://gitlab.kitware.com/brad.king", "name": "Brad King", "state": "active", "avatar_url": "https://secure.gravatar.com/avatar/0617392a2f9fd505720d0c42cefc1a10?s=80&d=identicon", "id": 10}, "user_notes_count": 3, "closed_at": null, "id": 20215, "force_remove_source_branch": true, "target_branch": "master", "subscribed": true, "title": "gitlab: expose hook addition API", "merge_commit_sha": null, "merge_when_pipeline_succeeds": false, "time_stats": {"time_estimate": 0, "human_total_time_spent": null, "human_time_estimate": null, "total_time_spent": 0}, "state": "merged", "upvotes": 0, "project_id": 855, "merged_at": "2016-10-04T16:18:57.914-04:00", "allow_collaboration": null, "description": "Fixes #5.", "squash": false, "iid": 35, "milestone": null, "discussion_locked": null, "diff_refs": {"start_sha": "981262b03fc0149c1677ca51ea47b570e30d6a90", "base_sha": "981262b03fc0149c1677ca51ea47b570e30d6a90", "head_sha": "04e94ae667024a62a90179f395bfdc2b35f3efd2"}, "closed_by": null, "source_project_id": 856, "merged_by": null, "merge_status": "can_be_merged", "changes_count": "3", "should_remove_source_branch": null, "created_at": "2016-10-04T15:56:43.276-04:00", "author": {"username": "ben.boeckel", "web_url": "https://gitlab.kitware.com/ben.boeckel", "name": "Ben Boeckel", "state": "active", "avatar_url": "https://secure.gravatar.com/avatar/2f5f7e99190174edb5a2f66b8653b0b2?s=80&d=identicon", "id": 13}, "sha": "04e94ae667024a62a90179f395bfdc2b35f3efd2", "allow_maintainer_to_push": null}
{"target_project_id": 855, "web_url": "https://gitlab.kitware.com/utils/rust-gitlab/merge_requests/35", "source_branch": "add_hook-api", "downvotes": 0, "labels": [], "updated_at": "2016-10-04T16:18:57.940-04:00", "work_in_progress": false, "assignee": {"username": "brad.king", "web_url": "https://gitlab.kitware.com/brad.king", "name": "Brad King", "state": "active", "avatar_url": "https://secure.gravatar.com/avatar/0617392a2f9fd505720d0c42cefc1a10?s=80&d=identicon", "id": 10}, "user_notes_count": 3, "closed_at": null, "id": 20215, "force_remove_source_branch": true, "target_branch": "master", "merge_error": null, "subscribed": true, "title": "gitlab: expose hook addition API", "merge_commit_sha": null, "merge_when_pipeline_succeeds": false, "merged_at": "2016-10-04T16:18:57.914-04:00", "state": "merged", "upvotes": 0, "project_id": 855, "allow_collaboration": null, "description": "Fixes #5.", "squash": false, "iid": 35, "milestone": null, "discussion_locked": null, "time_stats": {"time_estimate": 0, "human_total_time_spent": null, "human_time_estimate": null, "total_time_spent": 0}, "diff_refs": {"start_sha": "981262b03fc0149c1677ca51ea47b570e30d6a90", "base_sha": "981262b03fc0149c1677ca51ea47b570e30d6a90", "head_sha": "04e94ae667024a62a90179f395bfdc2b35f3efd2"}, "closed_by": null, "source_project_id": 856, "merge_status": "can_be_merged", "merged_by": null, "changes_count": "3", "should_remove_source_branch": null, "created_at": "2016-10-04T15:56:43.276-04:00", "author": {"username": "ben.boeckel", "web_url": "https://gitlab.kitware.com/ben.boeckel", "name": "Ben Boeckel", "state": "active", "avatar_url": "https://secure.gravatar.com/avatar/2f5f7e99190174edb5a2f66b8653b0b2?s=80&d=identicon", "id": 13}, "sha": "04e94ae667024a62a90179f395bfdc2b35f3efd2", "allow_maintainer_to_push": null}
......@@ -301,6 +301,8 @@ fn test_read_merge_request() {
Some(ObjectId::new("04e94ae667024a62a90179f395bfdc2b35f3efd2")));
assert_eq!(merge_request.diff_refs.as_ref().unwrap().start_sha,
Some(ObjectId::new("981262b03fc0149c1677ca51ea47b570e30d6a90")));
assert_eq!(merge_request.merge_error, None);
assert_eq!(merge_request.rebase_in_progress, None);
assert_eq!(merge_request.merge_commit_sha, None);
assert_eq!(merge_request.subscribed, Some(true));
assert_eq!(merge_request.time_stats.time_estimate, 0);
......
......@@ -1440,6 +1440,10 @@ pub struct MergeRequest {
pub sha: Option<ObjectId>,
/// The commits used to construct the merge request diffs.
pub diff_refs: Option<DiffRefs>,
/// Description of error if MR failed to merge.
pub merge_error: Option<String>,
/// Whether a rebase is in progress.
pub rebase_in_progress: Option<bool>,
/// The object ID of the commit which merged the merge request.
pub merge_commit_sha: Option<ObjectId>,
/// Whether the current user is subscribed or not.
......@@ -1533,6 +1537,10 @@ pub struct MergeRequestChanges {
pub sha: Option<ObjectId>,
/// The commits used to construct the merge request diffs.
pub diff_refs: Option<DiffRefs>,
/// Description of error if MR failed to merge.
pub merge_error: Option<String>,
/// Whether a rebase is in progress.
pub rebase_in_progress: Option<bool>,
/// The object ID of the commit which merged the merge request.
pub merge_commit_sha: Option<ObjectId>,
/// GitLab does not include this in responses with lists of merge requests but
......@@ -1589,6 +1597,8 @@ impl From<MergeRequestChanges> for MergeRequest {
merge_status: mr.merge_status,
sha: mr.sha,
diff_refs: mr.diff_refs,
merge_error: mr.merge_error,
rebase_in_progress: mr.rebase_in_progress,
merge_commit_sha: mr.merge_commit_sha,
subscribed: mr.subscribed,
time_stats: mr.time_stats,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment