Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
342cd36c
Commit
342cd36c
authored
Jun 01, 2021
by
Pedro Pombeiro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add is_shared and runner_type to hooks and API responses
Changelog: added
parent
c9a19a21
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
38 additions
and
11 deletions
+38
-11
app/graphql/types/ci/runner_type_enum.rb
app/graphql/types/ci/runner_type_enum.rb
+4
-4
doc/api/runners.md
doc/api/runners.md
+15
-1
doc/user/project/integrations/webhooks.md
doc/user/project/integrations/webhooks.md
+5
-1
lib/api/entities/runner.rb
lib/api/entities/runner.rb
+1
-0
lib/gitlab/data_builder/build.rb
lib/gitlab/data_builder/build.rb
+2
-0
lib/gitlab/data_builder/pipeline.rb
lib/gitlab/data_builder/pipeline.rb
+2
-0
spec/lib/gitlab/data_builder/build_spec.rb
spec/lib/gitlab/data_builder/build_spec.rb
+2
-0
spec/lib/gitlab/data_builder/pipeline_spec.rb
spec/lib/gitlab/data_builder/pipeline_spec.rb
+2
-0
spec/requests/api/ci/runners_spec.rb
spec/requests/api/ci/runners_spec.rb
+5
-5
No files found.
app/graphql/types/ci/runner_type_enum.rb
View file @
342cd36c
...
...
@@ -5,10 +5,10 @@ module Types
class
RunnerTypeEnum
<
BaseEnum
graphql_name
'CiRunnerType'
::
Ci
::
Runner
.
runner_types
.
keys
.
each
do
|
type
|
value
type
.
upcase
,
description:
"A runner that is
#{
type
.
tr
(
'_'
,
' '
)
}
."
,
value:
type
::
Ci
::
Runner
::
AVAILABLE_TYPES
.
each
do
|
runner_
type
|
value
runner_
type
.
upcase
,
description:
"A runner that is
#{
runner_
type
.
tr
(
'_'
,
' '
)
}
."
,
value:
runner_
type
end
end
end
...
...
doc/api/runners.md
View file @
342cd36c
...
...
@@ -62,8 +62,9 @@ Example response:
"active"
:
true
,
"description"
:
"test-1-20150125"
,
"id"
:
6
,
"is_shared"
:
false
,
"ip_address"
:
"127.0.0.1"
,
"is_shared"
:
false
,
"runner_type"
:
"project_type"
,
"name"
:
null
,
"online"
:
true
,
"status"
:
"online"
...
...
@@ -74,6 +75,7 @@ Example response:
"id"
:
8
,
"ip_address"
:
"127.0.0.1"
,
"is_shared"
:
false
,
"runner_type"
:
"group_type"
,
"name"
:
null
,
"online"
:
false
,
"status"
:
"offline"
...
...
@@ -115,6 +117,7 @@ Example response:
"id"
:
1
,
"ip_address"
:
"127.0.0.1"
,
"is_shared"
:
true
,
"runner_type"
:
"instance_type"
,
"name"
:
null
,
"online"
:
true
,
"status"
:
"online"
...
...
@@ -125,6 +128,7 @@ Example response:
"id"
:
3
,
"ip_address"
:
"127.0.0.1"
,
"is_shared"
:
true
,
"runner_type"
:
"instance_type"
,
"name"
:
null
,
"online"
:
false
,
"status"
:
"offline"
...
...
@@ -135,6 +139,7 @@ Example response:
"id"
:
6
,
"ip_address"
:
"127.0.0.1"
,
"is_shared"
:
false
,
"runner_type"
:
"project_type"
,
"name"
:
null
,
"online"
:
true
,
"status"
:
"paused"
...
...
@@ -145,6 +150,7 @@ Example response:
"id"
:
8
,
"ip_address"
:
"127.0.0.1"
,
"is_shared"
:
false
,
"runner_type"
:
"group_type"
,
"name"
:
null
,
"online"
:
false
,
"status"
:
"offline"
...
...
@@ -187,6 +193,7 @@ Example response:
"id"
:
6
,
"ip_address"
:
"127.0.0.1"
,
"is_shared"
:
false
,
"runner_type"
:
"project_type"
,
"contacted_at"
:
"2016-01-25T16:39:48.066Z"
,
"name"
:
null
,
"online"
:
true
,
...
...
@@ -250,6 +257,7 @@ Example response:
"id"
:
6
,
"ip_address"
:
"127.0.0.1"
,
"is_shared"
:
false
,
"runner_type"
:
"group_type"
,
"contacted_at"
:
"2016-01-25T16:39:48.066Z"
,
"name"
:
null
,
"online"
:
true
,
...
...
@@ -420,6 +428,7 @@ Example response:
"id"
:
8
,
"ip_address"
:
"127.0.0.1"
,
"is_shared"
:
false
,
"runner_type"
:
"project_type"
,
"name"
:
null
,
"online"
:
false
,
"status"
:
"offline"
...
...
@@ -430,6 +439,7 @@ Example response:
"id"
:
5
,
"ip_address"
:
"127.0.0.1"
,
"is_shared"
:
true
,
"runner_type"
:
"instance_type"
,
"name"
:
null
,
"online"
:
true
,
"status"
:
"paused"
...
...
@@ -464,6 +474,7 @@ Example response:
"id"
:
9
,
"ip_address"
:
"127.0.0.1"
,
"is_shared"
:
false
,
"runner_type"
:
"project_type"
,
"name"
:
null
,
"online"
:
true
,
"status"
:
"online"
...
...
@@ -522,6 +533,7 @@ Example response:
"ip_address"
:
"127.0.0.1"
,
"active"
:
true
,
"is_shared"
:
true
,
"runner_type"
:
"instance_type"
,
"name"
:
"gitlab-runner"
,
"online"
:
null
,
"status"
:
"not_connected"
...
...
@@ -532,6 +544,7 @@ Example response:
"ip_address"
:
"127.0.0.1"
,
"active"
:
true
,
"is_shared"
:
true
,
"runner_type"
:
"instance_type"
,
"name"
:
"gitlab-runner"
,
"online"
:
false
,
"status"
:
"offline"
...
...
@@ -542,6 +555,7 @@ Example response:
"ip_address"
:
"127.0.0.1"
,
"active"
:
true
,
"is_shared"
:
false
,
"runner_type"
:
"group_type"
,
"name"
:
"gitlab-runner"
,
"online"
:
null
,
"status"
:
"not_connected"
...
...
doc/user/project/integrations/webhooks.md
View file @
342cd36c
...
...
@@ -1161,6 +1161,7 @@ X-Gitlab-Event: Pipeline Hook
"id"
:
380987
,
"description"
:
"shared-runners-manager-6.gitlab.com"
,
"active"
:
true
,
"runner_type"
:
"instance_type"
,
"is_shared"
:
true
,
"tags"
:
[
"linux"
,
...
...
@@ -1196,7 +1197,8 @@ X-Gitlab-Event: Pipeline Hook
"id"
:
380987
,
"description"
:
"shared-runners-manager-6.gitlab.com"
,
"active"
:
true
,
"is_shared"
:
true
,
"runner_type"
:
"instance_type"
,
"is_shared"
:
true
,
"tags"
:
[
"linux"
,
"docker"
...
...
@@ -1230,6 +1232,7 @@ X-Gitlab-Event: Pipeline Hook
"id"
:
380987
,
"description"
:
"shared-runners-manager-6.gitlab.com"
,
"active"
:
true
,
"runner_type"
:
"instance_type"
,
"is_shared"
:
true
,
"tags"
:
[
"linux"
,
...
...
@@ -1333,6 +1336,7 @@ X-Gitlab-Event: Job Hook
},
"runner"
:
{
"active"
:
true
,
"runner_type"
:
"project_type"
,
"is_shared"
:
false
,
"id"
:
380987
,
"description"
:
"shared-runners-manager-6.gitlab.com"
,
...
...
lib/api/entities/runner.rb
View file @
342cd36c
...
...
@@ -8,6 +8,7 @@ module API
expose
:ip_address
expose
:active
expose
:instance_type?
,
as: :is_shared
expose
:runner_type
expose
:name
expose
:online?
,
as: :online
expose
:status
...
...
lib/gitlab/data_builder/build.rb
View file @
342cd36c
...
...
@@ -83,7 +83,9 @@ module Gitlab
{
id:
runner
.
id
,
description:
runner
.
description
,
runner_type:
runner
.
runner_type
,
active:
runner
.
active?
,
is_shared:
runner
.
instance_type?
,
tags:
runner
.
tags
&
.
map
(
&
:name
)
}
end
...
...
lib/gitlab/data_builder/pipeline.rb
View file @
342cd36c
...
...
@@ -79,7 +79,9 @@ module Gitlab
{
id:
runner
.
id
,
description:
runner
.
description
,
runner_type:
runner
.
runner_type
,
active:
runner
.
active?
,
is_shared:
runner
.
instance_type?
,
tags:
runner
.
tags
&
.
map
(
&
:name
)
}
end
...
...
spec/lib/gitlab/data_builder/build_spec.rb
View file @
342cd36c
...
...
@@ -47,6 +47,8 @@ RSpec.describe Gitlab::DataBuilder::Build do
it
{
expect
(
data
[
:runner
][
:id
]).
to
eq
(
build
.
runner
.
id
)
}
it
{
expect
(
data
[
:runner
][
:tags
]).
to
match_array
(
tag_names
)
}
it
{
expect
(
data
[
:runner
][
:description
]).
to
eq
(
build
.
runner
.
description
)
}
it
{
expect
(
data
[
:runner
][
:runner_type
]).
to
eq
(
build
.
runner
.
runner_type
)
}
it
{
expect
(
data
[
:runner
][
:is_shared
]).
to
eq
(
build
.
runner
.
instance_type?
)
}
it
{
expect
(
data
[
:environment
]).
to
be_nil
}
context
'commit author_url'
do
...
...
spec/lib/gitlab/data_builder/pipeline_spec.rb
View file @
342cd36c
...
...
@@ -58,8 +58,10 @@ RSpec.describe Gitlab::DataBuilder::Pipeline do
it
'has runner attributes'
,
:aggregate_failures
do
expect
(
runner_data
[
:id
]).
to
eq
(
ci_runner
.
id
)
expect
(
runner_data
[
:description
]).
to
eq
(
ci_runner
.
description
)
expect
(
runner_data
[
:runner_type
]).
to
eq
(
ci_runner
.
runner_type
)
expect
(
runner_data
[
:active
]).
to
eq
(
ci_runner
.
active
)
expect
(
runner_data
[
:tags
]).
to
match_array
(
tag_names
)
expect
(
runner_data
[
:is_shared
]).
to
eq
(
ci_runner
.
instance_type?
)
end
end
...
...
spec/requests/api/ci/runners_spec.rb
View file @
342cd36c
...
...
@@ -137,11 +137,11 @@ RSpec.describe API::Ci::Runners do
get
api
(
'/runners/all'
,
admin
)
expect
(
json_response
).
to
match_array
[
a_hash_including
(
'description'
=>
'Project runner'
),
a_hash_including
(
'description'
=>
'Two projects runner'
),
a_hash_including
(
'description'
=>
'Group runner A'
),
a_hash_including
(
'description'
=>
'Group runner B'
),
a_hash_including
(
'description'
=>
'Shared runner'
)
a_hash_including
(
'description'
=>
'Project runner'
,
'is_shared'
=>
false
,
'runner_type'
=>
'project_type'
),
a_hash_including
(
'description'
=>
'Two projects runner'
,
'is_shared'
=>
false
,
'runner_type'
=>
'project_type'
),
a_hash_including
(
'description'
=>
'Group runner A'
,
'is_shared'
=>
false
,
'runner_type'
=>
'group_type'
),
a_hash_including
(
'description'
=>
'Group runner B'
,
'is_shared'
=>
false
,
'runner_type'
=>
'group_type'
),
a_hash_including
(
'description'
=>
'Shared runner'
,
'is_shared'
=>
true
,
'runner_type'
=>
'instance_type'
)
]
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment