Commit 9d5761e6 authored by Ben Boeckel's avatar Ben Boeckel Committed by Kitware Robot
Browse files

Merge topic 'gitlab-10.1'

6910bbdd

 types: update for 10.1
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Reviewed-by: Ben Boeckel's avatarBen Boeckel <ben.boeckel@kitware.com>
Merge-request: !109
parents cde9422e 6910bbdd
{"downvotes": 0, "labels": [], "updated_at": "2017-07-07T02:31:03.757-04:00", "assignee": {"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}, "web_url": "https://gitlab.kitware.com/utils/rust-gitlab/issues/6", "id": 69328, "subscribed": true, "title": "fix documentation warnings", "time_stats": {"time_estimate": 0, "human_total_time_spent": null, "human_time_estimate": null, "total_time_spent": 0}, "state": "closed", "_links": {"project": "http://gitlab.kitware.com/api/v4/projects/855", "self": "http://gitlab.kitware.com/api/v4/projects/855/issues/6", "notes": "http://gitlab.kitware.com/api/v4/projects/855/issues/6/notes", "award_emoji": "http://gitlab.kitware.com/api/v4/projects/855/issues/6/award_emoji"}, "upvotes": 0, "project_id": 855, "due_date": null, "description": "", "confidential": false, "iid": 6, "milestone": null, "created_at": "2016-10-30T14:54:28.954-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}, "assignees": [{"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}], "user_notes_count": 0}
{"downvotes": 0, "labels": [], "updated_at": "2017-07-07T02:31:03.757-04:00", "assignee": {"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}, "web_url": "https://gitlab.kitware.com/utils/rust-gitlab/issues/6", "closed_at": null, "id": 69328, "subscribed": true, "title": "fix documentation warnings", "time_stats": {"time_estimate": 0, "human_total_time_spent": null, "human_time_estimate": null, "total_time_spent": 0}, "state": "closed", "_links": {"project": "http://gitlab.kitware.com/api/v4/projects/855", "self": "http://gitlab.kitware.com/api/v4/projects/855/issues/6", "notes": "http://gitlab.kitware.com/api/v4/projects/855/issues/6/notes", "award_emoji": "http://gitlab.kitware.com/api/v4/projects/855/issues/6/award_emoji"}, "upvotes": 0, "project_id": 855, "due_date": null, "description": "", "confidential": false, "iid": 6, "milestone": null, "discussion_locked": null, "created_at": "2016-10-30T14:54:28.954-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}, "assignees": [{"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}], "user_notes_count": 0}
{"due_date": null, "downvotes": 0, "web_url": "https://gitlab.kitware.com/utils/rust-gitlab/issues/5", "description": "The workflow currently requires that the robot be able to register itself as a webhook for new projects. An API needs added for this.\n\nCc: @brad.king", "confidential": false, "title": "Add project hook APIs", "created_at": "2016-10-04T14:59:37.178-04:00", "labels": [], "updated_at": "2017-07-07T02:31:05.370-04:00", "iid": 5, "state": "closed", "user_notes_count": 0, "assignee": {"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}, "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}, "milestone": null, "upvotes": 0, "assignees": [{"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}], "project_id": 855, "time_stats": {"time_estimate": 0, "human_total_time_spent": null, "human_time_estimate": null, "total_time_spent": 0}, "id": 69075}
{"downvotes": 0, "labels": [], "updated_at": "2017-07-07T02:31:05.370-04:00", "assignee": {"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}, "web_url": "https://gitlab.kitware.com/utils/rust-gitlab/issues/5", "closed_at": null, "id": 69075, "title": "Add project hook APIs", "time_stats": {"time_estimate": 0, "human_total_time_spent": null, "human_time_estimate": null, "total_time_spent": 0}, "state": "closed", "upvotes": 0, "project_id": 855, "due_date": null, "description": "The workflow currently requires that the robot be able to register itself as a webhook for new projects. An API needs added for this.\n\nCc: @brad.king", "confidential": false, "iid": 5, "milestone": null, "discussion_locked": null, "created_at": "2016-10-04T14:59:37.178-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}, "assignees": [{"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}], "user_notes_count": 0}
{"target_project_id": 855, "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, "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, "description": "Fixes #5.", "iid": 35, "milestone": null, "source_project_id": 856, "merge_status": "can_be_merged", "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", "web_url": "https://gitlab.kitware.com/utils/rust-gitlab/merge_requests/35"}
{"target_project_id": 855, "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, "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, "description": "Fixes #5.", "iid": 35, "milestone": null, "discussion_locked": null, "source_project_id": 856, "merge_status": "can_be_merged", "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", "web_url": "https://gitlab.kitware.com/utils/rust-gitlab/merge_requests/35"}
{"status": "success", "committer_email": "kwrobot@kitware.com", "stats": {"deletions": 0, "additions": 8, "total": 8}, "short_id": "de4ac3cf", "title": "Merge topic 'mr-awards'", "author_email": "brad.king@kitware.com", "committer_name": "Kitware Robot", "created_at": "2016-11-08T09:30:13.000-05:00", "author_name": "Brad King", "parent_ids": ["559f5f4a2bfe1f48e9e95afa09c029deb655cf7d", "a222c5539569cda6999b8069f1e51a5202c30711"], "committed_date": "2016-11-08T09:30:13.000-05:00", "message": "Merge topic 'mr-awards'\n\na222c553 gitlab: add a method for MR award queries\n\nAcked-by: Kitware Robot <kwrobot@kitware.com>\nReviewed-by: Brad King <brad.king@kitware.com>\nMerge-request: !46\n", "authored_date": "2016-11-08T09:30:13.000-05:00", "id": "de4ac3cf96cb8a0893be22b03f5171d934f9d392"}
{"status": "success", "committer_email": "kwrobot@kitware.com", "stats": {"deletions": 0, "additions": 8, "total": 8}, "short_id": "de4ac3cf", "title": "Merge topic 'mr-awards'", "author_email": "brad.king@kitware.com", "committer_name": "Kitware Robot", "created_at": "2016-11-08T09:30:13.000-05:00", "author_name": "Brad King", "parent_ids": ["559f5f4a2bfe1f48e9e95afa09c029deb655cf7d", "a222c5539569cda6999b8069f1e51a5202c30711"], "committed_date": "2016-11-08T09:30:13.000-05:00", "last_pipeline": {"status": "success", "sha": "de4ac3cf96cb8a0893be22b03f5171d934f9d392", "ref": "master", "id": 34289}, "message": "Merge topic 'mr-awards'\n\na222c553 gitlab: add a method for MR award queries\n\nAcked-by: Kitware Robot <kwrobot@kitware.com>\nReviewed-by: Brad King <brad.king@kitware.com>\nMerge-request: !46\n", "authored_date": "2016-11-08T09:30:13.000-05:00", "id": "de4ac3cf96cb8a0893be22b03f5171d934f9d392"}
......@@ -116,6 +116,7 @@ fn test_read_issue() {
assert_eq!(issue.updated_at,
Utc.ymd(2017, 7, 7)
.and_hms_milli(6, 31, 03, 757));
assert_eq!(issue.closed_at, None);
assert!(issue.labels.is_empty());
assert!(issue.milestone.is_none());
assert_eq!(issue.author.username, "ben.boeckel");
......@@ -156,6 +157,7 @@ fn test_read_issue() {
assert_eq!(issue.downvotes, 0);
assert_eq!(issue.due_date, None);
assert_eq!(issue.confidential, false);
assert_eq!(issue.discussion_locked, None);
assert_eq!(issue.web_url,
"https://gitlab.kitware.com/utils/rust-gitlab/issues/6");
assert!(issue.has_links());
......@@ -180,6 +182,7 @@ fn test_read_issue_reference() {
assert_eq!(issue.updated_at,
Utc.ymd(2017, 7, 7)
.and_hms_milli(6, 31, 5, 370));
assert_eq!(issue.closed_at, None);
assert!(issue.labels.is_empty());
assert!(issue.milestone.is_none());
assert_eq!(issue.author.username, "ben.boeckel");
......@@ -211,6 +214,7 @@ fn test_read_issue_reference() {
assert_eq!(issue.downvotes, 0);
assert_eq!(issue.due_date, None);
assert_eq!(issue.confidential, false);
assert_eq!(issue.discussion_locked, None);
assert_eq!(issue.web_url,
"https://gitlab.kitware.com/utils/rust-gitlab/issues/5");
} else {
......@@ -288,6 +292,7 @@ fn test_read_merge_request() {
assert_eq!(merge_request.time_stats.human_time_estimate, None);
assert_eq!(merge_request.time_stats.human_total_time_spent, None);
assert_eq!(merge_request.user_notes_count, 3);
assert_eq!(merge_request.discussion_locked, None);
assert_eq!(merge_request.should_remove_source_branch, None);
assert_eq!(merge_request.force_remove_source_branch, Some(true));
assert_eq!(merge_request.web_url,
......@@ -492,6 +497,14 @@ fn test_read_repo_commit_detail() {
assert_eq!(repo_commit_detail.stats.additions, 8);
assert_eq!(repo_commit_detail.stats.deletions, 0);
assert_eq!(repo_commit_detail.stats.total, 8);
if let Some(ref last_pipeline) = repo_commit_detail.last_pipeline {
assert_eq!(last_pipeline.id, PipelineId::new(34289));
assert_eq!(last_pipeline.ref_, Some("master".to_string()));
assert_eq!(last_pipeline.sha, ObjectId::new("de4ac3cf96cb8a0893be22b03f5171d934f9d392"));
assert_eq!(last_pipeline.status, StatusState::Success);
} else {
panic!("expected to have a last_pipeline for this commit");
}
}
#[test]
......
......@@ -983,6 +983,8 @@ pub struct RepoCommitDetail {
pub message: String,
/// Statistics about the commit.
pub stats: RepoCommitStats,
/// The last pipeline for this commit, if any.
pub last_pipeline: Option<PipelineBasic>,
// XXX: Investigate what this is.
/// This looks to be CI related; ignoring without better docs.
status: Value,
......@@ -1164,6 +1166,8 @@ pub struct Issue {
pub created_at: DateTime<Utc>,
/// When the issue was last updated.
pub updated_at: DateTime<Utc>,
/// When the issue was closed, if closed.
pub closed_at: Option<DateTime<Utc>>,
/// The labels attached to the issue.
pub labels: Vec<String>,
/// The milestone of the issue.
......@@ -1190,6 +1194,8 @@ pub struct Issue {
pub due_date: Option<NaiveDate>,
/// Whether the issue is confidential or not.
pub confidential: bool,
/// Whether the discussion has been locked.
pub discussion_locked: Option<bool>,
/// The URL of the issue.
pub web_url: String,
......@@ -1378,6 +1384,8 @@ pub struct MergeRequest {
pub time_stats: IssuableTimeStats,
/// The number of comments on the merge request.
pub user_notes_count: u64,
/// Whether the discussion has been locked.
pub discussion_locked: Option<bool>,
/// Whether the merge request should be deleted or not (set by the merger).
pub should_remove_source_branch: Option<bool>,
/// Whether the merge request should be deleted or not (set by the author).
......@@ -1447,6 +1455,8 @@ pub struct MergeRequestChanges {
pub time_stats: IssuableTimeStats,
/// The number of comments on the merge request.
pub user_notes_count: u64,
/// Whether the discussion has been locked.
pub discussion_locked: Option<bool>,
/// Whether the merge request should be deleted or not (set by the merger).
pub should_remove_source_branch: Option<bool>,
/// Whether the merge request should be deleted or not (set by the author).
......@@ -1486,6 +1496,7 @@ impl From<MergeRequestChanges> for MergeRequest {
subscribed: mr.subscribed,
time_stats: mr.time_stats,
user_notes_count: mr.user_notes_count,
discussion_locked: mr.discussion_locked,
should_remove_source_branch: mr.should_remove_source_branch,
force_remove_source_branch: mr.force_remove_source_branch,
web_url: mr.web_url,
......
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