gitlab 4.6.0 → 4.6.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/gitlab/client/access_requests.rb +92 -90
- data/lib/gitlab/client/award_emojis.rb +126 -124
- data/lib/gitlab/client/boards.rb +81 -79
- data/lib/gitlab/client/branches.rb +89 -87
- data/lib/gitlab/client/build_variables.rb +117 -115
- data/lib/gitlab/client/builds.rb +98 -96
- data/lib/gitlab/client/commits.rb +154 -152
- data/lib/gitlab/client/deployments.rb +29 -27
- data/lib/gitlab/client/environments.rb +80 -78
- data/lib/gitlab/client/events.rb +54 -52
- data/lib/gitlab/client/group_milestones.rb +85 -83
- data/lib/gitlab/client/groups.rb +178 -176
- data/lib/gitlab/client/issues.rb +190 -188
- data/lib/gitlab/client/jobs.rb +150 -148
- data/lib/gitlab/client/keys.rb +14 -12
- data/lib/gitlab/client/labels.rb +79 -77
- data/lib/gitlab/client/merge_request_approvals.rb +101 -99
- data/lib/gitlab/client/merge_requests.rb +279 -277
- data/lib/gitlab/client/milestones.rb +85 -83
- data/lib/gitlab/client/namespaces.rb +18 -16
- data/lib/gitlab/client/notes.rb +260 -258
- data/lib/gitlab/client/pipeline_schedules.rb +123 -121
- data/lib/gitlab/client/pipeline_triggers.rb +93 -91
- data/lib/gitlab/client/pipelines.rb +62 -60
- data/lib/gitlab/client/projects.rb +526 -524
- data/lib/gitlab/client/repositories.rb +67 -65
- data/lib/gitlab/client/repository_files.rb +103 -101
- data/lib/gitlab/client/runners.rb +114 -112
- data/lib/gitlab/client/services.rb +45 -43
- data/lib/gitlab/client/sidekiq.rb +32 -30
- data/lib/gitlab/client/snippets.rb +86 -84
- data/lib/gitlab/client/system_hooks.rb +57 -55
- data/lib/gitlab/client/tags.rb +88 -86
- data/lib/gitlab/client/todos.rb +40 -38
- data/lib/gitlab/client/users.rb +243 -241
- data/lib/gitlab/client/versions.rb +13 -11
- data/lib/gitlab/help.rb +1 -1
- data/lib/gitlab/version.rb +1 -1
- metadata +1 -1
@@ -1,32 +1,34 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
#
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
3
|
+
class Gitlab::Client
|
4
|
+
# Defines methods related to deployments.
|
5
|
+
# @see https://docs.gitlab.com/ce/api/deployments.html
|
6
|
+
module Deployments
|
7
|
+
# Gets a list of project deployments.
|
8
|
+
#
|
9
|
+
# @example
|
10
|
+
# Gitlab.deployments(5)
|
11
|
+
# Gitlab.deployments(5, { per_page: 10, page: 2 })
|
12
|
+
#
|
13
|
+
# @param [Integer, String] project The ID or name of a project.
|
14
|
+
# @param [Hash] options A customizable set of options.
|
15
|
+
# @option options [Integer] :page The page number.
|
16
|
+
# @option options [Integer] :per_page The number of results per page.
|
17
|
+
# @return [Array<Gitlab::ObjectifiedHash>]
|
18
|
+
def deployments(project, options = {})
|
19
|
+
get("/projects/#{url_encode project}/deployments", query: options)
|
20
|
+
end
|
20
21
|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
22
|
+
# Gets a single deployment.
|
23
|
+
#
|
24
|
+
# @example
|
25
|
+
# Gitlab.deployment(5, 36)
|
26
|
+
#
|
27
|
+
# @param [Integer, String] project The ID or name of a project.
|
28
|
+
# @param [Integer] id The ID of an deployment.
|
29
|
+
# @return [Gitlab::ObjectifiedHash]
|
30
|
+
def deployment(project, id)
|
31
|
+
get("/projects/#{url_encode project}/deployments/#{id}")
|
32
|
+
end
|
31
33
|
end
|
32
34
|
end
|
@@ -1,87 +1,89 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
#
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
3
|
+
class Gitlab::Client
|
4
|
+
# Defines methods related to environments.
|
5
|
+
# @see https://docs.gitlab.com/ce/api/environments.html
|
6
|
+
module Environments
|
7
|
+
# Gets a list of project environments.
|
8
|
+
#
|
9
|
+
# @example
|
10
|
+
# Gitlab.environments(5)
|
11
|
+
# Gitlab.environments(5, { per_page: 10, page: 2 })
|
12
|
+
#
|
13
|
+
# @param [Integer, String] project The ID or name of a project.
|
14
|
+
# @param [Hash] options A customizable set of options.
|
15
|
+
# @option options [Integer] :page The page number.
|
16
|
+
# @option options [Integer] :per_page The number of results per page.
|
17
|
+
# @return [Array<Gitlab::ObjectifiedHash>]
|
18
|
+
def environments(project, options = {})
|
19
|
+
get("/projects/#{url_encode project}/environments", query: options)
|
20
|
+
end
|
20
21
|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
22
|
+
# Gets a single environment.
|
23
|
+
#
|
24
|
+
# @example
|
25
|
+
# Gitlab.environment(5, 36)
|
26
|
+
#
|
27
|
+
# @param [Integer, String] project The ID or name of a project.
|
28
|
+
# @param [Integer] id The ID of an environment.
|
29
|
+
# @return [Gitlab::ObjectifiedHash]
|
30
|
+
def environment(project, id)
|
31
|
+
get("/projects/#{url_encode project}/environments/#{id}")
|
32
|
+
end
|
32
33
|
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
34
|
+
# Create an environment.
|
35
|
+
#
|
36
|
+
# @examples
|
37
|
+
# Gitlab.create_environment(5, 'test-branch')
|
38
|
+
# Gitlab.create_environment(5, 'test-branch', external_url: 'https://test-branch.example.host.com')
|
39
|
+
#
|
40
|
+
# @param [Integer, String] project The ID or name of a project.
|
41
|
+
# @param [String] env_name Name for the environment
|
42
|
+
# @option options [String] :external_url Optional URL for viewing the deployed project in this environment
|
43
|
+
# @return [Gitlab::ObjectifiedHash] The updated environment.
|
44
|
+
def create_environment(project, env_name, options = {})
|
45
|
+
body = { name: env_name }.merge(options)
|
46
|
+
post("/projects/#{url_encode project}/environments", body: body)
|
47
|
+
end
|
47
48
|
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
49
|
+
# Update an environment.
|
50
|
+
#
|
51
|
+
# @examples
|
52
|
+
# Gitlab.edit_environment(5, 36, name: 'test-branch')
|
53
|
+
# Gitlab.edit_environment(5, 36, external_url: 'https://test-branch.example.host.com')
|
54
|
+
#
|
55
|
+
# @param [Integer, String] project The ID or name of a project.
|
56
|
+
# @param [Integer] id The ID of an environment.
|
57
|
+
# @param [Hash] options A hash of the attribute keys & values to update.
|
58
|
+
# @option options [String] env_name Name for the environment
|
59
|
+
# @option options [String] external_url Optional URL for viewing the deployed project in this environment
|
60
|
+
# @return [Gitlab::ObjectifiedHash] The updated environment.
|
61
|
+
def edit_environment(project, id, options = {})
|
62
|
+
put("/projects/#{url_encode project}/environments/#{id}", body: options)
|
63
|
+
end
|
63
64
|
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
65
|
+
# Deletes an environment.
|
66
|
+
#
|
67
|
+
# @example
|
68
|
+
# Gitlab.delete_environment(5, 36)
|
69
|
+
#
|
70
|
+
# @param [Integer, String] project The ID or name of a project.
|
71
|
+
# @param [Integer] id The ID of an environment.
|
72
|
+
# @return [Gitlab::ObjectifiedHash] Information about the deleted environment.
|
73
|
+
def delete_environment(project, id)
|
74
|
+
delete("/projects/#{url_encode project}/environments/#{id}")
|
75
|
+
end
|
75
76
|
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
77
|
+
# Stop an environment.
|
78
|
+
#
|
79
|
+
# @example
|
80
|
+
# Gitlab.stop_environment(5, 36)
|
81
|
+
#
|
82
|
+
# @param [Integer, String] project The ID or name of a project.
|
83
|
+
# @param [Integer] id The ID of an environment.
|
84
|
+
# @return [Array<Gitlab::ObjectifiedHash>] The stopped environment.
|
85
|
+
def stop_environment(project, id)
|
86
|
+
post("/projects/#{url_encode project}/environments/#{id}/stop")
|
87
|
+
end
|
86
88
|
end
|
87
89
|
end
|
data/lib/gitlab/client/events.rb
CHANGED
@@ -1,58 +1,60 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
#
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
3
|
+
class Gitlab::Client
|
4
|
+
# Defines methods related to events.
|
5
|
+
# @see https://docs.gitlab.com/ce/api/events.html
|
6
|
+
module Events
|
7
|
+
# Gets a list of authenticated user's events
|
8
|
+
#
|
9
|
+
# @example
|
10
|
+
# Gitlab.events()
|
11
|
+
# Gitlab.events({ action: 'created', target_type: 'issue' })
|
12
|
+
#
|
13
|
+
# @param [Hash] options A customizable set of options.
|
14
|
+
# @option options [String] :action Only events of specific action type
|
15
|
+
# @option options [String] :target_type Only events of specific target type
|
16
|
+
# @option options [String] :before Only events created before YYYY-MM-DD
|
17
|
+
# @option options [String] :after Only events created after YYYY-MM-DD
|
18
|
+
# @option options [String] :sort Sort by created_at either 'asc' or 'desc'
|
19
|
+
# @return [Array<Gitlab::ObjectifiedHash>]
|
20
|
+
def events(options = {})
|
21
|
+
get('/events', query: options)
|
22
|
+
end
|
22
23
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
24
|
+
# Gets a list of user contribution events
|
25
|
+
#
|
26
|
+
# @example
|
27
|
+
# Gitlab.user_events(1)
|
28
|
+
# Gitlab.user_events(1, { action: created})
|
29
|
+
#
|
30
|
+
# @param [Integer, String] user The ID or username of user
|
31
|
+
# @param [Hash] options A customizable set of options.
|
32
|
+
# @option options [String] :action Only events of specific action type
|
33
|
+
# @option options [String] :target_type Only events of specific target type
|
34
|
+
# @option options [String] :before Only events created before YYYY-MM-DD
|
35
|
+
# @option options [String] :after Only events created after YYYY-MM-DD
|
36
|
+
# @option options [String] :sort Sort by created_at either 'asc' or 'desc'
|
37
|
+
# @return [Array<Gitlab::ObjectifiedHash>]
|
38
|
+
def user_events(user, options = {})
|
39
|
+
get("/users/#{url_encode user}/events", query: options)
|
40
|
+
end
|
40
41
|
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
42
|
+
# Gets a list of visible project events
|
43
|
+
#
|
44
|
+
# @example
|
45
|
+
# Gitlab.project_events(1)
|
46
|
+
# Gitlab.project_events(1, { action: created })
|
47
|
+
#
|
48
|
+
# @param [Integer] project The ID of project
|
49
|
+
# @param [Hash] options A customizable set of options.
|
50
|
+
# @option options [String] :action Only events of specific action type
|
51
|
+
# @option options [String] :target_type Only events of specific target type
|
52
|
+
# @option options [String] :before Only events created before YYYY-MM-DD
|
53
|
+
# @option options [String] :after Only events created after YYYY-MM-DD
|
54
|
+
# @option options [String] :sort Sort by created_at either 'asc' or 'desc'
|
55
|
+
# @return [Array<Gitlab::ObjectifiedHash>]
|
56
|
+
def project_events(project, options = {})
|
57
|
+
get("/projects/#{url_encode project}/events", query: options)
|
58
|
+
end
|
57
59
|
end
|
58
60
|
end
|
@@ -1,92 +1,94 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
#
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
3
|
+
class Gitlab::Client
|
4
|
+
# Defines methods related to group milestones.
|
5
|
+
# @see https://docs.gitlab.com/ee/api/group_milestones.html
|
6
|
+
module GroupMilestones
|
7
|
+
# Gets a list of a group's milestones.
|
8
|
+
#
|
9
|
+
# @example
|
10
|
+
# Gitlab.group_milestones(5)
|
11
|
+
#
|
12
|
+
# @param [Integer, String] id The ID or name of a group.
|
13
|
+
# @param [Hash] options A customizable set of options.
|
14
|
+
# @option options [Integer] :page The page number.
|
15
|
+
# @option options [Integer] :per_page The number of results per page.
|
16
|
+
# @return [Array<Gitlab::ObjectifiedHash>]
|
17
|
+
def group_milestones(id, options = {})
|
18
|
+
get("/groups/#{url_encode id}/milestones", query: options)
|
19
|
+
end
|
19
20
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
21
|
+
# Gets a single group milestone.
|
22
|
+
#
|
23
|
+
# @example
|
24
|
+
# Gitlab.group_milestone(5, 36)
|
25
|
+
#
|
26
|
+
# @param [Integer, String] id The ID or name of a group.
|
27
|
+
# @param [Integer] milestone_id The ID of a milestone.
|
28
|
+
# @return [Gitlab::ObjectifiedHash]
|
29
|
+
def group_milestone(id, milestone_id)
|
30
|
+
get("/groups/#{url_encode id}/milestones/#{milestone_id}")
|
31
|
+
end
|
31
32
|
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
33
|
+
# Creates a new group milestone.
|
34
|
+
#
|
35
|
+
# @example
|
36
|
+
# Gitlab.create_group_milestone(5, 'v1.0')
|
37
|
+
#
|
38
|
+
# @param [Integer, String] id The ID or name of a group.
|
39
|
+
# @param [String] title The title of a milestone.
|
40
|
+
# @param [Hash] options A customizable set of options.
|
41
|
+
# @option options [String] :description The description of a milestone.
|
42
|
+
# @option options [String] :due_date The due date of a milestone.
|
43
|
+
# @return [Gitlab::ObjectifiedHash] Information about created milestone.
|
44
|
+
def create_group_milestone(id, title, options = {})
|
45
|
+
body = { title: title }.merge(options)
|
46
|
+
post("/groups/#{url_encode id}/milestones", body: body)
|
47
|
+
end
|
47
48
|
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
49
|
+
# Updates a group milestone.
|
50
|
+
#
|
51
|
+
# @example
|
52
|
+
# Gitlab.edit_group_milestone(5, 2, { state_event: 'activate' })
|
53
|
+
#
|
54
|
+
# @param [Integer, String] id The ID or name of a group.
|
55
|
+
# @param [Integer] milestone_id The ID of a milestone.
|
56
|
+
# @param [Hash] options A customizable set of options.
|
57
|
+
# @option options [String] :title The title of a milestone.
|
58
|
+
# @option options [String] :description The description of a milestone.
|
59
|
+
# @option options [String] :due_date The due date of a milestone.
|
60
|
+
# @option options [String] :state_event The state of a milestone ('close' or 'activate').
|
61
|
+
# @return [Gitlab::ObjectifiedHash] Information about updated milestone.
|
62
|
+
def edit_group_milestone(id, milestone_id, options = {})
|
63
|
+
put("/groups/#{url_encode id}/milestones/#{milestone_id}", body: options)
|
64
|
+
end
|
64
65
|
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
66
|
+
# Gets the issues of a given group milestone.
|
67
|
+
#
|
68
|
+
# @example
|
69
|
+
# Gitlab.group_milestone_issues(5, 2)
|
70
|
+
#
|
71
|
+
# @param [Integer, String] id The ID or name of a group.
|
72
|
+
# @param [Integer, String] milestone_id The ID of a milestone.
|
73
|
+
# @option options [Integer] :page The page number.
|
74
|
+
# @option options [Integer] :per_page The number of results per page.
|
75
|
+
# @return [Array<Gitlab::ObjectifiedHash>]
|
76
|
+
def group_milestone_issues(id, milestone_id, options = {})
|
77
|
+
get("/groups/#{url_encode id}/milestones/#{milestone_id}/issues", query: options)
|
78
|
+
end
|
78
79
|
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
80
|
+
# Gets the merge_requests of a given group milestone.
|
81
|
+
#
|
82
|
+
# @example
|
83
|
+
# Gitlab.group_milestone_merge_requests(5, 2)
|
84
|
+
#
|
85
|
+
# @param [Integer, String] group The ID or name of a group.
|
86
|
+
# @param [Integer, String] milestone_id The ID of a milestone.
|
87
|
+
# @option options [Integer] :page The page number.
|
88
|
+
# @option options [Integer] :per_page The number of results per page.
|
89
|
+
# @return [Array<Gitlab::ObjectifiedHash>]
|
90
|
+
def group_milestone_merge_requests(id, milestone_id, options = {})
|
91
|
+
get("/groups/#{url_encode id}/milestones/#{milestone_id}/merge_requests", query: options)
|
92
|
+
end
|
91
93
|
end
|
92
94
|
end
|