Commit 109c4d1a authored by Ben Boeckel's avatar Ben Boeckel Committed by Kitware Robot
Browse files

Merge topic 'gitlab-10.0'

d0b7b727

 types: update for 10.0
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Reviewed-by: Ben Boeckel's avatarBen Boeckel <ben.boeckel@kitware.com>
Merge-request: !107
parents e70b7d96 d0b7b727
{"_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"}, "due_date": null, "downvotes": 0, "subscribed": true, "web_url": "https://gitlab.kitware.com/utils/rust-gitlab/issues/6", "description": "", "confidential": false, "title": "fix documentation warnings", "created_at": "2016-10-30T14:54:28.954-04:00", "labels": [], "updated_at": "2017-07-07T02:31:03.757-04:00", "iid": 6, "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, "id": 69328}
{"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}
{"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, "id": 69075}
{"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}
{"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, "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, "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"}
{"lfs_enabled": true, "request_access_enabled": true, "forks_count": 5, "only_allow_merge_if_all_discussions_are_resolved": null, "container_registry_enabled": true, "web_url": "https://gitlab.kitware.com/utils/rust-gitlab", "wiki_enabled": true, "id": 855, "merge_requests_enabled": true, "archived": false, "snippets_enabled": false, "http_url_to_repo": "https://gitlab.kitware.com/utils/rust-gitlab.git", "namespace": {"kind": "group", "name": "Utils", "members_count_with_descendants": 3, "parent_id": null, "path": "utils", "id": 498, "full_path": "utils"}, "star_count": 0, "avatar_url": null, "_links": {"repo_branches": "http://gitlab.kitware.com/api/v4/projects/855/repository/branches", "merge_requests": "http://gitlab.kitware.com/api/v4/projects/855/merge_requests", "self": "http://gitlab.kitware.com/api/v4/projects/855", "labels": "http://gitlab.kitware.com/api/v4/projects/855/labels", "members": "http://gitlab.kitware.com/api/v4/projects/855/members", "events": "http://gitlab.kitware.com/api/v4/projects/855/events", "issues": "http://gitlab.kitware.com/api/v4/projects/855/issues"}, "issues_enabled": true, "path_with_namespace": "utils/rust-gitlab", "ci_config_path": null, "shared_with_groups": [], "description": "Rust library for communicating with a Gitlab instance.", "import_error": null, "default_branch": "master", "visibility": "public", "ssh_url_to_repo": "git@gitlab.kitware.com:utils/rust-gitlab.git", "path": "rust-gitlab", "import_status": "none", "only_allow_merge_if_pipeline_succeeds": false, "open_issues_count": 4, "last_activity_at": "2017-08-03T12:11:16.279-04:00", "name": "rust-gitlab", "printing_merge_request_link_enabled": true, "name_with_namespace": "Utils / rust-gitlab", "created_at": "2016-06-29T13:35:12.495-04:00", "creator_id": 13, "shared_runners_enabled": true, "permissions": {"group_access": {"notification_level": 3, "access_level": 50}, "project_access": null}, "tag_list": [], "jobs_enabled": false, "public_jobs": true}
{"lfs_enabled": true, "request_access_enabled": true, "forks_count": 5, "only_allow_merge_if_all_discussions_are_resolved": null, "container_registry_enabled": true, "web_url": "https://gitlab.kitware.com/utils/rust-gitlab", "wiki_enabled": true, "id": 855, "merge_requests_enabled": true, "archived": false, "snippets_enabled": false, "http_url_to_repo": "https://gitlab.kitware.com/utils/rust-gitlab.git", "namespace": {"kind": "group", "name": "Utils", "members_count_with_descendants": 3, "parent_id": null, "path": "utils", "id": 498, "full_path": "utils"}, "star_count": 0, "avatar_url": null, "_links": {"repo_branches": "http://gitlab.kitware.com/api/v4/projects/855/repository/branches", "merge_requests": "http://gitlab.kitware.com/api/v4/projects/855/merge_requests", "self": "http://gitlab.kitware.com/api/v4/projects/855", "labels": "http://gitlab.kitware.com/api/v4/projects/855/labels", "members": "http://gitlab.kitware.com/api/v4/projects/855/members", "events": "http://gitlab.kitware.com/api/v4/projects/855/events", "issues": "http://gitlab.kitware.com/api/v4/projects/855/issues"}, "resolve_outdated_diff_discussions": null, "issues_enabled": true, "path_with_namespace": "utils/rust-gitlab", "ci_config_path": null, "shared_with_groups": [], "description": "Rust library for communicating with a Gitlab instance.", "import_error": null, "default_branch": "master", "visibility": "public", "ssh_url_to_repo": "git@gitlab.kitware.com:utils/rust-gitlab.git", "path": "rust-gitlab", "import_status": "none", "only_allow_merge_if_pipeline_succeeds": false, "open_issues_count": 4, "last_activity_at": "2017-10-05T11:18:57.875-04:00", "name": "rust-gitlab", "printing_merge_request_link_enabled": true, "name_with_namespace": "Utils / rust-gitlab", "created_at": "2016-06-29T13:35:12.495-04:00", "creator_id": 13, "shared_runners_enabled": true, "permissions": {"group_access": {"notification_level": 3, "access_level": 50}, "project_access": null}, "tag_list": [], "jobs_enabled": false, "public_jobs": true}
{"two_factor_enabled": true, "can_create_project": true, "confirmed_at": "2015-02-26T10:58:34.660-05:00", "twitter": "", "linkedin": "", "color_scheme_id": 4, "web_url": "https://gitlab.kitware.com/kwrobot", "skype": "", "identities": [], "id": 11, "projects_limit": 50, "current_sign_in_at": "2017-07-10T11:35:58.336-04:00", "state": "active", "location": null, "email": "kwrobot@kitware.com", "website_url": "", "username": "kwrobot", "bio": "", "last_sign_in_at": "2017-06-05T14:46:29.512-04:00", "last_activity_on": "2017-07-20", "external": false, "name": "Kitware Robot", "can_create_group": true, "created_at": "2015-02-26T10:58:34.670-05:00", "avatar_url": "https://secure.gravatar.com/avatar/9ddcd45fcb89d966aab95b1f1002f84c?s=80&d=identicon", "organization": null}
{"two_factor_enabled": true, "can_create_project": true, "confirmed_at": "2015-02-26T10:58:34.660-05:00", "twitter": "", "linkedin": "", "color_scheme_id": 4, "web_url": "https://gitlab.kitware.com/kwrobot", "skype": "", "identities": [], "id": 11, "projects_limit": 50, "current_sign_in_at": "2017-07-10T11:35:58.336-04:00", "state": "active", "location": null, "email": "kwrobot@kitware.com", "website_url": "", "username": "kwrobot", "bio": "", "last_sign_in_at": "2017-06-05T14:46:29.512-04:00", "last_activity_on": "2017-10-10", "external": false, "organization": null, "name": "Kitware Robot", "can_create_group": true, "created_at": "2015-02-26T10:58:34.670-05:00", "avatar_url": "https://secure.gravatar.com/avatar/9ddcd45fcb89d966aab95b1f1002f84c?s=80&d=identicon", "theme_id": null}
{"two_factor_enabled": true, "can_create_project": true, "confirmed_at": "2015-02-26T10:58:34.660-05:00", "twitter": "", "linkedin": "", "color_scheme_id": 4, "web_url": "https://gitlab.kitware.com/kwrobot", "skype": "", "is_admin": true, "identities": [], "id": 11, "projects_limit": 50, "current_sign_in_at": "2017-07-10T11:35:58.336-04:00", "state": "active", "location": null, "email": "kwrobot@kitware.com", "website_url": "", "username": "kwrobot", "bio": "", "last_sign_in_at": "2017-06-05T14:46:29.512-04:00", "last_activity_on": "2017-07-20", "external": false, "name": "Kitware Robot", "can_create_group": true, "created_at": "2015-02-26T10:58:34.670-05:00", "avatar_url": "https://secure.gravatar.com/avatar/9ddcd45fcb89d966aab95b1f1002f84c?s=80&d=identicon", "organization": null}
{"two_factor_enabled": true, "can_create_project": true, "confirmed_at": "2015-02-26T10:58:34.660-05:00", "twitter": "", "linkedin": "", "color_scheme_id": 4, "web_url": "https://gitlab.kitware.com/kwrobot", "skype": "", "is_admin": true, "identities": [], "id": 11, "projects_limit": 50, "current_sign_in_at": "2017-07-10T11:35:58.336-04:00", "state": "active", "location": null, "email": "kwrobot@kitware.com", "website_url": "", "username": "kwrobot", "bio": "", "last_sign_in_at": "2017-06-05T14:46:29.512-04:00", "last_activity_on": "2017-10-10", "external": false, "organization": null, "name": "Kitware Robot", "can_create_group": true, "created_at": "2015-02-26T10:58:34.670-05:00", "avatar_url": "https://secure.gravatar.com/avatar/9ddcd45fcb89d966aab95b1f1002f84c?s=80&d=identicon", "theme_id": null}
......@@ -202,6 +202,10 @@ fn test_read_issue_reference() {
panic!("expected to have an assignee for the issue");
}
assert_eq!(issue.subscribed, None);
assert_eq!(issue.time_stats.time_estimate, 0);
assert_eq!(issue.time_stats.total_time_spent, 0);
assert_eq!(issue.time_stats.human_time_estimate, None);
assert_eq!(issue.time_stats.human_total_time_spent, None);
assert_eq!(issue.user_notes_count, 0);
assert_eq!(issue.upvotes, 0);
assert_eq!(issue.downvotes, 0);
......@@ -279,6 +283,10 @@ fn test_read_merge_request() {
Some(ObjectId::new("04e94ae667024a62a90179f395bfdc2b35f3efd2")));
assert_eq!(merge_request.merge_commit_sha, None);
assert_eq!(merge_request.subscribed, Some(true));
assert_eq!(merge_request.time_stats.time_estimate, 0);
assert_eq!(merge_request.time_stats.total_time_spent, 0);
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.should_remove_source_branch, None);
assert_eq!(merge_request.force_remove_source_branch, Some(true));
......@@ -342,8 +350,8 @@ fn test_read_project() {
Utc.ymd(2016, 6, 29)
.and_hms_milli(17, 35, 12, 495));
assert_eq!(project.last_activity_at,
Utc.ymd(2017, 8, 3)
.and_hms_milli(16, 11, 16, 279));
Utc.ymd(2017, 10, 5)
.and_hms_milli(15, 18, 57, 875));
assert_eq!(project.import_error, None);
assert_eq!(project.shared_runners_enabled, true);
assert_eq!(project.lfs_enabled, true);
......@@ -369,6 +377,7 @@ fn test_read_project() {
assert_eq!(project.printing_merge_request_link_enabled, Some(true));
assert_eq!(project.request_access_enabled, true);
assert_eq!(project.jobs_enabled, false);
assert_eq!(project.resolve_outdated_diff_discussions, None);
assert_eq!(project.issues_enabled, true);
assert_eq!(project.merge_requests_enabled, true);
assert_eq!(project.snippets_enabled, false);
......@@ -536,11 +545,12 @@ fn test_read_user_public() {
Some(Utc.ymd(2017, 6, 5)
.and_hms_milli(18, 46, 29, 512)));
assert_eq!(user_public.last_activity_on,
Some(NaiveDate::from_ymd(2017, 7, 20)));
Some(NaiveDate::from_ymd(2017, 10, 10)));
assert_eq!(user_public.confirmed_at,
Some(Utc.ymd(2015, 2, 26)
.and_hms_milli(15, 58, 34, 660)));
assert_eq!(user_public.email, "kwrobot@kitware.com");
assert_eq!(user_public.theme_id, None);
assert_eq!(user_public.color_scheme_id, ColorSchemeId::new(4));
assert_eq!(user_public.projects_limit, 50);
assert_eq!(user_public.current_sign_in_at,
......
......@@ -198,6 +198,8 @@ pub struct UserPublic {
/// The primary email address for the user.
pub email: String,
/// The theme used by the user, if configured.
pub theme_id: Option<ThemeId>,
/// The color scheme used by the user.
pub color_scheme_id: ColorSchemeId,
/// The number of projects the user may create.
......@@ -575,6 +577,9 @@ pub struct Project {
pub request_access_enabled: bool,
/// Whether jobs are enabled or not.
pub jobs_enabled: bool,
/// Whether to automatically resolve merge request diff discussions when they become outdated,
/// if configured.
pub resolve_outdated_diff_discussions: Option<bool>,
/// Whether issues are enabled or not.
pub issues_enabled: bool,
/// Whether merge requests are enabled or not.
......@@ -1173,6 +1178,8 @@ pub struct Issue {
/// GitLab does not include this in responses with lists of issues but
/// does on an individual issue.
pub subscribed: Option<bool>,
/// Time estimates.
pub time_stats: IssuableTimeStats,
/// The number of comments on the issue.
pub user_notes_count: u64,
/// The number of upvotes for the issue.
......@@ -1202,7 +1209,7 @@ impl Issue {
#[cfg_attr(feature="strict", serde(deny_unknown_fields))]
#[derive(Serialize, Deserialize, Debug, Clone)]
/// A time estimate on an issue or merge request.
pub struct IssuableTimeEstimate {
pub struct IssuableTimeStats {
/// The time estimate, in seconds.
pub time_estimate: u64,
/// The total time spent, in seconds.
......@@ -1367,6 +1374,8 @@ pub struct MergeRequest {
/// GitLab does not include this in responses with lists of merge requests but
/// does on an individual merge request.
pub subscribed: Option<bool>,
/// Time estimates.
pub time_stats: IssuableTimeStats,
/// The number of comments on the merge request.
pub user_notes_count: u64,
/// Whether the merge request should be deleted or not (set by the merger).
......@@ -1434,6 +1443,8 @@ pub struct MergeRequestChanges {
/// GitLab does not include this in responses with lists of merge requests but
/// does on an individual merge request.
pub subscribed: Option<bool>,
/// Time estimates.
pub time_stats: IssuableTimeStats,
/// The number of comments on the merge request.
pub user_notes_count: u64,
/// Whether the merge request should be deleted or not (set by the merger).
......@@ -1473,6 +1484,7 @@ impl From<MergeRequestChanges> for MergeRequest {
sha: mr.sha,
merge_commit_sha: mr.merge_commit_sha,
subscribed: mr.subscribed,
time_stats: mr.time_stats,
user_notes_count: mr.user_notes_count,
should_remove_source_branch: mr.should_remove_source_branch,
force_remove_source_branch: mr.force_remove_source_branch,
......
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