Commit 762625a4 authored by Brad King's avatar Brad King Committed by Kitware Robot
Browse files

Merge topic 'gitlab-11.0'

f29c05b4

 types,systemhooks: Update for 11.0
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Merge-request: !124
parents 95e9acb9 f29c05b4
{"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", "diff_refs": {"start_sha": "981262b03fc0149c1677ca51ea47b570e30d6a90", "base_sha": "981262b03fc0149c1677ca51ea47b570e30d6a90", "head_sha": "04e94ae667024a62a90179f395bfdc2b35f3efd2"}, "description": "Fixes #5.", "iid": 35, "milestone": null, "discussion_locked": null, "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", "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}
{"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, "merge_method": "merge", "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": 7, "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", "parent_id": null, "path": "utils", "id": 498, "full_path": "utils"}, "star_count": 1, "_links": {"repo_branches": "https://gitlab.kitware.com/api/v4/projects/855/repository/branches", "merge_requests": "https://gitlab.kitware.com/api/v4/projects/855/merge_requests", "self": "https://gitlab.kitware.com/api/v4/projects/855", "labels": "https://gitlab.kitware.com/api/v4/projects/855/labels", "members": "https://gitlab.kitware.com/api/v4/projects/855/members", "events": "https://gitlab.kitware.com/api/v4/projects/855/events", "issues": "https://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", "readme_url": "https://gitlab.kitware.com/utils/rust-gitlab/blob/master/README.md", "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": 6, "last_activity_at": "2018-05-31T11:08:12.338-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", "shared_runners_enabled": true, "merge_method": "merge", "creator_id": 13, "avatar_url": null, "permissions": {"group_access": {"notification_level": 3, "access_level": 50}, "project_access": null}, "tag_list": [], "jobs_enabled": false, "public_jobs": true}
......@@ -108,8 +108,8 @@ pub enum HumanAccessLevel {
Reporter,
/// Developer access (can push branches, handle issues and merge requests).
Developer,
/// Master access (can push to protected branches).
Master,
/// Maintainer access (can push to protected branches).
Maintainer,
/// Owner access (full rights).
Owner,
}
......@@ -117,7 +117,7 @@ enum_serialize!(HumanAccessLevel -> "human access level",
Guest => "Guest",
Reporter => "Reporter",
Developer => "Developer",
Master => "Master",
Maintainer => "Maintainer",
Owner => "Owner",
);
......@@ -127,7 +127,7 @@ impl From<HumanAccessLevel> for AccessLevel {
HumanAccessLevel::Guest => AccessLevel::Guest,
HumanAccessLevel::Reporter => AccessLevel::Reporter,
HumanAccessLevel::Developer => AccessLevel::Developer,
HumanAccessLevel::Master => AccessLevel::Master,
HumanAccessLevel::Maintainer => AccessLevel::Maintainer,
HumanAccessLevel::Owner => AccessLevel::Owner,
}
}
......
......@@ -287,8 +287,10 @@ fn test_read_merge_request() {
assert_eq!(merge_request.target_project_id, ProjectId::new(855));
assert!(merge_request.labels.is_empty());
assert_eq!(merge_request.work_in_progress, false);
assert!(merge_request.allow_collaboration.is_none());
assert!(merge_request.allow_maintainer_to_push.is_none());
assert!(merge_request.milestone.is_none());
assert_eq!(merge_request.squash, false);
assert_eq!(merge_request.merge_when_pipeline_succeeds, false);
assert_eq!(merge_request.merge_status, MergeStatus::CanBeMerged);
assert_eq!(merge_request.sha,
......@@ -363,6 +365,8 @@ fn test_read_project() {
"https://gitlab.kitware.com/utils/rust-gitlab.git");
assert_eq!(project.web_url,
"https://gitlab.kitware.com/utils/rust-gitlab");
assert_eq!(project.readme_url,
"https://gitlab.kitware.com/utils/rust-gitlab/blob/master/README.md");
assert!(project.owner.is_none());
assert_eq!(project.name, "rust-gitlab");
assert_eq!(project.name_with_namespace, "Utils / rust-gitlab");
......@@ -373,8 +377,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, 10, 5)
.and_hms_milli(15, 18, 57, 875));
Utc.ymd(2018, 5, 31)
.and_hms_milli(15, 8, 12, 338));
assert_eq!(project.import_error, None);
assert_eq!(project.shared_runners_enabled, true);
assert_eq!(project.lfs_enabled, true);
......@@ -385,13 +389,13 @@ fn test_read_project() {
NamespaceId::Group(GroupId::new(498)));
assert_eq!(project.namespace.kind, NamespaceKind::Group);
assert_eq!(project.namespace.full_path, "utils");
assert_eq!(project.namespace.members_count_with_descendants, Some(3));
assert!(project.namespace.members_count_with_descendants.is_none());
assert!(project.forked_from_project.is_none());
assert_eq!(project.avatar_url, None);
assert_eq!(project.ci_config_path, None);
assert_eq!(project.star_count, 0);
assert_eq!(project.forks_count, 5);
assert_eq!(project.open_issues_count, Some(4));
assert_eq!(project.star_count, 1);
assert_eq!(project.forks_count, 7);
assert_eq!(project.open_issues_count, Some(6));
assert_eq!(project.public_jobs, true);
assert!(project.shared_with_groups.is_empty());
assert_eq!(project.only_allow_merge_if_pipeline_succeeds, Some(false));
......
......@@ -529,6 +529,8 @@ pub struct Project {
pub http_url_to_repo: String,
/// The URL for the project's homepage.
pub web_url: String,
/// The URL for the project's readme.
pub readme_url: String,
/// The owner of the project (`None` for a group-owned project).
pub owner: Option<UserBasic>,
/// The display name of the project.
......@@ -646,8 +648,8 @@ pub enum AccessLevel {
Reporter,
/// Developer access (can push branches, handle issues and merge requests).
Developer,
/// Master access (can push to protected branches).
Master,
/// Maintainer access (can push to protected branches).
Maintainer,
/// Owner access (full rights).
Owner,
}
......@@ -659,7 +661,7 @@ impl From<AccessLevel> for u64 {
AccessLevel::Guest => 10,
AccessLevel::Reporter => 20,
AccessLevel::Developer => 30,
AccessLevel::Master => 40,
AccessLevel::Maintainer => 40,
AccessLevel::Owner => 50,
}
}
......@@ -670,7 +672,7 @@ impl From<u64> for AccessLevel {
if access >= 50 {
AccessLevel::Owner
} else if access >= 40 {
AccessLevel::Master
AccessLevel::Maintainer
} else if access >= 30 {
AccessLevel::Developer
} else if access >= 20 {
......@@ -1319,11 +1321,15 @@ pub enum MergeStatus {
CanBeMerged,
/// The merge request may not be merged yet.
CannotBeMerged,
/// The merge request has not been checked but previously
/// could not be merged.
CannotBeMergedRecheck,
}
enum_serialize!(MergeStatus -> "merge status",
Unchecked => "unchecked",
CanBeMerged => "can_be_merged",
CannotBeMerged => "cannot_be_merged",
CannotBeMergedRecheck => "cannot_be_merged_recheck",
);
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
......@@ -1398,10 +1404,14 @@ pub struct MergeRequest {
pub labels: Vec<String>,
/// Whether the merge request is a work-in-progress or not.
pub work_in_progress: bool,
/// Whether the merge request allows a maintainer to push.
/// Whether the merge request allows a maintainer to collaborate.
pub allow_collaboration: Option<bool>,
/// Whether the merge request allows a maintainer to push (deprecated).
pub allow_maintainer_to_push: Option<bool>,
/// The milestone of the merge request.
pub milestone: Option<Milestone>,
/// Whether to squash commits on merge.
pub squash: bool,
/// Whether the merge request will be merged once all pipelines succeed or not.
pub merge_when_pipeline_succeeds: bool,
/// The status of the merge request.
......@@ -1487,10 +1497,14 @@ pub struct MergeRequestChanges {
pub labels: Vec<String>,
/// Whether the merge request is a work-in-progress or not.
pub work_in_progress: bool,
/// Whether the merge request allows a maintainer to push.
/// Whether the merge request allows a maintainer to collaborate.
pub allow_collaboration: Option<bool>,
/// Whether the merge request allows a maintainer to push (deprecated).
pub allow_maintainer_to_push: Option<bool>,
/// The milestone of the merge request.
pub milestone: Option<Milestone>,
/// Whether to squash commits on merge.
pub squash: bool,
/// Whether the merge request will be merged once all jobs succeed or not.
pub merge_when_pipeline_succeeds: bool,
/// The status of the merge request.
......@@ -1549,8 +1563,10 @@ impl From<MergeRequestChanges> for MergeRequest {
target_project_id: mr.target_project_id,
labels: mr.labels,
work_in_progress: mr.work_in_progress,
allow_collaboration: mr.allow_collaboration,
allow_maintainer_to_push: mr.allow_maintainer_to_push,
milestone: mr.milestone,
squash: mr.squash,
merge_when_pipeline_succeeds: mr.merge_when_pipeline_succeeds,
merge_status: mr.merge_status,
sha: mr.sha,
......
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