Commit 710b0737 authored by Brad King's avatar Brad King
Browse files

types: update for 11.3

Project hooks gained a `push_events_branch_filter` field.
Repository branches gained a `default` field.
parent 751a64b9
{"note_events": true, "job_events": true, "tag_push_events": true, "confidential_note_events": true, "url": "http://kwrobot02:8082/gitlab.kitware.com", "created_at": "2016-12-16T11:37:24.589-05:00", "enable_ssl_verification": true, "confidential_issues_events": true, "pipeline_events": true, "issues_events": true, "push_events": true, "merge_requests_events": true, "project_id": 855, "repository_update_events": false, "id": 1262, "wiki_page_events": true}
{"push_events_branch_filter": null, "note_events": true, "job_events": true, "tag_push_events": true, "confidential_note_events": true, "url": "http://kwrobot02:8082/gitlab.kitware.com", "created_at": "2016-12-16T11:37:24.589-05:00", "enable_ssl_verification": true, "confidential_issues_events": true, "pipeline_events": true, "issues_events": true, "push_events": true, "merge_requests_events": true, "project_id": 855, "repository_update_events": false, "id": 1262, "wiki_page_events": true}
{"name": "master", "developers_can_merge": false, "protected": true, "developers_can_push": false, "can_push": true, "commit": {"committer_email": "brad.king@kitware.com", "short_id": "e59db4b1", "title": "cargo: prep for 0.1100.1", "author_email": "brad.king@kitware.com", "committer_name": "Brad King", "created_at": "2018-07-12T08:50:24.000-04:00", "author_name": "Brad King", "parent_ids": ["5c81cc05661dcbb5fd923cca093920816c21ef7e"], "committed_date": "2018-07-12T08:50:24.000-04:00", "message": "cargo: prep for 0.1100.1\n", "authored_date": "2018-07-12T08:50:24.000-04:00", "id": "e59db4b129b29df220ecec6119ed2130207a0397"}, "merged": false}
{"name": "master", "developers_can_merge": false, "default": true, "protected": true, "developers_can_push": false, "can_push": true, "commit": {"committer_email": "brad.king@kitware.com", "short_id": "e59db4b1", "title": "cargo: prep for 0.1100.1", "author_email": "brad.king@kitware.com", "committer_name": "Brad King", "created_at": "2018-07-12T08:50:24.000-04:00", "author_name": "Brad King", "parent_ids": ["5c81cc05661dcbb5fd923cca093920816c21ef7e"], "committed_date": "2018-07-12T08:50:24.000-04:00", "message": "cargo: prep for 0.1100.1\n", "authored_date": "2018-07-12T08:50:24.000-04:00", "id": "e59db4b129b29df220ecec6119ed2130207a0397"}, "merged": false}
......@@ -434,6 +434,7 @@ fn test_read_project_hook() {
Utc.ymd(2016, 12, 16)
.and_hms_milli(16, 37, 24, 589));
assert_eq!(project_hook.push_events, true);
assert!(project_hook.push_events_branch_filter.is_none());
assert_eq!(project_hook.tag_push_events, true);
assert_eq!(project_hook.issues_events, true);
assert_eq!(project_hook.confidential_issues_events, Some(true));
......@@ -481,6 +482,7 @@ fn test_read_repo_branch() {
assert_eq!(repo_branch.developers_can_push, Some(false));
assert_eq!(repo_branch.developers_can_merge, Some(false));
assert_eq!(repo_branch.can_push, Some(true));
assert_eq!(repo_branch.default, Some(true));
}
#[test]
......
......@@ -314,6 +314,8 @@ pub struct ProjectHook {
pub project_id: ProjectId,
/// Whether the hook is contacted for push events.
pub push_events: bool,
/// Filter branches for which the hook is contacted for push events.
pub push_events_branch_filter: Option<String>,
/// Whether the hook is contacted for tag push events.
pub tag_push_events: bool,
/// Whether the hook is contacted for issue events.
......@@ -884,6 +886,8 @@ pub struct RepoBranch {
pub developers_can_merge: Option<bool>,
/// Whether the current user can push to the branch.
pub can_push: Option<bool>,
/// Whether the branch is the repository default branch.
pub default: Option<bool>,
}
#[cfg_attr(feature="strict", serde(deny_unknown_fields))]
......
Supports Markdown
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