Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
e96862f2
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,体验更适合开发者的 AI 搜索 >>
提交
e96862f2
编写于
8月 06, 2018
作者:
B
Bob Van Landuyt
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Revert "Merge branch 'bvl-instance-stats-default' into 'master'"
This reverts merge request !21044
上级
415b2f94
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
7 addition
and
48 deletion
+7
-48
app/models/application_setting.rb
app/models/application_setting.rb
+1
-1
db/migrate/20180718005113_add_instance_statistics_visibility_to_application_setting.rb
..._instance_statistics_visibility_to_application_setting.rb
+1
-1
db/migrate/20180806094307_change_instance_stats_visibility_default.rb
...0180806094307_change_instance_stats_visibility_default.rb
+0
-23
db/schema.rb
db/schema.rb
+2
-2
spec/features/dashboard/active_tab_spec.rb
spec/features/dashboard/active_tab_spec.rb
+0
-4
spec/policies/global_policy_spec.rb
spec/policies/global_policy_spec.rb
+2
-14
spec/requests/api/settings_spec.rb
spec/requests/api/settings_spec.rb
+1
-1
spec/support/shared_examples/instance_statistics_controllers_shared_examples.rb
...amples/instance_statistics_controllers_shared_examples.rb
+0
-2
未找到文件。
app/models/application_setting.rb
浏览文件 @
e96862f2
...
...
@@ -297,7 +297,7 @@ class ApplicationSetting < ActiveRecord::Base
unique_ips_limit_per_user:
10
,
unique_ips_limit_time_window:
3600
,
usage_ping_enabled:
Settings
.
gitlab
[
'usage_ping_enabled'
],
instance_statistics_visibility_private:
tru
e
,
instance_statistics_visibility_private:
fals
e
,
user_default_external:
false
}
end
...
...
db/migrate/20180718005113_add_instance_statistics_visibility_to_application_setting.rb
浏览文件 @
e96862f2
...
...
@@ -10,7 +10,7 @@ class AddInstanceStatisticsVisibilityToApplicationSetting < ActiveRecord::Migrat
def
up
add_column_with_default
(
:application_settings
,
:instance_statistics_visibility_private
,
:boolean
,
default:
tru
e
,
default:
fals
e
,
allow_null:
false
)
end
...
...
db/migrate/20180806094307_change_instance_stats_visibility_default.rb
已删除
100644 → 0
浏览文件 @
415b2f94
# frozen_string_literal: true
# See http://doc.gitlab.com/ce/development/migration_style_guide.html
# for more information on how to write migrations for GitLab.
class
ChangeInstanceStatsVisibilityDefault
<
ActiveRecord
::
Migration
include
Gitlab
::
Database
::
MigrationHelpers
DOWNTIME
=
false
def
up
change_column_default
:application_settings
,
:instance_statistics_visibility_private
,
true
ApplicationSetting
.
update_all
(
instance_statistics_visibility_private:
true
)
end
def
down
change_column_default
:application_settings
,
:instance_statistics_visibility_private
,
false
end
end
db/schema.rb
浏览文件 @
e96862f2
...
...
@@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord
::
Schema
.
define
(
version:
20180
80609430
7
)
do
ActiveRecord
::
Schema
.
define
(
version:
20180
72617205
7
)
do
# These are extensions that must be enabled in order to support this database
enable_extension
"plpgsql"
...
...
@@ -168,7 +168,7 @@ ActiveRecord::Schema.define(version: 20180806094307) do
t
.
boolean
"enforce_terms"
,
default:
false
t
.
boolean
"mirror_available"
,
default:
true
,
null:
false
t
.
boolean
"hide_third_party_offers"
,
default:
false
,
null:
false
t
.
boolean
"instance_statistics_visibility_private"
,
default:
tru
e
,
null:
false
t
.
boolean
"instance_statistics_visibility_private"
,
default:
fals
e
,
null:
false
end
create_table
"audit_events"
,
force: :cascade
do
|
t
|
...
...
spec/features/dashboard/active_tab_spec.rb
浏览文件 @
e96862f2
...
...
@@ -35,10 +35,6 @@ RSpec.describe 'Dashboard Active Tab', :js do
context
'on instance statistics'
do
subject
{
visit
instance_statistics_root_path
}
before
do
stub_application_setting
(
instance_statistics_visibility_private:
false
)
end
it
'shows Instance Statistics` as active'
do
subject
...
...
spec/policies/global_policy_spec.rb
浏览文件 @
e96862f2
...
...
@@ -183,13 +183,7 @@ describe GlobalPolicy do
describe
'read instance statistics'
do
context
'regular user'
do
context
'when instance statistics are publicly available'
do
before
do
stub_application_setting
(
instance_statistics_visibility_private:
false
)
end
it
{
is_expected
.
to
be_allowed
(
:read_instance_statistics
)
}
end
it
{
is_expected
.
to
be_allowed
(
:read_instance_statistics
)
}
context
'when instance statistics are set to private'
do
before
do
...
...
@@ -203,13 +197,7 @@ describe GlobalPolicy do
context
'admin'
do
let
(
:current_user
)
{
create
(
:admin
)
}
context
'when instance statistics are publicly available'
do
before
do
stub_application_setting
(
instance_statistics_visibility_private:
false
)
end
it
{
is_expected
.
to
be_allowed
(
:read_instance_statistics
)
}
end
it
{
is_expected
.
to
be_allowed
(
:read_instance_statistics
)
}
context
'when instance statistics are set to private'
do
before
do
...
...
spec/requests/api/settings_spec.rb
浏览文件 @
e96862f2
...
...
@@ -25,7 +25,7 @@ describe API::Settings, 'Settings' do
expect
(
json_response
[
'ed25519_key_restriction'
]).
to
eq
(
0
)
expect
(
json_response
[
'circuitbreaker_failure_count_threshold'
]).
not_to
be_nil
expect
(
json_response
[
'performance_bar_allowed_group_id'
]).
to
be_nil
expect
(
json_response
[
'instance_statistics_visibility_private'
]).
to
be
(
tru
e
)
expect
(
json_response
[
'instance_statistics_visibility_private'
]).
to
be
(
fals
e
)
expect
(
json_response
).
not_to
have_key
(
'performance_bar_allowed_group_path'
)
expect
(
json_response
).
not_to
have_key
(
'performance_bar_enabled'
)
end
...
...
spec/support/shared_examples/instance_statistics_controllers_shared_examples.rb
浏览文件 @
e96862f2
...
...
@@ -9,8 +9,6 @@ shared_examples 'instance statistics availability' do
describe
'GET #index'
do
it
'is available when the feature is available publicly'
do
stub_application_setting
(
instance_statistics_visibility_private:
false
)
get
:index
expect
(
response
).
to
have_gitlab_http_status
(
:success
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录