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
f06a2c46
Commit
f06a2c46
authored
Dec 04, 2021
by
Kev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix GraphQL/FieldDefinitions offense (Part 4/4)
Changelog: other
parent
94c2aa6c
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
11 additions
and
13 deletions
+11
-13
.rubocop_todo/graphql/field_definitions.yml
.rubocop_todo/graphql/field_definitions.yml
+0
-5
ee/app/graphql/types/ci/code_quality_degradation_type.rb
ee/app/graphql/types/ci/code_quality_degradation_type.rb
+3
-3
ee/app/graphql/types/epic_type.rb
ee/app/graphql/types/epic_type.rb
+3
-2
ee/app/graphql/types/iteration_type.rb
ee/app/graphql/types/iteration_type.rb
+2
-1
ee/app/graphql/types/requirements_management/requirement_type.rb
...graphql/types/requirements_management/requirement_type.rb
+3
-2
No files found.
.rubocop_todo/graphql/field_definitions.yml
View file @
f06a2c46
---
---
GraphQL/FieldDefinitions
:
GraphQL/FieldDefinitions
:
Exclude
:
Exclude
:
-
ee/app/graphql/types/ci/code_quality_degradation_type.rb
-
ee/app/graphql/types/epic_type.rb
-
ee/app/graphql/types/group_release_stats_type.rb
-
ee/app/graphql/types/iteration_type.rb
-
ee/app/graphql/types/requirements_management/requirement_type.rb
-
ee/app/graphql/types/vulnerability_type.rb
-
ee/app/graphql/types/vulnerability_type.rb
ee/app/graphql/types/ci/code_quality_degradation_type.rb
View file @
f06a2c46
...
@@ -23,13 +23,13 @@ module Types
...
@@ -23,13 +23,13 @@ module Types
field
:path
,
GraphQL
::
Types
::
String
,
null:
false
,
field
:path
,
GraphQL
::
Types
::
String
,
null:
false
,
description:
'Relative path to the file containing the code quality degradation.'
description:
'Relative path to the file containing the code quality degradation.'
field
:line
,
GraphQL
::
Types
::
Int
,
null:
false
,
description:
'Line on which the code quality degradation occurred.'
def
path
def
path
degradation
.
dig
(
:location
,
:path
)
degradation
.
dig
(
:location
,
:path
)
end
end
field
:line
,
GraphQL
::
Types
::
Int
,
null:
false
,
description:
'Line on which the code quality degradation occurred.'
def
line
def
line
degradation
.
dig
(
:location
,
:lines
,
:begin
)
||
degradation
.
dig
(
:location
,
:positions
,
:begin
,
:line
)
degradation
.
dig
(
:location
,
:lines
,
:begin
)
||
degradation
.
dig
(
:location
,
:positions
,
:begin
,
:line
)
end
end
...
...
ee/app/graphql/types/epic_type.rb
View file @
f06a2c46
...
@@ -24,10 +24,8 @@ module Types
...
@@ -24,10 +24,8 @@ module Types
description:
'Internal ID of the epic.'
description:
'Internal ID of the epic.'
field
:title
,
GraphQL
::
Types
::
String
,
null:
true
,
field
:title
,
GraphQL
::
Types
::
String
,
null:
true
,
description:
'Title of the epic.'
description:
'Title of the epic.'
markdown_field
:title_html
,
null:
true
field
:description
,
GraphQL
::
Types
::
String
,
null:
true
,
field
:description
,
GraphQL
::
Types
::
String
,
null:
true
,
description:
'Description of the epic.'
description:
'Description of the epic.'
markdown_field
:description_html
,
null:
true
field
:state
,
EpicStateEnum
,
null:
false
,
field
:state
,
EpicStateEnum
,
null:
false
,
description:
'State of the epic.'
description:
'State of the epic.'
field
:confidential
,
GraphQL
::
Types
::
Boolean
,
null:
true
,
field
:confidential
,
GraphQL
::
Types
::
Boolean
,
null:
true
,
...
@@ -162,6 +160,9 @@ module Types
...
@@ -162,6 +160,9 @@ module Types
resolver:
::
Resolvers
::
EpicAncestorsResolver
,
resolver:
::
Resolvers
::
EpicAncestorsResolver
,
description:
'Ancestors (parents) of the epic.'
description:
'Ancestors (parents) of the epic.'
markdown_field
:title_html
,
null:
true
markdown_field
:description_html
,
null:
true
def
has_children?
def
has_children?
Gitlab
::
Graphql
::
Aggregations
::
Epics
::
LazyEpicAggregate
.
new
(
context
,
object
.
id
,
COUNT
)
do
|
node
,
_aggregate_object
|
Gitlab
::
Graphql
::
Aggregations
::
Epics
::
LazyEpicAggregate
.
new
(
context
,
object
.
id
,
COUNT
)
do
|
node
,
_aggregate_object
|
node
.
children
.
any?
node
.
children
.
any?
...
...
ee/app/graphql/types/iteration_type.rb
View file @
f06a2c46
...
@@ -25,7 +25,6 @@ module Types
...
@@ -25,7 +25,6 @@ module Types
field
:description
,
GraphQL
::
Types
::
String
,
null:
true
,
field
:description
,
GraphQL
::
Types
::
String
,
null:
true
,
description:
'Description of the iteration.'
description:
'Description of the iteration.'
markdown_field
:description_html
,
null:
true
field
:state
,
Types
::
IterationStateEnum
,
null:
false
,
field
:state
,
Types
::
IterationStateEnum
,
null:
false
,
description:
'State of the iteration.'
description:
'State of the iteration.'
...
@@ -57,6 +56,8 @@ module Types
...
@@ -57,6 +56,8 @@ module Types
field
:iteration_cadence
,
Types
::
Iterations
::
CadenceType
,
null:
false
,
field
:iteration_cadence
,
Types
::
Iterations
::
CadenceType
,
null:
false
,
description:
'Cadence of the iteration.'
description:
'Cadence of the iteration.'
markdown_field
:description_html
,
null:
true
def
iteration_cadence
def
iteration_cadence
::
Gitlab
::
Graphql
::
Loaders
::
BatchModelLoader
.
new
(
::
Iterations
::
Cadence
,
object
.
iterations_cadence_id
).
find
::
Gitlab
::
Graphql
::
Loaders
::
BatchModelLoader
.
new
(
::
Iterations
::
Cadence
,
object
.
iterations_cadence_id
).
find
end
end
...
...
ee/app/graphql/types/requirements_management/requirement_type.rb
View file @
f06a2c46
...
@@ -18,11 +18,9 @@ module Types
...
@@ -18,11 +18,9 @@ module Types
field
:title
,
GraphQL
::
Types
::
String
,
null:
true
,
field
:title
,
GraphQL
::
Types
::
String
,
null:
true
,
description:
'Title of the requirement.'
description:
'Title of the requirement.'
markdown_field
:title_html
,
null:
true
field
:description
,
GraphQL
::
Types
::
String
,
null:
true
,
field
:description
,
GraphQL
::
Types
::
String
,
null:
true
,
description:
'Description of the requirement.'
description:
'Description of the requirement.'
markdown_field
:description_html
,
null:
true
field
:state
,
RequirementsManagement
::
RequirementStateEnum
,
null:
false
,
field
:state
,
RequirementsManagement
::
RequirementStateEnum
,
null:
false
,
description:
'State of the requirement.'
description:
'State of the requirement.'
...
@@ -52,6 +50,9 @@ module Types
...
@@ -52,6 +50,9 @@ module Types
field
:updated_at
,
Types
::
TimeType
,
null:
false
,
field
:updated_at
,
Types
::
TimeType
,
null:
false
,
description:
'Timestamp of when the requirement was last updated.'
description:
'Timestamp of when the requirement was last updated.'
markdown_field
:title_html
,
null:
true
markdown_field
:description_html
,
null:
true
def
project
def
project
Gitlab
::
Graphql
::
Loaders
::
BatchModelLoader
.
new
(
Project
,
object
.
project_id
).
find
Gitlab
::
Graphql
::
Loaders
::
BatchModelLoader
.
new
(
Project
,
object
.
project_id
).
find
end
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