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
data/lib/gitlab/client/boards.rb
CHANGED
@@ -1,88 +1,90 @@
|
|
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 issue boards.
|
5
|
+
# @see https://docs.gitlab.com/ce/api/boards.html
|
6
|
+
module Boards
|
7
|
+
# Gets a list of project's boards.
|
8
|
+
#
|
9
|
+
# @example
|
10
|
+
# Gitlab.boards(5)
|
11
|
+
# Gitlab.boards({ per_page: 40 })
|
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 boards(project, options = {})
|
19
|
+
get("/projects/#{url_encode project}/boards", query: options)
|
20
|
+
end
|
20
21
|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
22
|
+
# Gets a board lists
|
23
|
+
#
|
24
|
+
# @example
|
25
|
+
# Gitlab.board_lists(5, 42)
|
26
|
+
#
|
27
|
+
# @param [Integer, String] project The ID or name of a project.
|
28
|
+
# @param [Integer] id The ID of a board.
|
29
|
+
# @return [Gitlab::ObjectifiedHash]
|
30
|
+
def board_lists(project, id)
|
31
|
+
get("/projects/#{url_encode project}/boards/#{id}/lists")
|
32
|
+
end
|
32
33
|
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
34
|
+
#
|
35
|
+
# Gets a single board list
|
36
|
+
#
|
37
|
+
# @example
|
38
|
+
# Gitlab.board_list(5, 42, 25)
|
39
|
+
#
|
40
|
+
# @param [Integer, String] project The ID or name of a project.
|
41
|
+
# @param [Integer] board_id The ID of a board.
|
42
|
+
# @param [Integer] id The ID of a list.
|
43
|
+
# @return [Gitlab::ObjectifiedHash]
|
44
|
+
def board_list(project, board_id, id)
|
45
|
+
get("/projects/#{url_encode project}/boards/#{board_id}/lists/#{id}")
|
46
|
+
end
|
46
47
|
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
48
|
+
# Creates a new board list.
|
49
|
+
# Only for admins and project owners
|
50
|
+
#
|
51
|
+
# @example
|
52
|
+
# Gitlab.create_board_list(5, 42, 25)
|
53
|
+
#
|
54
|
+
# @param [Integer, String] project The ID or name of a project.
|
55
|
+
# @param [Integer] id The ID of a board.
|
56
|
+
# @param [Integer] label_id The ID of a label.
|
57
|
+
# @return [Gitlab::ObjectifiedHash] Information about created list.
|
58
|
+
def create_board_list(project, board_id, label_id)
|
59
|
+
post("/projects/#{url_encode project}/boards/#{board_id}/lists", body: { label_id: label_id })
|
60
|
+
end
|
60
61
|
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
62
|
+
# Updates a board list.
|
63
|
+
# Only for admins and project owners
|
64
|
+
#
|
65
|
+
# @example
|
66
|
+
# Gitlab.edit_board_list(6, 1, 12, 5)
|
67
|
+
#
|
68
|
+
# @param [Integer, String] project The ID or name of a project.
|
69
|
+
# @param [Integer] board_id The ID of a board.
|
70
|
+
# @param [Integer] id The ID of a list.
|
71
|
+
# @return [Gitlab::ObjectifiedHash] Information about updated board list.
|
72
|
+
def edit_board_list(project, board_id, id, position)
|
73
|
+
put("/projects/#{url_encode project}/boards/#{board_id}/lists/#{id}", body: { position: position })
|
74
|
+
end
|
74
75
|
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
76
|
+
# Deletes a board list.
|
77
|
+
# Only for admins and project owners
|
78
|
+
#
|
79
|
+
# @example
|
80
|
+
# Gitlab.delete_board_list(3, 42, 32)
|
81
|
+
#
|
82
|
+
# @param [Integer, String] project The ID or name of a project.
|
83
|
+
# @param [Integer] board_id The ID of a board.
|
84
|
+
# @param [Integer] id The ID of a list.
|
85
|
+
# @return [Gitlab::ObjectifiedHash] Information about deleted board list.
|
86
|
+
def delete_board_list(project, board_id, id)
|
87
|
+
delete("/projects/#{url_encode project}/boards/#{board_id}/lists/#{id}")
|
88
|
+
end
|
87
89
|
end
|
88
90
|
end
|
@@ -1,96 +1,98 @@
|
|
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 repositories.
|
5
|
+
# @see https://docs.gitlab.com/ce/api/branches.html
|
6
|
+
module Branches
|
7
|
+
# Gets a list of project repositiory branches.
|
8
|
+
#
|
9
|
+
# @example
|
10
|
+
# Gitlab.branches(42)
|
11
|
+
#
|
12
|
+
# @param [Integer, String] project The ID or name of a project.
|
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 branches(project, options = {})
|
18
|
+
get("/projects/#{url_encode project}/repository/branches", query: options)
|
19
|
+
end
|
20
|
+
alias repo_branches branches
|
20
21
|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
22
|
+
# Gets information about a repository branch.
|
23
|
+
#
|
24
|
+
# @example
|
25
|
+
# Gitlab.branch(3, 'api')
|
26
|
+
# Gitlab.repo_branch(5, 'master')
|
27
|
+
#
|
28
|
+
# @param [Integer, String] project The ID or name of a project.
|
29
|
+
# @param [String] branch The name of the branch.
|
30
|
+
# @return [Gitlab::ObjectifiedHash]
|
31
|
+
def branch(project, branch)
|
32
|
+
get("/projects/#{url_encode project}/repository/branches/#{url_encode branch}")
|
33
|
+
end
|
34
|
+
alias repo_branch branch
|
34
35
|
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
36
|
+
# Protects a repository branch.
|
37
|
+
#
|
38
|
+
# @example
|
39
|
+
# Gitlab.protect_branch(3, 'api')
|
40
|
+
# Gitlab.repo_protect_branch(5, 'master')
|
41
|
+
# Gitlab.protect_branch(5, 'api', developers_can_push: true)
|
42
|
+
#
|
43
|
+
# To update options, call `protect_branch` again with new options (i.e. `developers_can_push: false`)
|
44
|
+
#
|
45
|
+
# @param [Integer, String] project The ID or name of a project.
|
46
|
+
# @param [String] branch The name of the branch.
|
47
|
+
# @param [Hash] options A customizable set of options.
|
48
|
+
# @option options [Boolean] :developers_can_push True to allow developers to push to the branch (default = false)
|
49
|
+
# @option options [Boolean] :developers_can_merge True to allow developers to merge into the branch (default = false)
|
50
|
+
# @return [Gitlab::ObjectifiedHash] Details about the branch
|
51
|
+
def protect_branch(project, branch, options = {})
|
52
|
+
post("/projects/#{url_encode project}/protected_branches", body: { name: branch }.merge(options))
|
53
|
+
end
|
54
|
+
alias repo_protect_branch protect_branch
|
54
55
|
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
56
|
+
# Unprotects a repository branch.
|
57
|
+
#
|
58
|
+
# @example
|
59
|
+
# Gitlab.unprotect_branch(3, 'api')
|
60
|
+
# Gitlab.repo_unprotect_branch(5, 'master')
|
61
|
+
#
|
62
|
+
# @param [Integer, String] project The ID or name of a project.
|
63
|
+
# @param [String] branch The name of the branch.
|
64
|
+
# @return [Gitlab::ObjectifiedHash] Details about the branch
|
65
|
+
def unprotect_branch(project, branch)
|
66
|
+
delete("/projects/#{url_encode project}/protected_branches/#{url_encode branch}")
|
67
|
+
end
|
68
|
+
alias repo_unprotect_branch unprotect_branch
|
68
69
|
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
70
|
+
# Creates a repository branch. Requires Gitlab >= 6.8.x
|
71
|
+
#
|
72
|
+
# @example
|
73
|
+
# Gitlab.create_branch(3, 'api', 'feat/new-api')
|
74
|
+
# Gitlab.repo_create_branch(5, 'master', 'develop')
|
75
|
+
#
|
76
|
+
# @param [Integer, String] project The ID or name of a project.
|
77
|
+
# @param [String] branch The name of the new branch.
|
78
|
+
# @param [String] ref Create branch from commit sha or existing branch
|
79
|
+
# @return [Gitlab::ObjectifiedHash] Details about the branch
|
80
|
+
def create_branch(project, branch, ref)
|
81
|
+
post("/projects/#{url_encode project}/repository/branches", query: { branch: branch, ref: ref })
|
82
|
+
end
|
83
|
+
alias repo_create_branch create_branch
|
83
84
|
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
85
|
+
# Deletes a repository branch. Requires Gitlab >= 6.8.x
|
86
|
+
#
|
87
|
+
# @example
|
88
|
+
# Gitlab.delete_branch(3, 'api')
|
89
|
+
# Gitlab.repo_delete_branch(5, 'master')
|
90
|
+
#
|
91
|
+
# @param [Integer, String] project The ID or name of a project.
|
92
|
+
# @param [String] branch The name of the branch to delete
|
93
|
+
def delete_branch(project, branch)
|
94
|
+
delete("/projects/#{url_encode project}/repository/branches/#{url_encode branch}")
|
95
|
+
end
|
96
|
+
alias repo_delete_branch delete_branch
|
94
97
|
end
|
95
|
-
alias repo_delete_branch delete_branch
|
96
98
|
end
|
@@ -1,128 +1,130 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
#
|
5
|
-
# @see https://docs.gitlab.com/
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
3
|
+
class Gitlab::Client
|
4
|
+
# Defines methods related to builds.
|
5
|
+
# @see https://docs.gitlab.com/ce/api/build_variables.html
|
6
|
+
# @see https://docs.gitlab.com/ee/api/group_level_variables.html
|
7
|
+
module BuildVariables
|
8
|
+
# Gets a list of the project's build variables
|
9
|
+
#
|
10
|
+
# @example
|
11
|
+
# Gitlab.variables(5)
|
12
|
+
#
|
13
|
+
# @param [Integer, String] project The ID or name of a project.
|
14
|
+
# @return [Array<Gitlab::ObjectifiedHash>] The list of variables.
|
15
|
+
def variables(project)
|
16
|
+
get("/projects/#{url_encode project}/variables")
|
17
|
+
end
|
17
18
|
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
19
|
+
# Gets details of a project's specific build variable.
|
20
|
+
#
|
21
|
+
# @example
|
22
|
+
# Gitlab.variable(5, "TEST_VARIABLE_1")
|
23
|
+
#
|
24
|
+
# @param [Integer, String] project The ID or name of a project.
|
25
|
+
# @param [String] key The key of a variable.
|
26
|
+
# @return [Gitlab::ObjectifiedHash] The variable.
|
27
|
+
def variable(project, key)
|
28
|
+
get("/projects/#{url_encode project}/variables/#{key}")
|
29
|
+
end
|
29
30
|
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
31
|
+
# Create a build variable for a project.
|
32
|
+
#
|
33
|
+
# @example
|
34
|
+
# Gitlab.create_variable(5, "NEW_VARIABLE", "new value")
|
35
|
+
#
|
36
|
+
# @param [Integer, String] project The ID or name of a project.
|
37
|
+
# @param [String] key The key of a variable; must have no more than 255 characters; only `A-Z`, `a-z`, `0-9` and `_` are allowed
|
38
|
+
# @param [String] value The value of a variable
|
39
|
+
# @return [Gitlab::ObjectifiedHash] The variable.
|
40
|
+
def create_variable(project, key, value)
|
41
|
+
post("/projects/#{url_encode project}/variables", body: { key: key, value: value })
|
42
|
+
end
|
42
43
|
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
44
|
+
# Update a project's build variable.
|
45
|
+
#
|
46
|
+
# @example
|
47
|
+
# Gitlab.update_variable(5, "NEW_VARIABLE", "updated value")
|
48
|
+
#
|
49
|
+
# @param [Integer, String] project The ID or name of a project.
|
50
|
+
# @param [String] key The key of a variable
|
51
|
+
# @param [String] value The value of a variable
|
52
|
+
# @return [Gitlab::ObjectifiedHash] The variable.
|
53
|
+
def update_variable(project, key, value)
|
54
|
+
put("/projects/#{url_encode project}/variables/#{key}", body: { value: value })
|
55
|
+
end
|
55
56
|
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
57
|
+
# Remove a project's build variable.
|
58
|
+
#
|
59
|
+
# @example
|
60
|
+
# Gitlab.remove_variable(5, "VARIABLE_1")
|
61
|
+
#
|
62
|
+
# @param [Integer, String] project The ID or name of a project.
|
63
|
+
# @param [String] key The key of a variable.
|
64
|
+
# @return [Gitlab::ObjectifiedHash] The variable.
|
65
|
+
def remove_variable(project, key)
|
66
|
+
delete("/projects/#{url_encode project}/variables/#{key}")
|
67
|
+
end
|
67
68
|
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
69
|
+
# Gets a list of the group's build variables
|
70
|
+
#
|
71
|
+
# @example
|
72
|
+
# Gitlab.group_variables(5)
|
73
|
+
#
|
74
|
+
# @param [Integer, String] group The ID or name of a group.
|
75
|
+
# @return [Array<Gitlab::ObjectifiedHash>] The list of variables.
|
76
|
+
def group_variables(group)
|
77
|
+
get("/groups/#{url_encode group}/variables")
|
78
|
+
end
|
78
79
|
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
80
|
+
# Gets details of a group's specific build variable.
|
81
|
+
#
|
82
|
+
# @example
|
83
|
+
# Gitlab.group_variable(5, "TEST_VARIABLE_1")
|
84
|
+
#
|
85
|
+
# @param [Integer, String] group The ID or name of a group.
|
86
|
+
# @param [String] key The key of a variable.
|
87
|
+
# @return [Gitlab::ObjectifiedHash] The variable.
|
88
|
+
def group_variable(group, key)
|
89
|
+
get("/groups/#{url_encode group}/variables/#{key}")
|
90
|
+
end
|
90
91
|
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
92
|
+
# Create a build variable for a group.
|
93
|
+
#
|
94
|
+
# @example
|
95
|
+
# Gitlab.create_group_variable(5, "NEW_VARIABLE", "new value")
|
96
|
+
#
|
97
|
+
# @param [Integer, String] group The ID or name of a group.
|
98
|
+
# @param [String] key The key of a variable; must have no more than 255 characters; only `A-Z`, `a-z`, `0-9` and `_` are allowed
|
99
|
+
# @param [String] value The value of a variable
|
100
|
+
# @return [Gitlab::ObjectifiedHash] The variable.
|
101
|
+
def create_group_variable(group, key, value)
|
102
|
+
post("/groups/#{url_encode group}/variables", body: { key: key, value: value })
|
103
|
+
end
|
103
104
|
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
105
|
+
# Update a group's build variable.
|
106
|
+
#
|
107
|
+
# @example
|
108
|
+
# Gitlab.update_group_variable(5, "NEW_VARIABLE", "updated value")
|
109
|
+
#
|
110
|
+
# @param [Integer, String] group The ID or name of a group.
|
111
|
+
# @param [String] key The key of a variable
|
112
|
+
# @param [String] value The value of a variable
|
113
|
+
# @return [Gitlab::ObjectifiedHash] The variable.
|
114
|
+
def update_group_variable(group, key, value)
|
115
|
+
put("/groups/#{url_encode group}/variables/#{key}", body: { value: value })
|
116
|
+
end
|
116
117
|
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
118
|
+
# Remove a group's build variable.
|
119
|
+
#
|
120
|
+
# @example
|
121
|
+
# Gitlab.remove_group_variable(5, "VARIABLE_1")
|
122
|
+
#
|
123
|
+
# @param [Integer, String] group The ID or name of a group.
|
124
|
+
# @param [String] key The key of a variable.
|
125
|
+
# @return [Gitlab::ObjectifiedHash] The variable.
|
126
|
+
def remove_group_variable(group, key)
|
127
|
+
delete("/groups/#{url_encode group}/variables/#{key}")
|
128
|
+
end
|
127
129
|
end
|
128
130
|
end
|