Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
3c284169
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 搜索 >>
提交
3c284169
编写于
7月 02, 2020
作者:
G
GitLab Bot
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add latest changes from gitlab-org/gitlab@master
上级
6adcd827
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
89 addition
and
17 deletion
+89
-17
app/assets/javascripts/monitoring/components/dashboard_header.vue
...ts/javascripts/monitoring/components/dashboard_header.vue
+1
-1
app/assets/javascripts/monitoring/monitoring_app.js
app/assets/javascripts/monitoring/monitoring_app.js
+2
-1
app/controllers/concerns/metrics_dashboard.rb
app/controllers/concerns/metrics_dashboard.rb
+11
-1
changelogs/unreleased/rc-escape_dashboard_paths.yml
changelogs/unreleased/rc-escape_dashboard_paths.yml
+5
-0
doc/ci/yaml/README.md
doc/ci/yaml/README.md
+15
-1
doc/development/migration_style_guide.md
doc/development/migration_style_guide.md
+1
-1
spec/controllers/concerns/metrics_dashboard_spec.rb
spec/controllers/concerns/metrics_dashboard_spec.rb
+16
-0
spec/frontend/monitoring/components/dashboard_spec.js
spec/frontend/monitoring/components/dashboard_spec.js
+26
-0
spec/lib/gitlab/usage_data_spec.rb
spec/lib/gitlab/usage_data_spec.rb
+12
-12
未找到文件。
app/assets/javascripts/monitoring/components/dashboard_header.vue
浏览文件 @
3c284169
...
...
@@ -136,7 +136,7 @@ export default {
]),
selectDashboard
(
dashboard
)
{
const
params
=
{
dashboard
:
dashboard
.
path
,
dashboard
:
encodeURIComponent
(
dashboard
.
path
)
,
};
redirectTo
(
mergeUrlParams
(
params
,
window
.
location
.
href
));
},
...
...
app/assets/javascripts/monitoring/monitoring_app.js
浏览文件 @
3c284169
...
...
@@ -11,7 +11,8 @@ export default (props = {}) => {
const
el
=
document
.
getElementById
(
'
prometheus-graphs
'
);
if
(
el
&&
el
.
dataset
)
{
const
[
currentDashboard
]
=
getParameterValues
(
'
dashboard
'
);
const
[
encodedDashboard
]
=
getParameterValues
(
'
dashboard
'
);
const
currentDashboard
=
encodedDashboard
?
decodeURIComponent
(
encodedDashboard
)
:
null
;
const
{
metricsDashboardBasePath
,
...
dataset
}
=
el
.
dataset
;
const
{
initState
,
dataProps
}
=
stateAndPropsFromDataset
({
currentDashboard
,
...
dataset
});
...
...
app/controllers/concerns/metrics_dashboard.rb
浏览文件 @
3c284169
...
...
@@ -13,7 +13,7 @@ module MetricsDashboard
result
=
dashboard_finder
.
find
(
project_for_dashboard
,
current_user
,
metrics_dashboard_params
.
to_h
.
symbolize_key
s
decoded_param
s
)
if
result
...
...
@@ -114,4 +114,14 @@ module MetricsDashboard
json:
result
.
slice
(
:all_dashboards
,
:message
,
:status
)
}
end
def
decoded_params
params
=
metrics_dashboard_params
if
params
[
:dashboard_path
]
params
[
:dashboard_path
]
=
CGI
.
unescape
(
params
[
:dashboard_path
])
end
params
end
end
changelogs/unreleased/rc-escape_dashboard_paths.yml
0 → 100644
浏览文件 @
3c284169
---
title
:
Allow special characters in dashboard path
merge_request
:
32714
author
:
type
:
fixed
doc/ci/yaml/README.md
浏览文件 @
3c284169
...
...
@@ -4187,7 +4187,8 @@ need to be used to merge arrays.
YAML has a handy feature called 'anchors', which lets you easily duplicate
content across your document. Anchors can be used to duplicate/inherit
properties, and is a perfect example to be used with
[
hidden jobs
](
#hide-jobs
)
to provide templates for your jobs.
to provide templates for your jobs. When there is duplicate keys, GitLab will
perform a reverse deep merge based on the keys.
The following example uses anchors and map merging. It will create two jobs,
`test1`
and
`test2`
, that will inherit the parameters of
`.job_template`
, each
...
...
@@ -4248,6 +4249,8 @@ directive defined in `.postgres_services` and `.mysql_services` respectively:
.job_template
:
&job_definition
script
:
-
test project
tags
:
-
dev
.postgres_services
:
services
:
&postgres_definition
...
...
@@ -4262,6 +4265,8 @@ directive defined in `.postgres_services` and `.mysql_services` respectively:
test:postgres:
<<
:
*job_definition
services
:
*postgres_definition
tags
:
-
postgres
test:mysql:
<<
:
*job_definition
...
...
@@ -4274,6 +4279,8 @@ The expanded version looks like this:
.job_template
:
script
:
-
test project
tags
:
-
dev
.postgres_services
:
services
:
...
...
@@ -4291,6 +4298,8 @@ test:postgres:
services
:
-
postgres
-
ruby
tags
:
-
postgres
test:mysql:
script
:
...
...
@@ -4298,10 +4307,15 @@ test:mysql:
services
:
-
mysql
-
ruby
tags
:
-
dev
```
You can see that the hidden jobs are conveniently used as templates.
NOTE:
**Note:**
Note that
`tags: [dev]`
has been overwritten by
`tags: [postgres]`
.
NOTE:
**Note:**
You can't use YAML anchors across multiple files when leveraging the
[
`include`
](
#include
)
feature. Anchors are only valid within the file they were defined in. Instead
...
...
doc/development/migration_style_guide.md
浏览文件 @
3c284169
...
...
@@ -814,7 +814,7 @@ When using a `JSONB` column, use the [JsonSchemaValidator](https://gitlab.com/gi
```
ruby
class
BuildMetadata
validates
:
:config_options
,
json_schema:
{
filename:
'build_metadata_config_option'
}
validates
:config_options
,
json_schema:
{
filename:
'build_metadata_config_option'
}
end
```
...
...
spec/controllers/concerns/metrics_dashboard_spec.rb
浏览文件 @
3c284169
...
...
@@ -76,6 +76,22 @@ RSpec.describe MetricsDashboard do
end
end
context
'when dashboard path includes encoded characters'
do
let
(
:params
)
{
{
dashboard_path:
'dashboard%26copy.yml'
}
}
before
do
allow
(
controller
)
.
to
receive
(
:metrics_dashboard_params
)
.
and_return
(
params
)
end
it
'decodes dashboard path'
do
expect
(
::
Gitlab
::
Metrics
::
Dashboard
::
Finder
).
to
receive
(
:find
).
with
(
anything
,
anything
,
hash_including
(
dashboard_path:
'dashboard©.yml'
))
json_response
end
end
context
'when parameters are provided and the list of all dashboards is required'
do
before
do
allow
(
controller
).
to
receive
(
:include_all_dashboards?
).
and_return
(
true
)
...
...
spec/frontend/monitoring/components/dashboard_spec.js
浏览文件 @
3c284169
...
...
@@ -426,6 +426,32 @@ describe('Dashboard', () => {
);
});
});
describe
(
'
when custom dashboard is selected
'
,
()
=>
{
const
windowLocation
=
window
.
location
;
const
findDashboardDropdown
=
()
=>
wrapper
.
find
(
DashboardHeader
).
find
(
DashboardsDropdown
);
beforeEach
(()
=>
{
delete
window
.
location
;
window
.
location
=
{
...
windowLocation
,
assign
:
jest
.
fn
()
};
createMountedWrapper
();
return
wrapper
.
vm
.
$nextTick
();
});
afterEach
(()
=>
{
window
.
location
=
windowLocation
;
});
it
(
'
encodes dashboard param
'
,
()
=>
{
findDashboardDropdown
().
vm
.
$emit
(
'
selectDashboard
'
,
{
path
:
'
dashboard©.yml
'
,
});
expect
(
window
.
location
.
assign
).
toHaveBeenCalledWith
(
'
http://localhost/?dashboard=dashboard%2526copy.yml
'
,
);
});
});
});
describe
(
'
when all requests have been commited by the store
'
,
()
=>
{
...
...
spec/lib/gitlab/usage_data_spec.rb
浏览文件 @
3c284169
...
...
@@ -87,7 +87,7 @@ RSpec.describe Gitlab::UsageData, :aggregate_failures do
end
end
describe
'
#
data'
do
describe
'
.
data'
do
let!
(
:ud
)
{
build
(
:usage_data
)
}
before
do
...
...
@@ -267,7 +267,7 @@ RSpec.describe Gitlab::UsageData, :aggregate_failures do
end
end
describe
'
#
usage_data_counters'
do
describe
'
.
usage_data_counters'
do
subject
{
described_class
.
usage_data_counters
}
it
{
is_expected
.
to
all
(
respond_to
:totals
)
}
...
...
@@ -294,7 +294,7 @@ RSpec.describe Gitlab::UsageData, :aggregate_failures do
end
end
describe
'
#
license_usage_data'
do
describe
'
.
license_usage_data'
do
subject
{
described_class
.
license_usage_data
}
it
'gathers license data'
do
...
...
@@ -307,7 +307,7 @@ RSpec.describe Gitlab::UsageData, :aggregate_failures do
end
context
'when not relying on database records'
do
describe
'
#
features_usage_data_ce'
do
describe
'
.
features_usage_data_ce'
do
subject
{
described_class
.
features_usage_data_ce
}
it
'gathers feature usage data'
,
:aggregate_failures
do
...
...
@@ -340,7 +340,7 @@ RSpec.describe Gitlab::UsageData, :aggregate_failures do
end
end
describe
'
#
components_usage_data'
do
describe
'
.
components_usage_data'
do
subject
{
described_class
.
components_usage_data
}
it
'gathers basic components usage data'
do
...
...
@@ -364,7 +364,7 @@ RSpec.describe Gitlab::UsageData, :aggregate_failures do
end
end
describe
'
#
app_server_type'
do
describe
'
.
app_server_type'
do
subject
{
described_class
.
app_server_type
}
it
'successfully identifies runtime and returns the identifier'
do
...
...
@@ -386,7 +386,7 @@ RSpec.describe Gitlab::UsageData, :aggregate_failures do
end
end
describe
'
#
object_store_config'
do
describe
'
.
object_store_config'
do
let
(
:component
)
{
'lfs'
}
subject
{
described_class
.
object_store_config
(
component
)
}
...
...
@@ -427,7 +427,7 @@ RSpec.describe Gitlab::UsageData, :aggregate_failures do
end
end
describe
'
#
object_store_usage_data'
do
describe
'
.
object_store_usage_data'
do
subject
{
described_class
.
object_store_usage_data
}
it
'fetches object store config of five components'
do
...
...
@@ -446,7 +446,7 @@ RSpec.describe Gitlab::UsageData, :aggregate_failures do
end
end
describe
'
#
cycle_analytics_usage_data'
do
describe
'
.
cycle_analytics_usage_data'
do
subject
{
described_class
.
cycle_analytics_usage_data
}
it
'works when queries time out in new'
do
...
...
@@ -464,7 +464,7 @@ RSpec.describe Gitlab::UsageData, :aggregate_failures do
end
end
describe
'
#
ingress_modsecurity_usage'
do
describe
'
.
ingress_modsecurity_usage'
do
subject
{
described_class
.
ingress_modsecurity_usage
}
let
(
:environment
)
{
create
(
:environment
)
}
...
...
@@ -596,7 +596,7 @@ RSpec.describe Gitlab::UsageData, :aggregate_failures do
end
end
describe
'
#
grafana_embed_usage_data'
do
describe
'
.
grafana_embed_usage_data'
do
subject
{
described_class
.
grafana_embed_usage_data
}
let
(
:project
)
{
create
(
:project
)
}
...
...
@@ -662,7 +662,7 @@ RSpec.describe Gitlab::UsageData, :aggregate_failures do
end
end
describe
'
#
merge_requests_usage'
do
describe
'
.
merge_requests_usage'
do
let
(
:time_period
)
{
{
created_at:
2
.
days
.
ago
..
Time
.
current
}
}
let
(
:merge_request
)
{
create
(
:merge_request
)
}
let
(
:other_user
)
{
create
(
:user
)
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录