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
ff8b0e5b
Commit
ff8b0e5b
authored
Mar 11, 2022
by
Kev
Committed by
Mayra Cabrera
Mar 11, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix GraphQL/FieldMethod offense (Part 1/2)
Changelog: other
parent
04ef4238
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
6 additions
and
29 deletions
+6
-29
.rubocop_todo/graphql/field_method.yml
.rubocop_todo/graphql/field_method.yml
+0
-4
app/graphql/types/ci/job_type.rb
app/graphql/types/ci/job_type.rb
+1
-5
app/graphql/types/merge_request_type.rb
app/graphql/types/merge_request_type.rb
+1
-5
app/graphql/types/metrics/dashboards/annotation_type.rb
app/graphql/types/metrics/dashboards/annotation_type.rb
+2
-5
app/graphql/types/project_type.rb
app/graphql/types/project_type.rb
+2
-10
No files found.
.rubocop_todo/graphql/field_method.yml
View file @
ff8b0e5b
---
GraphQL/FieldMethod
:
Exclude
:
-
app/graphql/types/ci/job_type.rb
-
app/graphql/types/merge_request_type.rb
-
app/graphql/types/metrics/dashboards/annotation_type.rb
-
app/graphql/types/packages/package_details_type.rb
-
app/graphql/types/project_type.rb
app/graphql/types/ci/job_type.rb
View file @
ff8b0e5b
...
...
@@ -61,7 +61,7 @@ module Types
field
:coverage
,
GraphQL
::
Types
::
Float
,
null:
true
,
description:
'Coverage level of the job.'
field
:created_by_tag
,
GraphQL
::
Types
::
Boolean
,
null:
false
,
description:
'Whether the job was created by a tag.'
description:
'Whether the job was created by a tag.'
,
method: :tag?
field
:detailed_status
,
Types
::
Ci
::
DetailedStatusType
,
null:
true
,
description:
'Detailed status of the job.'
field
:downstream_pipeline
,
Types
::
Ci
::
PipelineType
,
null:
true
,
...
...
@@ -173,10 +173,6 @@ module Types
object
&
.
coverage
end
def
created_by_tag
object
.
tag?
end
def
manual_job
object
.
try
(
:action?
)
end
...
...
app/graphql/types/merge_request_type.rb
View file @
ff8b0e5b
...
...
@@ -179,7 +179,7 @@ module Types
description:
'Total time reported as spent on the merge request.'
field
:approved_by
,
Types
::
UserType
.
connection_type
,
null:
true
,
description:
'Users who approved the merge request.'
description:
'Users who approved the merge request.'
,
method: :approved_by_users
field
:auto_merge_strategy
,
GraphQL
::
Types
::
String
,
null:
true
,
description:
'Selected auto merge strategy.'
field
:available_auto_merge_strategies
,
[
GraphQL
::
Types
::
String
],
null:
true
,
calls_gitaly:
true
,
...
...
@@ -208,10 +208,6 @@ module Types
markdown_field
:title_html
,
null:
true
markdown_field
:description_html
,
null:
true
def
approved_by
object
.
approved_by_users
end
def
user_notes_count
BatchLoader
::
GraphQL
.
for
(
object
.
id
).
batch
(
key: :merge_request_user_notes_count
)
do
|
ids
,
loader
,
args
|
counts
=
Note
.
count_for_collection
(
ids
,
'MergeRequest'
).
index_by
(
&
:noteable_id
)
...
...
app/graphql/types/metrics/dashboards/annotation_type.rb
View file @
ff8b0e5b
...
...
@@ -14,17 +14,14 @@ module Types
description:
'ID of the annotation.'
field
:panel_id
,
GraphQL
::
Types
::
String
,
null:
true
,
description:
'ID of a dashboard panel to which the annotation should be scoped.'
description:
'ID of a dashboard panel to which the annotation should be scoped.'
,
method: :panel_xid
field
:starting_at
,
Types
::
TimeType
,
null:
true
,
description:
'Timestamp marking start of annotated time span.'
field
:ending_at
,
Types
::
TimeType
,
null:
true
,
description:
'Timestamp marking end of annotated time span.'
def
panel_id
object
.
panel_xid
end
end
end
end
...
...
app/graphql/types/project_type.rb
View file @
ff8b0e5b
...
...
@@ -32,10 +32,10 @@ module Types
field
:tag_list
,
GraphQL
::
Types
::
String
,
null:
true
,
deprecated:
{
reason:
'Use `topics`'
,
milestone:
'13.12'
},
description:
'List of project topics (not Git tags).'
description:
'List of project topics (not Git tags).'
,
method: :topic_list
field
:topics
,
[
GraphQL
::
Types
::
String
],
null:
true
,
description:
'List of project topics.'
description:
'List of project topics.'
,
method: :topic_list
field
:http_url_to_repo
,
GraphQL
::
Types
::
String
,
null:
true
,
description:
'URL to connect to the project via HTTPS.'
...
...
@@ -461,14 +461,6 @@ module Types
object
.
service_desk_address
end
def
tag_list
object
.
topic_list
end
def
topics
object
.
topic_list
end
private
def
project
...
...
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