gitlab 4.4.0 → 4.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -2
- data/gitlab.gemspec +3 -1
- data/lib/gitlab/client.rb +1 -0
- data/lib/gitlab/client/merge_request_approvals.rb +110 -0
- data/lib/gitlab/client/projects.rb +19 -9
- data/lib/gitlab/error.rb +10 -3
- data/lib/gitlab/version.rb +1 -1
- metadata +5 -444
- data/.dockerignore +0 -6
- data/.rubocop.yml +0 -33
- data/.travis.yml +0 -13
- data/Dockerfile +0 -8
- data/docker-compose.yml +0 -19
- data/docker.env +0 -2
- data/spec/fixtures/access_request.json +0 -8
- data/spec/fixtures/access_requests.json +0 -18
- data/spec/fixtures/approved_access_request.json +0 -8
- data/spec/fixtures/board_list.json +0 -1
- data/spec/fixtures/board_lists.json +0 -1
- data/spec/fixtures/boards.json +0 -1
- data/spec/fixtures/branch.json +0 -1
- data/spec/fixtures/branch_delete.json +0 -3
- data/spec/fixtures/branches.json +0 -1
- data/spec/fixtures/build.json +0 -38
- data/spec/fixtures/build_artifacts.json +0 -0
- data/spec/fixtures/build_cancel.json +0 -24
- data/spec/fixtures/build_erase.json +0 -24
- data/spec/fixtures/build_retry.json +0 -24
- data/spec/fixtures/builds.json +0 -78
- data/spec/fixtures/builds_commits.json +0 -64
- data/spec/fixtures/compare_merge_request_diff.json +0 -31
- data/spec/fixtures/default_approved_access_request.json +0 -8
- data/spec/fixtures/deployment.json +0 -57
- data/spec/fixtures/deployments.json +0 -116
- data/spec/fixtures/empty.json +0 -0
- data/spec/fixtures/environment.json +0 -6
- data/spec/fixtures/environments.json +0 -14
- data/spec/fixtures/error_already_exists.json +0 -1
- data/spec/fixtures/error_project_not_found.json +0 -1
- data/spec/fixtures/get_repository_file.json +0 -1
- data/spec/fixtures/group.json +0 -60
- data/spec/fixtures/group_create.json +0 -1
- data/spec/fixtures/group_create_with_description.json +0 -1
- data/spec/fixtures/group_delete.json +0 -1
- data/spec/fixtures/group_edit.json +0 -14
- data/spec/fixtures/group_member.json +0 -1
- data/spec/fixtures/group_member_delete.json +0 -1
- data/spec/fixtures/group_member_edit.json +0 -1
- data/spec/fixtures/group_members.json +0 -1
- data/spec/fixtures/group_milestone.json +0 -1
- data/spec/fixtures/group_milestone_issues.json +0 -1
- data/spec/fixtures/group_milestone_merge_requests.json +0 -1
- data/spec/fixtures/group_milestones.json +0 -1
- data/spec/fixtures/group_projects.json +0 -44
- data/spec/fixtures/group_search.json +0 -2
- data/spec/fixtures/group_subgroups.json +0 -16
- data/spec/fixtures/groups.json +0 -2
- data/spec/fixtures/issue.json +0 -1
- data/spec/fixtures/issue_award_emoji.json +0 -16
- data/spec/fixtures/issue_award_emojis.json +0 -34
- data/spec/fixtures/issues.json +0 -1
- data/spec/fixtures/job.json +0 -43
- data/spec/fixtures/job_trace.json +0 -1
- data/spec/fixtures/jobs.json +0 -91
- data/spec/fixtures/key.json +0 -1
- data/spec/fixtures/keys.json +0 -1
- data/spec/fixtures/label.json +0 -1
- data/spec/fixtures/label_unsubscribe.json +0 -1
- data/spec/fixtures/labels.json +0 -1
- data/spec/fixtures/merge_request.json +0 -1
- data/spec/fixtures/merge_request_award_emoji.json +0 -16
- data/spec/fixtures/merge_request_award_emojis.json +0 -34
- data/spec/fixtures/merge_request_changes.json +0 -1
- data/spec/fixtures/merge_request_closes_issues.json +0 -1
- data/spec/fixtures/merge_request_comment.json +0 -1
- data/spec/fixtures/merge_request_comments.json +0 -1
- data/spec/fixtures/merge_request_commits.json +0 -1
- data/spec/fixtures/merge_request_discussion.json +0 -39
- data/spec/fixtures/merge_request_discussion_note.json +0 -33
- data/spec/fixtures/merge_request_discussions.json +0 -41
- data/spec/fixtures/merge_requests.json +0 -1
- data/spec/fixtures/milestone.json +0 -1
- data/spec/fixtures/milestone_issues.json +0 -1
- data/spec/fixtures/milestone_merge_requests.json +0 -1
- data/spec/fixtures/milestones.json +0 -1
- data/spec/fixtures/namespaces.json +0 -1
- data/spec/fixtures/note.json +0 -1
- data/spec/fixtures/note_award_emoji.json +0 -16
- data/spec/fixtures/note_award_emojis.json +0 -18
- data/spec/fixtures/notes.json +0 -1
- data/spec/fixtures/pipeline.json +0 -23
- data/spec/fixtures/pipeline_cancel.json +0 -23
- data/spec/fixtures/pipeline_create.json +0 -23
- data/spec/fixtures/pipeline_jobs.json +0 -91
- data/spec/fixtures/pipeline_retry.json +0 -23
- data/spec/fixtures/pipeline_schedule.json +0 -32
- data/spec/fixtures/pipeline_schedule_create.json +0 -21
- data/spec/fixtures/pipeline_schedule_update.json +0 -26
- data/spec/fixtures/pipeline_schedule_variable.json +0 -5
- data/spec/fixtures/pipeline_schedule_variable_update.json +0 -5
- data/spec/fixtures/pipeline_schedules.json +0 -22
- data/spec/fixtures/pipelines.json +0 -48
- data/spec/fixtures/project.json +0 -1
- data/spec/fixtures/project_commit.json +0 -13
- data/spec/fixtures/project_commit_comment.json +0 -1
- data/spec/fixtures/project_commit_comments.json +0 -1
- data/spec/fixtures/project_commit_create.json +0 -22
- data/spec/fixtures/project_commit_diff.json +0 -10
- data/spec/fixtures/project_commit_merge_requests.json +0 -1
- data/spec/fixtures/project_commit_status.json +0 -42
- data/spec/fixtures/project_commits.json +0 -1
- data/spec/fixtures/project_edit.json +0 -21
- data/spec/fixtures/project_events.json +0 -81
- data/spec/fixtures/project_for_user.json +0 -1
- data/spec/fixtures/project_fork.json +0 -50
- data/spec/fixtures/project_fork_link.json +0 -1
- data/spec/fixtures/project_forked_for_user.json +0 -50
- data/spec/fixtures/project_forks.json +0 -50
- data/spec/fixtures/project_hook.json +0 -1
- data/spec/fixtures/project_hooks.json +0 -1
- data/spec/fixtures/project_issues.json +0 -1
- data/spec/fixtures/project_key.json +0 -6
- data/spec/fixtures/project_keys.json +0 -6
- data/spec/fixtures/project_runner_enable.json +0 -7
- data/spec/fixtures/project_runners.json +0 -16
- data/spec/fixtures/project_search.json +0 -1
- data/spec/fixtures/project_star.json +0 -44
- data/spec/fixtures/project_tag_annotated.json +0 -1
- data/spec/fixtures/project_tag_lightweight.json +0 -1
- data/spec/fixtures/project_tags.json +0 -1
- data/spec/fixtures/project_unstar.json +0 -44
- data/spec/fixtures/project_update_commit_status.json +0 -20
- data/spec/fixtures/projects.json +0 -1
- data/spec/fixtures/push_rule.json +0 -1
- data/spec/fixtures/raw_file.json +0 -2
- data/spec/fixtures/release_create.json +0 -1
- data/spec/fixtures/release_update.json +0 -1
- data/spec/fixtures/repository_file.json +0 -1
- data/spec/fixtures/run_trigger.json +0 -1
- data/spec/fixtures/runner.json +0 -26
- data/spec/fixtures/runner_delete.json +0 -7
- data/spec/fixtures/runner_edit.json +0 -26
- data/spec/fixtures/runner_jobs.json +0 -63
- data/spec/fixtures/runners.json +0 -16
- data/spec/fixtures/runners_all.json +0 -30
- data/spec/fixtures/service.json +0 -1
- data/spec/fixtures/session.json +0 -1
- data/spec/fixtures/shell_history.json +0 -2
- data/spec/fixtures/sidekiq_compound_metrics.json +0 -36
- data/spec/fixtures/sidekiq_job_stats.json +0 -7
- data/spec/fixtures/sidekiq_process_metrics.json +0 -25
- data/spec/fixtures/sidekiq_queue_metrics.json +0 -8
- data/spec/fixtures/snippet.json +0 -1
- data/spec/fixtures/snippet_award_emoji.json +0 -16
- data/spec/fixtures/snippet_award_emojis.json +0 -34
- data/spec/fixtures/snippet_content.json +0 -3
- data/spec/fixtures/snippets.json +0 -1
- data/spec/fixtures/system_hook.json +0 -1
- data/spec/fixtures/system_hooks.json +0 -1
- data/spec/fixtures/tag.json +0 -1
- data/spec/fixtures/tag_create.json +0 -1
- data/spec/fixtures/tag_create_with_description.json +0 -1
- data/spec/fixtures/tag_delete.json +0 -1
- data/spec/fixtures/tags.json +0 -1
- data/spec/fixtures/team_member.json +0 -1
- data/spec/fixtures/team_members.json +0 -1
- data/spec/fixtures/todo.json +0 -73
- data/spec/fixtures/todos.json +0 -148
- data/spec/fixtures/tree.json +0 -1
- data/spec/fixtures/trigger.json +0 -10
- data/spec/fixtures/triggers.json +0 -12
- data/spec/fixtures/user.json +0 -1
- data/spec/fixtures/user_block_unblock.json +0 -1
- data/spec/fixtures/user_contribution_events.json +0 -101
- data/spec/fixtures/user_email.json +0 -1
- data/spec/fixtures/user_emails.json +0 -1
- data/spec/fixtures/user_events.json +0 -40
- data/spec/fixtures/user_projects.json +0 -153
- data/spec/fixtures/user_search.json +0 -1
- data/spec/fixtures/users.json +0 -1
- data/spec/fixtures/variable.json +0 -4
- data/spec/fixtures/variables.json +0 -10
- data/spec/gitlab/api_spec.rb +0 -11
- data/spec/gitlab/cli_helpers_spec.rb +0 -56
- data/spec/gitlab/cli_spec.rb +0 -119
- data/spec/gitlab/client/access_requests_spec.rb +0 -141
- data/spec/gitlab/client/award_emojis_spec.rb +0 -391
- data/spec/gitlab/client/boards_spec.rb +0 -94
- data/spec/gitlab/client/branches_spec.rb +0 -118
- data/spec/gitlab/client/build_variables_spec.rb +0 -169
- data/spec/gitlab/client/builds_spec.rb +0 -148
- data/spec/gitlab/client/client_spec.rb +0 -11
- data/spec/gitlab/client/commits_spec.rb +0 -190
- data/spec/gitlab/client/deployments_spec.rb +0 -38
- data/spec/gitlab/client/environments_spec.rb +0 -132
- data/spec/gitlab/client/events_spec.rb +0 -48
- data/spec/gitlab/client/group_milestones_spec.rb +0 -98
- data/spec/gitlab/client/groups_spec.rb +0 -246
- data/spec/gitlab/client/issues_spec.rb +0 -285
- data/spec/gitlab/client/jobs_spec.rb +0 -135
- data/spec/gitlab/client/keys_spec.rb +0 -19
- data/spec/gitlab/client/labels_spec.rb +0 -100
- data/spec/gitlab/client/merge_requests_spec.rb +0 -351
- data/spec/gitlab/client/milestones_spec.rb +0 -98
- data/spec/gitlab/client/namespaces_spec.rb +0 -22
- data/spec/gitlab/client/notes_spec.rb +0 -333
- data/spec/gitlab/client/pipeline_schedules_spec.rb +0 -158
- data/spec/gitlab/client/pipeline_triggers_spec.rb +0 -157
- data/spec/gitlab/client/pipelines_spec.rb +0 -95
- data/spec/gitlab/client/projects_spec.rb +0 -630
- data/spec/gitlab/client/repositories_spec.rb +0 -94
- data/spec/gitlab/client/repository_files_spec.rb +0 -95
- data/spec/gitlab/client/runners_spec.rb +0 -193
- data/spec/gitlab/client/services_spec.rb +0 -55
- data/spec/gitlab/client/sidekiq_spec.rb +0 -64
- data/spec/gitlab/client/snippets_spec.rb +0 -100
- data/spec/gitlab/client/system_hooks_spec.rb +0 -69
- data/spec/gitlab/client/tags_spec.rb +0 -152
- data/spec/gitlab/client/todos_spec.rb +0 -45
- data/spec/gitlab/client/users_spec.rb +0 -418
- data/spec/gitlab/error_spec.rb +0 -72
- data/spec/gitlab/file_response_spec.rb +0 -33
- data/spec/gitlab/help_spec.rb +0 -46
- data/spec/gitlab/objectified_hash_spec.rb +0 -48
- data/spec/gitlab/page_links_spec.rb +0 -16
- data/spec/gitlab/paginated_response_spec.rb +0 -60
- data/spec/gitlab/request_spec.rb +0 -73
- data/spec/gitlab/shell_history_spec.rb +0 -53
- data/spec/gitlab/shell_spec.rb +0 -80
- data/spec/gitlab_spec.rb +0 -96
- data/spec/spec_helper.rb +0 -39
data/spec/fixtures/tree.json
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
[{"id":"a2cc3b0ffc1c7d06fab5642eb99ea387b57f22f8","name":"app","type":"tree","mode":"040000"},{"id":"63164bdfbc11b69f1032fbe35da0f1e9c18af2fd","name":"bin","type":"tree","mode":"040000"},{"id":"2cf682191722f20f00a371d7da58f6a35701c11d","name":"config","type":"tree","mode":"040000"},{"id":"2e76c8c1bbc46bcc762788a432d802d65a534a28","name":"db","type":"tree","mode":"040000"},{"id":"767cfc8360b50c50bb5bdde288b96a84e3efa66e","name":"doc","type":"tree","mode":"040000"},{"id":"3fa0d1024f5e372bf9e43d1dac47bd1e95ab0858","name":"lib","type":"tree","mode":"040000"},{"id":"4e79d0ac6225844602a1b9273b26d8996f777bf2","name":"log","type":"tree","mode":"040000"},{"id":"7cb7f593c6914d20fa6cc4ab5a7c34337a50e97c","name":"public","type":"tree","mode":"040000"},{"id":"d97169eef778f3cd1d4d94cbe3415b3166d15c71","name":"spec","type":"tree","mode":"040000"},{"id":"97c97da29fa97e2158cfdcdcb042af9da0bc3de4","name":"vendor","type":"tree","mode":"040000"},{"id":"d316760e4746059c117007507594a1d75b47df38","name":".gitignore","type":"blob","mode":"100644"},{"id":"f2e7cd477536f18d8e939faf452930b59a27063d","name":".travis.yml","type":"blob","mode":"100644"},{"id":"d5c68bda5f0fe703a80906f66cfe537ca807a5a6","name":"Capfile","type":"blob","mode":"100644"},{"id":"8f46eac03c6cd7ce03cda7ec3d78afdc6971e4c0","name":"Gemfile","type":"blob","mode":"100644"},{"id":"5e260573173b51eaa073661d7914fb0e935ee27f","name":"Gemfile.lock","type":"blob","mode":"100644"},{"id":"e57032f682b69f14243c09d66a0892a03b4c6045","name":"Procfile","type":"blob","mode":"100644"},{"id":"905e96da839dad683dfcf4e202bf1e030390b964","name":"README.md","type":"blob","mode":"100644"},{"id":"24a16769fd94926350a59f7b1cbd78e9e2674c57","name":"Rakefile","type":"blob","mode":"100644"},{"id":"b384d6d57c6a775a9b6bc35d79ad7f03e673a233","name":"config.ru","type":"blob","mode":"100644"}]
|
data/spec/fixtures/trigger.json
DELETED
data/spec/fixtures/triggers.json
DELETED
data/spec/fixtures/user.json
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"id":1,"email":"john@example.com","name":"John Smith","username":"john.smith","bio":null,"skype":"","linkedin":"","twitter":"john","dark_scheme":false,"theme_id":1,"blocked":false,"created_at":"2012-09-17T09:41:56Z"}
|
@@ -1 +0,0 @@
|
|
1
|
-
true
|
@@ -1,101 +0,0 @@
|
|
1
|
-
[
|
2
|
-
{
|
3
|
-
"title": null,
|
4
|
-
"project_id": 15,
|
5
|
-
"action_name": "closed",
|
6
|
-
"target_id": 830,
|
7
|
-
"target_type": "Issue",
|
8
|
-
"author_id": 1,
|
9
|
-
"target_title": "Public project search field",
|
10
|
-
"author": {
|
11
|
-
"name": "Dmitriy Zaporozhets",
|
12
|
-
"username": "root",
|
13
|
-
"id": 1,
|
14
|
-
"state": "active",
|
15
|
-
"avatar_url": "http://localhost:3000/uploads/user/avatar/1/fox_avatar.png",
|
16
|
-
"web_url": "http://localhost:3000/root"
|
17
|
-
},
|
18
|
-
"author_username": "root"
|
19
|
-
},
|
20
|
-
{
|
21
|
-
"title": null,
|
22
|
-
"project_id": 15,
|
23
|
-
"action_name": "pushed",
|
24
|
-
"target_id": null,
|
25
|
-
"target_type": null,
|
26
|
-
"author_id": 1,
|
27
|
-
"author": {
|
28
|
-
"name": "Dmitriy Zaporozhets",
|
29
|
-
"username": "root",
|
30
|
-
"id": 1,
|
31
|
-
"state": "active",
|
32
|
-
"avatar_url": "http://localhost:3000/uploads/user/avatar/1/fox_avatar.png",
|
33
|
-
"web_url": "http://localhost:3000/root"
|
34
|
-
},
|
35
|
-
"author_username": "john",
|
36
|
-
"push_data": {
|
37
|
-
"commit_count": 1,
|
38
|
-
"action": "pushed",
|
39
|
-
"ref_type": "branch",
|
40
|
-
"commit_from": "50d4420237a9de7be1304607147aec22e4a14af7",
|
41
|
-
"commit_to": "c5feabde2d8cd023215af4d2ceeb7a64839fc428",
|
42
|
-
"ref": "master",
|
43
|
-
"commit_title": "Add simple search to projects in public area"
|
44
|
-
},
|
45
|
-
"target_title": null
|
46
|
-
},
|
47
|
-
{
|
48
|
-
"title": null,
|
49
|
-
"project_id": 15,
|
50
|
-
"action_name": "closed",
|
51
|
-
"target_id": 840,
|
52
|
-
"target_type": "Issue",
|
53
|
-
"author_id": 1,
|
54
|
-
"target_title": "Finish & merge Code search PR",
|
55
|
-
"author": {
|
56
|
-
"name": "Dmitriy Zaporozhets",
|
57
|
-
"username": "root",
|
58
|
-
"id": 1,
|
59
|
-
"state": "active",
|
60
|
-
"avatar_url": "http://localhost:3000/uploads/user/avatar/1/fox_avatar.png",
|
61
|
-
"web_url": "http://localhost:3000/root"
|
62
|
-
},
|
63
|
-
"author_username": "root"
|
64
|
-
},
|
65
|
-
{
|
66
|
-
"title": null,
|
67
|
-
"project_id": 15,
|
68
|
-
"action_name": "commented on",
|
69
|
-
"target_id": 1312,
|
70
|
-
"target_type": "Note",
|
71
|
-
"author_id": 1,
|
72
|
-
"target_title": null,
|
73
|
-
"created_at": "2015-12-04T10:33:58.089Z",
|
74
|
-
"note": {
|
75
|
-
"id": 1312,
|
76
|
-
"body": "What an awesome day!",
|
77
|
-
"attachment": null,
|
78
|
-
"author": {
|
79
|
-
"name": "Dmitriy Zaporozhets",
|
80
|
-
"username": "root",
|
81
|
-
"id": 1,
|
82
|
-
"state": "active",
|
83
|
-
"avatar_url": "http://localhost:3000/uploads/user/avatar/1/fox_avatar.png",
|
84
|
-
"web_url": "http://localhost:3000/root"
|
85
|
-
},
|
86
|
-
"created_at": "2015-12-04T10:33:56.698Z",
|
87
|
-
"system": false,
|
88
|
-
"noteable_id": 377,
|
89
|
-
"noteable_type": "Issue"
|
90
|
-
},
|
91
|
-
"author": {
|
92
|
-
"name": "Dmitriy Zaporozhets",
|
93
|
-
"username": "root",
|
94
|
-
"id": 1,
|
95
|
-
"state": "active",
|
96
|
-
"avatar_url": "http://localhost:3000/uploads/user/avatar/1/fox_avatar.png",
|
97
|
-
"web_url": "http://localhost:3000/root"
|
98
|
-
},
|
99
|
-
"author_username": "root"
|
100
|
-
}
|
101
|
-
]
|
@@ -1 +0,0 @@
|
|
1
|
-
{"id":1,"email":"email@example.com"}
|
@@ -1 +0,0 @@
|
|
1
|
-
[{"id":1,"email":"email@example.com"},{"id":3,"email":"email2@example.com"}]
|
@@ -1,40 +0,0 @@
|
|
1
|
-
[
|
2
|
-
{
|
3
|
-
"title":null,
|
4
|
-
"project_id":1,
|
5
|
-
"action_name":"opened",
|
6
|
-
"target_id":160,
|
7
|
-
"target_type":"Issue",
|
8
|
-
"author_id":25,
|
9
|
-
"target_title":"Qui natus eos odio tempore et quaerat consequuntur ducimus cupiditate quis.",
|
10
|
-
"created_at":"2017-02-09T10:43:19.667Z",
|
11
|
-
"author":{
|
12
|
-
"name":"User 3",
|
13
|
-
"username":"user3",
|
14
|
-
"id":25,
|
15
|
-
"state":"active",
|
16
|
-
"avatar_url":"http://www.gravatar.com/avatar/97d6d9441ff85fdc730e02a6068d267b?s=80\u0026d=identicon",
|
17
|
-
"web_url":"https://gitlab.example.com/user3"
|
18
|
-
},
|
19
|
-
"author_username":"user3"
|
20
|
-
},
|
21
|
-
{
|
22
|
-
"title":null,
|
23
|
-
"project_id":1,
|
24
|
-
"action_name":"opened",
|
25
|
-
"target_id":159,
|
26
|
-
"target_type":"Issue",
|
27
|
-
"author_id":21,
|
28
|
-
"target_title":"Nostrum enim non et sed optio illo deleniti non.",
|
29
|
-
"created_at":"2017-02-09T10:43:19.426Z",
|
30
|
-
"author":{
|
31
|
-
"name":"Test User",
|
32
|
-
"username":"ted",
|
33
|
-
"id":21,
|
34
|
-
"state":"active",
|
35
|
-
"avatar_url":"http://www.gravatar.com/avatar/80fb888c9a48b9a3f87477214acaa63f?s=80\u0026d=identicon",
|
36
|
-
"web_url":"https://gitlab.example.com/ted"
|
37
|
-
},
|
38
|
-
"author_username":"ted"
|
39
|
-
}
|
40
|
-
]
|
@@ -1,153 +0,0 @@
|
|
1
|
-
[
|
2
|
-
{
|
3
|
-
"id": 1,
|
4
|
-
"description": null,
|
5
|
-
"default_branch": "master",
|
6
|
-
"visibility": "private",
|
7
|
-
"ssh_url_to_repo": "git@example.com:diaspora/diaspora-client.git",
|
8
|
-
"http_url_to_repo": "http://example.com/diaspora/diaspora-client.git",
|
9
|
-
"web_url": "http://example.com/diaspora/diaspora-client",
|
10
|
-
"tag_list": [
|
11
|
-
"example",
|
12
|
-
"disapora client"
|
13
|
-
],
|
14
|
-
"owner": {
|
15
|
-
"id": 1,
|
16
|
-
"name": "Diaspora",
|
17
|
-
"created_at": "2013-09-30T13:46:02Z"
|
18
|
-
},
|
19
|
-
"name": "Diaspora Client",
|
20
|
-
"name_with_namespace": "Diaspora / Diaspora Client",
|
21
|
-
"path": "diaspora-client",
|
22
|
-
"path_with_namespace": "diaspora/diaspora-client",
|
23
|
-
"issues_enabled": true,
|
24
|
-
"open_issues_count": 1,
|
25
|
-
"merge_requests_enabled": true,
|
26
|
-
"jobs_enabled": true,
|
27
|
-
"wiki_enabled": true,
|
28
|
-
"snippets_enabled": false,
|
29
|
-
"resolve_outdated_diff_discussions": false,
|
30
|
-
"container_registry_enabled": false,
|
31
|
-
"created_at": "2013-09-30T13:46:02Z",
|
32
|
-
"last_activity_at": "2013-09-30T13:46:02Z",
|
33
|
-
"creator_id": 3,
|
34
|
-
"namespace": {
|
35
|
-
"id": 3,
|
36
|
-
"name": "Diaspora",
|
37
|
-
"path": "diaspora",
|
38
|
-
"kind": "group",
|
39
|
-
"full_path": "diaspora"
|
40
|
-
},
|
41
|
-
"import_status": "none",
|
42
|
-
"archived": false,
|
43
|
-
"avatar_url": "http://example.com/uploads/project/avatar/4/uploads/avatar.png",
|
44
|
-
"shared_runners_enabled": true,
|
45
|
-
"forks_count": 0,
|
46
|
-
"star_count": 0,
|
47
|
-
"runners_token": "b8547b1dc37721d05889db52fa2f02",
|
48
|
-
"public_jobs": true,
|
49
|
-
"shared_with_groups": [
|
50
|
-
|
51
|
-
],
|
52
|
-
"only_allow_merge_if_pipeline_succeeds": false,
|
53
|
-
"only_allow_merge_if_all_discussions_are_resolved": false,
|
54
|
-
"request_access_enabled": false,
|
55
|
-
"statistics": {
|
56
|
-
"commit_count": 37,
|
57
|
-
"storage_size": 1038090,
|
58
|
-
"repository_size": 1038090,
|
59
|
-
"lfs_objects_size": 0,
|
60
|
-
"job_artifacts_size": 0
|
61
|
-
},
|
62
|
-
"_links": {
|
63
|
-
"self": "http://example.com/api/v4/projects",
|
64
|
-
"issues": "http://example.com/api/v4/projects/1/issues",
|
65
|
-
"merge_requests": "http://example.com/api/v4/projects/1/merge_requests",
|
66
|
-
"repo_branches": "http://example.com/api/v4/projects/1/repository_branches",
|
67
|
-
"labels": "http://example.com/api/v4/projects/1/labels",
|
68
|
-
"events": "http://example.com/api/v4/projects/1/events",
|
69
|
-
"members": "http://example.com/api/v4/projects/1/members"
|
70
|
-
}
|
71
|
-
},
|
72
|
-
{
|
73
|
-
"id": 6,
|
74
|
-
"description": null,
|
75
|
-
"default_branch": "master",
|
76
|
-
"visibility": "private",
|
77
|
-
"ssh_url_to_repo": "git@example.com:brightbox/puppet.git",
|
78
|
-
"http_url_to_repo": "http://example.com/brightbox/puppet.git",
|
79
|
-
"web_url": "http://example.com/brightbox/puppet",
|
80
|
-
"tag_list": [
|
81
|
-
"example",
|
82
|
-
"puppet"
|
83
|
-
],
|
84
|
-
"owner": {
|
85
|
-
"id": 1,
|
86
|
-
"name": "Brightbox",
|
87
|
-
"created_at": "2013-09-30T13:46:02Z"
|
88
|
-
},
|
89
|
-
"name": "Puppet",
|
90
|
-
"name_with_namespace": "Brightbox / Puppet",
|
91
|
-
"path": "puppet",
|
92
|
-
"path_with_namespace": "brightbox/puppet",
|
93
|
-
"issues_enabled": true,
|
94
|
-
"open_issues_count": 1,
|
95
|
-
"merge_requests_enabled": true,
|
96
|
-
"jobs_enabled": true,
|
97
|
-
"wiki_enabled": true,
|
98
|
-
"snippets_enabled": false,
|
99
|
-
"resolve_outdated_diff_discussions": false,
|
100
|
-
"container_registry_enabled": false,
|
101
|
-
"created_at": "2013-09-30T13:46:02Z",
|
102
|
-
"last_activity_at": "2013-09-30T13:46:02Z",
|
103
|
-
"creator_id": 3,
|
104
|
-
"namespace": {
|
105
|
-
"id": 4,
|
106
|
-
"name": "Brightbox",
|
107
|
-
"path": "brightbox",
|
108
|
-
"kind": "group",
|
109
|
-
"full_path": "brightbox"
|
110
|
-
},
|
111
|
-
"import_status": "none",
|
112
|
-
"import_error": null,
|
113
|
-
"permissions": {
|
114
|
-
"project_access": {
|
115
|
-
"access_level": 10,
|
116
|
-
"notification_level": 3
|
117
|
-
},
|
118
|
-
"group_access": {
|
119
|
-
"access_level": 50,
|
120
|
-
"notification_level": 3
|
121
|
-
}
|
122
|
-
},
|
123
|
-
"archived": false,
|
124
|
-
"avatar_url": null,
|
125
|
-
"shared_runners_enabled": true,
|
126
|
-
"forks_count": 0,
|
127
|
-
"star_count": 0,
|
128
|
-
"runners_token": "b8547b1dc37721d05889db52fa2f02",
|
129
|
-
"public_jobs": true,
|
130
|
-
"shared_with_groups": [
|
131
|
-
|
132
|
-
],
|
133
|
-
"only_allow_merge_if_pipeline_succeeds": false,
|
134
|
-
"only_allow_merge_if_all_discussions_are_resolved": false,
|
135
|
-
"request_access_enabled": false,
|
136
|
-
"statistics": {
|
137
|
-
"commit_count": 12,
|
138
|
-
"storage_size": 2066080,
|
139
|
-
"repository_size": 2066080,
|
140
|
-
"lfs_objects_size": 0,
|
141
|
-
"job_artifacts_size": 0
|
142
|
-
},
|
143
|
-
"_links": {
|
144
|
-
"self": "http://example.com/api/v4/projects",
|
145
|
-
"issues": "http://example.com/api/v4/projects/1/issues",
|
146
|
-
"merge_requests": "http://example.com/api/v4/projects/1/merge_requests",
|
147
|
-
"repo_branches": "http://example.com/api/v4/projects/1/repository_branches",
|
148
|
-
"labels": "http://example.com/api/v4/projects/1/labels",
|
149
|
-
"events": "http://example.com/api/v4/projects/1/events",
|
150
|
-
"members": "http://example.com/api/v4/projects/1/members"
|
151
|
-
}
|
152
|
-
}
|
153
|
-
]
|
@@ -1 +0,0 @@
|
|
1
|
-
[{"id":1,"email":"john1@example.com","name":"John Smith 1","username":"john.smith1","bio":null,"skype":"","linkedin":"","twitter":"john1","dark_scheme":false,"theme_id":1,"blocked":false,"created_at":"2012-09-17T09:41:56Z"},{"id":2,"email":"john2@example.com","name":"John Smith 2","username":"john.smith2","bio":null,"skype":"","linkedin":"","twitter":"john2","dark_scheme":false,"theme_id":1,"blocked":false,"created_at":"2012-09-17T09:42:56Z"}]
|
data/spec/fixtures/users.json
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
[{"id":1,"email":"john@example.com","name":"John Smith","username":"john.smith","bio":null,"skype":"","linkedin":"","twitter":"john","dark_scheme":false,"theme_id":1,"blocked":false,"created_at":"2012-09-17T09:41:56Z"},{"id":2,"email":"jack@example.com","name":"Jack Smith","username":"jack.smith","bio":null,"skype":"","linkedin":"","twitter":"","dark_scheme":false,"theme_id":1,"blocked":false,"created_at":"2012-09-17T09:42:03Z"},{"id":3,"email":"wilma@mayerblanda.ca","name":"Beatrice Jewess","username":"beatrice.jewess","bio":null,"skype":"","linkedin":"","twitter":"","dark_scheme":false,"theme_id":1,"blocked":false,"created_at":"2012-09-17T09:42:03Z"},{"id":4,"email":"nicole@mertz.com","name":"Felipe Davis","username":"felipe.davis","bio":null,"skype":"","linkedin":"","twitter":"","dark_scheme":false,"theme_id":1,"blocked":false,"created_at":"2012-09-17T09:42:03Z"},{"id":5,"email":"aliza_stark@schmeler.info","name":"Michale Von","username":"michale.von","bio":null,"skype":"","linkedin":"","twitter":"","dark_scheme":false,"theme_id":1,"blocked":false,"created_at":"2012-09-17T09:42:03Z"},{"id":6,"email":"faye.watsica@rohanwalter.com","name":"Ambrose Hansen","username":"ambrose.hansen","bio":null,"skype":"","linkedin":"","twitter":"","dark_scheme":false,"theme_id":1,"blocked":false,"created_at":"2012-09-17T09:42:03Z"},{"id":7,"email":"maida@walshtorp.name","name":"Alana Hahn","username":"alana.hahn","bio":null,"skype":"","linkedin":"","twitter":"","dark_scheme":false,"theme_id":1,"blocked":false,"created_at":"2012-09-17T09:42:03Z"}]
|
data/spec/fixtures/variable.json
DELETED
data/spec/gitlab/api_spec.rb
DELETED
@@ -1,11 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe Gitlab::API do
|
4
|
-
let(:default_headers) { subject.class.default_options[:headers] }
|
5
|
-
|
6
|
-
describe ".default_options[:headers]" do
|
7
|
-
it "has 'User-Agent'" do
|
8
|
-
expect(default_headers).to include('User-Agent' => Gitlab::Configuration::DEFAULT_USER_AGENT)
|
9
|
-
end
|
10
|
-
end
|
11
|
-
end
|
@@ -1,56 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe Gitlab::CLI::Helpers do
|
4
|
-
describe ".method_owners" do
|
5
|
-
let(:methods) { Gitlab::CLI::Helpers.method_owners }
|
6
|
-
|
7
|
-
it "returns Array of Hashes containing method names and owners" do
|
8
|
-
expect(methods).to be_a Array
|
9
|
-
expect(methods.all? { |m| m.is_a? Hash }).to be true
|
10
|
-
expect(methods.all? { |m| m.keys.sort == %i(name owner) }).to be true
|
11
|
-
end
|
12
|
-
end
|
13
|
-
|
14
|
-
describe ".valid_command?" do
|
15
|
-
it "returns true when command is valid" do
|
16
|
-
expect(Gitlab::CLI::Helpers.valid_command?('merge_requests')).to be_truthy
|
17
|
-
end
|
18
|
-
it "returns false when command is NOT valid" do
|
19
|
-
expect(Gitlab::CLI::Helpers.valid_command?('mmmmmerge_requests')).to be_falsy
|
20
|
-
end
|
21
|
-
end
|
22
|
-
|
23
|
-
describe ".symbolize_keys" do
|
24
|
-
context "when input is a Hash" do
|
25
|
-
it "returns a Hash with symbols for keys" do
|
26
|
-
hash = { 'key1' => 'val1', 'key2' => 'val2' }
|
27
|
-
symbolized_hash = Gitlab::CLI::Helpers.symbolize_keys(hash)
|
28
|
-
expect(symbolized_hash).to eq(key1: 'val1', key2: 'val2')
|
29
|
-
end
|
30
|
-
end
|
31
|
-
context "when input is NOT a Hash" do
|
32
|
-
it "returns input untouched" do
|
33
|
-
array = [1, 2, 3]
|
34
|
-
new_array = Gitlab::CLI::Helpers.symbolize_keys(array)
|
35
|
-
expect(new_array).to eq([1, 2, 3])
|
36
|
-
end
|
37
|
-
end
|
38
|
-
end
|
39
|
-
|
40
|
-
describe ".yaml_load" do
|
41
|
-
context "when argument is a YAML string" do
|
42
|
-
it "returns Ruby objects" do
|
43
|
-
argument = "{foo: bar, sna: fu}"
|
44
|
-
output = Gitlab::CLI::Helpers.yaml_load argument
|
45
|
-
expect(output).to eq('foo' => 'bar', 'sna' => 'fu')
|
46
|
-
end
|
47
|
-
end
|
48
|
-
|
49
|
-
context "when input is NOT valid YAML" do
|
50
|
-
it "raises a TypeError" do
|
51
|
-
ruby_array = [1, 2, 3, 4]
|
52
|
-
expect { Gitlab::CLI::Helpers.yaml_load ruby_array }.to raise_error TypeError
|
53
|
-
end
|
54
|
-
end
|
55
|
-
end
|
56
|
-
end
|
data/spec/gitlab/cli_spec.rb
DELETED
@@ -1,119 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
require 'json'
|
3
|
-
|
4
|
-
describe Gitlab::CLI do
|
5
|
-
describe ".run" do
|
6
|
-
context "when command is version" do
|
7
|
-
it "shows gem version" do
|
8
|
-
output = capture_output { Gitlab::CLI.run('-v') }
|
9
|
-
expect(output).to eq("Gitlab Ruby Gem #{Gitlab::VERSION}\n")
|
10
|
-
end
|
11
|
-
end
|
12
|
-
|
13
|
-
context "when command is info" do
|
14
|
-
it "shows environment info" do
|
15
|
-
output = capture_output { Gitlab::CLI.run('info') }
|
16
|
-
expect(output).to include("Gitlab endpoint is")
|
17
|
-
expect(output).to include("Gitlab private token is")
|
18
|
-
expect(output).to include("Ruby Version is")
|
19
|
-
expect(output).to include("Gitlab Ruby Gem")
|
20
|
-
end
|
21
|
-
end
|
22
|
-
|
23
|
-
context "when command is help" do
|
24
|
-
it "shows available actions" do
|
25
|
-
output = capture_output { Gitlab::CLI.run('help') }
|
26
|
-
expect(output).to include('Help Topics')
|
27
|
-
expect(output).to include('MergeRequests')
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
31
|
-
context "when command is user" do
|
32
|
-
before do
|
33
|
-
stub_get("/user", "user")
|
34
|
-
@output = capture_output { Gitlab::CLI.run('user') }
|
35
|
-
end
|
36
|
-
|
37
|
-
it "shows executed command" do
|
38
|
-
expect(@output).to include('Gitlab.user')
|
39
|
-
end
|
40
|
-
|
41
|
-
it "shows user data" do
|
42
|
-
expect(@output).to include('name')
|
43
|
-
expect(@output).to include('John Smith')
|
44
|
-
end
|
45
|
-
end
|
46
|
-
|
47
|
-
context "when command is users" do
|
48
|
-
before do
|
49
|
-
stub_get("/users", "users")
|
50
|
-
@output = capture_output { Gitlab::CLI.run('users') }
|
51
|
-
end
|
52
|
-
|
53
|
-
it "shows executed command" do
|
54
|
-
expect(@output).to include('Gitlab.users')
|
55
|
-
end
|
56
|
-
|
57
|
-
it "shows users data" do
|
58
|
-
expect(@output).to include('name')
|
59
|
-
expect(@output).to include('John Smith')
|
60
|
-
expect(@output).to include('Jack Smith')
|
61
|
-
end
|
62
|
-
end
|
63
|
-
end
|
64
|
-
|
65
|
-
describe ".start" do
|
66
|
-
context "when command with excluded fields" do
|
67
|
-
before do
|
68
|
-
stub_get("/user", "user")
|
69
|
-
args = ['user', '--except=id,email,name']
|
70
|
-
@output = capture_output { Gitlab::CLI.start(args) }
|
71
|
-
end
|
72
|
-
|
73
|
-
it "shows user data with excluded fields" do
|
74
|
-
expect(@output).to_not include('John Smith')
|
75
|
-
expect(@output).to include('bio')
|
76
|
-
expect(@output).to include('created_at')
|
77
|
-
end
|
78
|
-
end
|
79
|
-
|
80
|
-
context "when command with json output" do
|
81
|
-
before do
|
82
|
-
stub_get("/user", "user")
|
83
|
-
args = ['user', '--json']
|
84
|
-
@output = capture_output { Gitlab::CLI.start(args) }
|
85
|
-
end
|
86
|
-
|
87
|
-
it "renders output as json" do
|
88
|
-
expect(JSON.parse(@output)['result']).to eq(JSON.parse(File.read(File.dirname(__FILE__) + '/../fixtures/user.json')))
|
89
|
-
expect(JSON.parse(@output)['cmd']).to eq('Gitlab.user')
|
90
|
-
end
|
91
|
-
end
|
92
|
-
|
93
|
-
context "when command with required fields" do
|
94
|
-
before do
|
95
|
-
stub_get("/user", "user")
|
96
|
-
args = ['user', '--only=id,email,name']
|
97
|
-
@output = capture_output { Gitlab::CLI.start(args) }
|
98
|
-
end
|
99
|
-
|
100
|
-
it "shows user data with required fields" do
|
101
|
-
expect(@output).to include('id')
|
102
|
-
expect(@output).to include('name')
|
103
|
-
expect(@output).to include('email')
|
104
|
-
expect(@output).to include('John Smith')
|
105
|
-
expect(@output).to_not include('bio')
|
106
|
-
expect(@output).to_not include('created_at')
|
107
|
-
end
|
108
|
-
end
|
109
|
-
|
110
|
-
context "fetch project with namespace/repo" do
|
111
|
-
it "encodes delimiter" do
|
112
|
-
stub_get("/projects/gitlab-org%2Fgitlab-ce", "project")
|
113
|
-
args = ['project', 'gitlab-org/gitlab-ce']
|
114
|
-
@output = capture_output { Gitlab::CLI.start(args) }
|
115
|
-
expect(@output).to include('id')
|
116
|
-
end
|
117
|
-
end
|
118
|
-
end
|
119
|
-
end
|