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
07ec6037
Commit
07ec6037
authored
Sep 02, 2020
by
Rajendra Kadam
Committed by
Rémy Coutable
Sep 02, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix Style/MultilineIfModifier cop
parent
59c6c59b
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
13 deletions
+15
-13
.rubocop_todo.yml
.rubocop_todo.yml
+0
-7
app/services/ci/process_pipeline_service.rb
app/services/ci/process_pipeline_service.rb
+6
-4
changelogs/unreleased/multiline-if-modifier.yml
changelogs/unreleased/multiline-if-modifier.yml
+5
-0
lib/api/commit_statuses.rb
lib/api/commit_statuses.rb
+4
-2
No files found.
.rubocop_todo.yml
View file @
07ec6037
...
@@ -627,13 +627,6 @@ Style/MixinUsage:
...
@@ -627,13 +627,6 @@ Style/MixinUsage:
-
'
spec/factories/notes.rb'
-
'
spec/factories/notes.rb'
-
'
spec/lib/gitlab/import_export/version_checker_spec.rb'
-
'
spec/lib/gitlab/import_export/version_checker_spec.rb'
# Offense count: 2
# Cop supports --auto-correct.
Style/MultilineIfModifier
:
Exclude
:
-
'
app/services/ci/process_pipeline_service.rb'
-
'
lib/api/commit_statuses.rb'
# Offense count: 29
# Offense count: 29
# Cop supports --auto-correct.
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, MinBodyLength.
# Configuration parameters: EnforcedStyle, MinBodyLength.
...
...
app/services/ci/process_pipeline_service.rb
View file @
07ec6037
...
@@ -37,10 +37,12 @@ module Ci
...
@@ -37,10 +37,12 @@ module Ci
.
pluck
(
Arel
.
sql
(
'MAX(id)'
),
'name'
)
.
pluck
(
Arel
.
sql
(
'MAX(id)'
),
'name'
)
# mark builds that are retried
# mark builds that are retried
if
latest_statuses
.
any?
pipeline
.
statuses
.
latest
pipeline
.
statuses
.
latest
.
where
(
name:
latest_statuses
.
map
(
&
:second
))
.
where
(
name:
latest_statuses
.
map
(
&
:second
))
.
where
.
not
(
id:
latest_statuses
.
map
(
&
:first
))
.
where
.
not
(
id:
latest_statuses
.
map
(
&
:first
))
.
update_all
(
retried:
true
)
if
latest_statuses
.
any?
.
update_all
(
retried:
true
)
end
end
end
# rubocop: enable CodeReuse/ActiveRecord
# rubocop: enable CodeReuse/ActiveRecord
...
...
changelogs/unreleased/multiline-if-modifier.yml
0 → 100644
View file @
07ec6037
---
title
:
Fix Style/MultilineIfModifier cop
merge_request
:
41113
author
:
Rajendra Kadam
type
:
fixed
lib/api/commit_statuses.rb
View file @
07ec6037
...
@@ -117,8 +117,10 @@ module API
...
@@ -117,8 +117,10 @@ module API
render_api_error!
(
'invalid state'
,
400
)
render_api_error!
(
'invalid state'
,
400
)
end
end
if
pipeline
.
latest?
MergeRequest
.
where
(
source_project:
user_project
,
source_branch:
ref
)
MergeRequest
.
where
(
source_project:
user_project
,
source_branch:
ref
)
.
update_all
(
head_pipeline_id:
pipeline
.
id
)
if
pipeline
.
latest?
.
update_all
(
head_pipeline_id:
pipeline
.
id
)
end
present
status
,
with:
Entities
::
CommitStatus
present
status
,
with:
Entities
::
CommitStatus
rescue
StateMachines
::
InvalidTransition
=>
e
rescue
StateMachines
::
InvalidTransition
=>
e
...
...
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