Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
735e7717
G
gitlab-foss
项目概览
李少辉-开发者
/
gitlab-foss
通知
15
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
gitlab-foss
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
735e7717
编写于
5月 24, 2020
作者:
G
GitLab Bot
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add latest changes from gitlab-org/gitlab@master
上级
55be83f7
变更
16
隐藏空白更改
内联
并排
Showing
16 changed file
with
67 addition
and
37 deletion
+67
-37
.rubocop.yml
.rubocop.yml
+0
-2
app/models/ci/build.rb
app/models/ci/build.rb
+1
-1
app/models/repository.rb
app/models/repository.rb
+2
-4
app/models/ssh_host_key.rb
app/models/ssh_host_key.rb
+1
-1
app/services/projects/hashed_storage/base_attachment_service.rb
...rvices/projects/hashed_storage/base_attachment_service.rb
+1
-1
changelogs/unreleased/ee-app-services-1.yml
changelogs/unreleased/ee-app-services-1.yml
+5
-0
changelogs/unreleased/leaky-constant-fix-36.yml
changelogs/unreleased/leaky-constant-fix-36.yml
+5
-0
changelogs/unreleased/leaky-constant-fix-9.yml
changelogs/unreleased/leaky-constant-fix-9.yml
+5
-0
changelogs/unreleased/rails-logger-cop-15.yml
changelogs/unreleased/rails-logger-cop-15.yml
+5
-0
changelogs/unreleased/rails-logger-cop-4.yml
changelogs/unreleased/rails-logger-cop-4.yml
+5
-0
changelogs/unreleased/rails-logger-cop-5.yml
changelogs/unreleased/rails-logger-cop-5.yml
+5
-0
lib/feature.rb
lib/feature.rb
+2
-2
spec/lib/gitlab/git/diff_collection_spec.rb
spec/lib/gitlab/git/diff_collection_spec.rb
+25
-21
spec/models/ci/build_spec.rb
spec/models/ci/build_spec.rb
+2
-2
spec/models/repository_spec.rb
spec/models/repository_spec.rb
+1
-1
spec/services/clusters/applications/check_uninstall_progress_service_spec.rb
...ers/applications/check_uninstall_progress_service_spec.rb
+2
-2
未找到文件。
.rubocop.yml
浏览文件 @
735e7717
...
...
@@ -351,7 +351,6 @@ RSpec/LeakyConstantDeclaration:
-
'
spec/db/schema_spec.rb'
-
'
spec/lib/feature_spec.rb'
-
'
spec/lib/gitlab/config/entry/simplifiable_spec.rb'
-
'
spec/lib/gitlab/git/diff_collection_spec.rb'
-
'
spec/lib/gitlab/import_export/import_test_coverage_spec.rb'
-
'
spec/lib/gitlab/quick_actions/dsl_spec.rb'
-
'
spec/lib/marginalia_spec.rb'
...
...
@@ -363,7 +362,6 @@ RSpec/LeakyConstantDeclaration:
-
'
spec/models/concerns/triggerable_hooks_spec.rb'
-
'
spec/models/repository_spec.rb'
-
'
spec/services/clusters/applications/check_installation_progress_service_spec.rb'
-
'
spec/services/clusters/applications/check_uninstall_progress_service_spec.rb'
-
'
spec/support/shared_examples/quick_actions/issuable/issuable_quick_actions_shared_examples.rb'
RSpec/EmptyLineAfterHook
:
...
...
app/models/ci/build.rb
浏览文件 @
735e7717
...
...
@@ -352,7 +352,7 @@ module Ci
begin
Ci
::
Build
.
retry
(
build
,
build
.
user
)
rescue
Gitlab
::
Access
::
AccessDeniedError
=>
ex
Rails
.
logger
.
error
"Unable to auto-retry job
#{
build
.
id
}
:
#{
ex
}
"
# rubocop:disable Gitlab/RailsLogger
Gitlab
::
AppLogger
.
error
"Unable to auto-retry job
#{
build
.
id
}
:
#{
ex
}
"
end
end
end
...
...
app/models/repository.rb
浏览文件 @
735e7717
...
...
@@ -950,7 +950,6 @@ class Repository
async_remove_remote
(
remote_name
)
if
tmp_remote_name
end
# rubocop:disable Gitlab/RailsLogger
def
async_remove_remote
(
remote_name
)
return
unless
remote_name
return
unless
project
...
...
@@ -958,14 +957,13 @@ class Repository
job_id
=
RepositoryRemoveRemoteWorker
.
perform_async
(
project
.
id
,
remote_name
)
if
job_id
Rails
.
l
ogger
.
info
(
"Remove remote job scheduled for
#{
project
.
id
}
with remote name:
#{
remote_name
}
job ID
#{
job_id
}
."
)
Gitlab
::
AppL
ogger
.
info
(
"Remove remote job scheduled for
#{
project
.
id
}
with remote name:
#{
remote_name
}
job ID
#{
job_id
}
."
)
else
Rails
.
l
ogger
.
info
(
"Remove remote job failed to create for
#{
project
.
id
}
with remote name
#{
remote_name
}
."
)
Gitlab
::
AppL
ogger
.
info
(
"Remove remote job failed to create for
#{
project
.
id
}
with remote name
#{
remote_name
}
."
)
end
job_id
end
# rubocop:enable Gitlab/RailsLogger
def
fetch_source_branch!
(
source_repository
,
source_branch
,
local_ref
)
raw_repository
.
fetch_source_branch!
(
source_repository
.
raw_repository
,
source_branch
,
local_ref
)
...
...
app/models/ssh_host_key.rb
浏览文件 @
735e7717
...
...
@@ -107,7 +107,7 @@ class SshHostKey
if
status
.
success?
&&
!
errors
.
present?
{
known_hosts:
known_hosts
}
else
Rails
.
logger
.
debug
(
"Failed to detect SSH host keys for
#{
id
}
:
#{
errors
}
"
)
# rubocop:disable Gitlab/RailsLogger
Gitlab
::
AppLogger
.
debug
(
"Failed to detect SSH host keys for
#{
id
}
:
#{
errors
}
"
)
{
error:
'Failed to detect SSH host keys'
}
end
...
...
app/services/projects/hashed_storage/base_attachment_service.rb
浏览文件 @
735e7717
...
...
@@ -19,7 +19,7 @@ module Projects
def
initialize
(
project
:,
old_disk_path
:,
logger:
nil
)
@project
=
project
@old_disk_path
=
old_disk_path
@logger
=
logger
||
Rails
.
logger
# rubocop:disable Gitlab/Rails
Logger
@logger
=
logger
||
Gitlab
::
App
Logger
end
# Return whether this operation was skipped or not
...
...
changelogs/unreleased/ee-app-services-1.yml
0 → 100644
浏览文件 @
735e7717
---
title
:
Move prepend to last in ee-app-services
merge_request
:
31838
author
:
Rajendra Kadam
type
:
fixed
changelogs/unreleased/leaky-constant-fix-36.yml
0 → 100644
浏览文件 @
735e7717
---
title
:
Fix leaky constant issue in diff collection spec
merge_request
:
32163
author
:
Rajendra Kadam
type
:
fixed
changelogs/unreleased/leaky-constant-fix-9.yml
0 → 100644
浏览文件 @
735e7717
---
title
:
Fix leaky constant issue in uninstall progress service check
merge_request
:
32036
author
:
Rajendra Kadam
type
:
fixed
changelogs/unreleased/rails-logger-cop-15.yml
0 → 100644
浏览文件 @
735e7717
---
title
:
Use applogger in base attachment service
merge_request
:
32201
author
:
Rajendra Kadam
type
:
fixed
changelogs/unreleased/rails-logger-cop-4.yml
0 → 100644
浏览文件 @
735e7717
---
title
:
Use applogger in repository model
merge_request
:
32185
author
:
Rajendra Kadam
type
:
fixed
changelogs/unreleased/rails-logger-cop-5.yml
0 → 100644
浏览文件 @
735e7717
---
title
:
Use applogger in build and ssh host key
merge_request
:
32187
author
:
Rajendra Kadam
type
:
fixed
lib/feature.rb
浏览文件 @
735e7717
...
...
@@ -4,8 +4,6 @@ require 'flipper/adapters/active_record'
require
'flipper/adapters/active_support_cache_store'
class
Feature
prepend_if_ee
(
'EE::Feature'
)
# rubocop: disable Cop/InjectEnterpriseEditionModule
# Classes to override flipper table names
class
FlipperFeature
<
Flipper
::
Adapters
::
ActiveRecord
::
Feature
# Using `self.table_name` won't work. ActiveRecord bug?
...
...
@@ -186,3 +184,5 @@ class Feature
end
end
end
Feature
.
prepend_if_ee
(
'EE::Feature'
)
spec/lib/gitlab/git/diff_collection_spec.rb
浏览文件 @
735e7717
...
...
@@ -3,6 +3,31 @@
require
'spec_helper'
describe
Gitlab
::
Git
::
DiffCollection
,
:seed_helper
do
before
do
stub_const
(
'MutatingConstantIterator'
,
Class
.
new
)
MutatingConstantIterator
.
class_eval
do
include
Enumerable
def
initialize
(
count
,
value
)
@count
=
count
@value
=
value
end
def
each
return
enum_for
(
:each
)
unless
block_given?
loop
do
break
if
@count
.
zero?
# It is critical to decrement before yielding. We may never reach the lines after 'yield'.
@count
-=
1
yield
@value
end
end
end
end
subject
do
Gitlab
::
Git
::
DiffCollection
.
new
(
iterator
,
...
...
@@ -659,25 +684,4 @@ describe Gitlab::Git::DiffCollection, :seed_helper do
def
fake_diff
(
line_length
,
line_count
)
{
'diff'
=>
"
#{
'a'
*
line_length
}
\n
"
*
line_count
}
end
class
MutatingConstantIterator
include
Enumerable
def
initialize
(
count
,
value
)
@count
=
count
@value
=
value
end
def
each
return
enum_for
(
:each
)
unless
block_given?
loop
do
break
if
@count
.
zero?
# It is critical to decrement before yielding. We may never reach the lines after 'yield'.
@count
-=
1
yield
@value
end
end
end
end
spec/models/ci/build_spec.rb
浏览文件 @
735e7717
...
...
@@ -3612,7 +3612,7 @@ describe Ci::Build do
.
to
receive
(
:execute
)
.
with
(
subject
)
.
and_raise
(
Gitlab
::
Access
::
AccessDeniedError
)
allow
(
Rails
.
l
ogger
).
to
receive
(
:error
)
allow
(
Gitlab
::
AppL
ogger
).
to
receive
(
:error
)
end
it
'handles raised exception'
do
...
...
@@ -3622,7 +3622,7 @@ describe Ci::Build do
it
'logs the error'
do
subject
.
drop!
expect
(
Rails
.
l
ogger
)
expect
(
Gitlab
::
AppL
ogger
)
.
to
have_received
(
:error
)
.
with
(
a_string_matching
(
"Unable to auto-retry job
#{
subject
.
id
}
"
))
end
...
...
spec/models/repository_spec.rb
浏览文件 @
735e7717
...
...
@@ -974,7 +974,7 @@ describe Repository do
end
it
'returns nil'
do
expect
(
Rails
.
l
ogger
).
to
receive
(
:info
).
with
(
"Remove remote job failed to create for
#{
project
.
id
}
with remote name joe."
)
expect
(
Gitlab
::
AppL
ogger
).
to
receive
(
:info
).
with
(
"Remove remote job failed to create for
#{
project
.
id
}
with remote name joe."
)
expect
(
repository
.
async_remove_remote
(
'joe'
)).
to
be_nil
end
...
...
spec/services/clusters/applications/check_uninstall_progress_service_spec.rb
浏览文件 @
735e7717
...
...
@@ -3,7 +3,7 @@
require
'spec_helper'
describe
Clusters
::
Applications
::
CheckUninstallProgressService
do
RESCHEDULE_PHASES
=
Gitlab
::
Kubernetes
::
Pod
::
PHASES
-
[
Gitlab
::
Kubernetes
::
Pod
::
SUCCEEDED
,
Gitlab
::
Kubernetes
::
Pod
::
FAILED
].
freeze
reschedule_phases
=
Gitlab
::
Kubernetes
::
Pod
::
PHASES
-
[
Gitlab
::
Kubernetes
::
Pod
::
SUCCEEDED
,
Gitlab
::
Kubernetes
::
Pod
::
FAILED
].
freeze
let
(
:application
)
{
create
(
:clusters_applications_prometheus
,
:uninstalling
)
}
let
(
:service
)
{
described_class
.
new
(
application
)
}
...
...
@@ -42,7 +42,7 @@ describe Clusters::Applications::CheckUninstallProgressService do
end
context
'when application is uninstalling'
do
RESCHEDULE_PHASES
.
each
{
|
phase
|
it_behaves_like
'a not yet terminated installation'
,
phase
}
reschedule_phases
.
each
{
|
phase
|
it_behaves_like
'a not yet terminated installation'
,
phase
}
context
'when installation POD succeeded'
do
let
(
:phase
)
{
Gitlab
::
Kubernetes
::
Pod
::
SUCCEEDED
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录