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
2f6db027
Commit
2f6db027
authored
Jan 07, 2022
by
Tiger
Committed by
Tiger Watson
Jan 10, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use an enum for agent token statuses
Changelog: other
parent
3e98649b
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
33 additions
and
2 deletions
+33
-2
app/graphql/types/clusters/agent_token_status_enum.rb
app/graphql/types/clusters/agent_token_status_enum.rb
+14
-0
app/graphql/types/clusters/agent_token_type.rb
app/graphql/types/clusters/agent_token_type.rb
+1
-1
doc/api/graphql/reference/index.md
doc/api/graphql/reference/index.md
+10
-1
spec/graphql/types/clusters/agent_token_status_enum_spec.rb
spec/graphql/types/clusters/agent_token_status_enum_spec.rb
+8
-0
No files found.
app/graphql/types/clusters/agent_token_status_enum.rb
0 → 100644
View file @
2f6db027
# frozen_string_literal: true
module
Types
module
Clusters
class
AgentTokenStatusEnum
<
BaseEnum
graphql_name
'AgentTokenStatus'
description
'Agent token statuses'
::
Clusters
::
AgentToken
.
statuses
.
keys
.
each
do
|
status
|
value
status
.
upcase
,
value:
status
,
description:
"
#{
status
.
titleize
}
agent token."
end
end
end
end
app/graphql/types/clusters/agent_token_type.rb
View file @
2f6db027
...
...
@@ -45,7 +45,7 @@ module Types
description:
'Name given to the token.'
field
:status
,
GraphQL
::
Types
::
String
,
Types
::
Clusters
::
AgentTokenStatusEnum
,
null:
true
,
description:
'Current status of the token.'
...
...
doc/api/graphql/reference/index.md
View file @
2f6db027
...
...
@@ -9029,7 +9029,7 @@ GitLab CI/CD configuration template.
| <a id="clusteragenttokenid"></a>`id` | [`ClustersAgentTokenID!`](#clustersagenttokenid) | Global ID of the token. |
| <a id="clusteragenttokenlastusedat"></a>`lastUsedAt` | [`Time`](#time) | Timestamp the token was last used. |
| <a id="clusteragenttokenname"></a>`name` | [`String`](#string) | Name given to the token. |
| <a id="clusteragenttokenstatus"></a>`status` | [`
String`](#string
) | Current status of the token. |
| <a id="clusteragenttokenstatus"></a>`status` | [`
AgentTokenStatus`](#agenttokenstatus
) | Current status of the token. |
### `CodeCoverageActivity`
...
...
@@ -16122,6 +16122,15 @@ Access level to a resource.
| <a id="accesslevelenumowner"></a>`OWNER` | Owner access. |
| <a id="accesslevelenumreporter"></a>`REPORTER` | Reporter access. |
### `AgentTokenStatus`
Agent token statuses.
| Value | Description |
| ----- | ----------- |
| <a id="agenttokenstatusactive"></a>`ACTIVE` | Active agent token. |
| <a id="agenttokenstatusrevoked"></a>`REVOKED` | Revoked agent token. |
### `AlertManagementAlertSort`
Values for sorting alerts.
spec/graphql/types/clusters/agent_token_status_enum_spec.rb
0 → 100644
View file @
2f6db027
# frozen_string_literal: true
require
'spec_helper'
RSpec
.
describe
Types
::
Clusters
::
AgentTokenStatusEnum
do
it
{
expect
(
described_class
.
graphql_name
).
to
eq
(
'AgentTokenStatus'
)
}
it
{
expect
(
described_class
.
values
.
keys
).
to
match_array
(
Clusters
::
AgentToken
.
statuses
.
keys
.
map
(
&
:upcase
))
}
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