Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
e65c1d31
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 搜索 >>
提交
e65c1d31
编写于
8月 25, 2020
作者:
G
GitLab Bot
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add latest changes from gitlab-org/gitlab@master
上级
4ae91e9f
变更
19
隐藏空白更改
内联
并排
Showing
19 changed file
with
152 addition
and
35 deletion
+152
-35
.gitlab/ci/rules.gitlab-ci.yml
.gitlab/ci/rules.gitlab-ci.yml
+1
-0
app/assets/javascripts/milestone_select.js
app/assets/javascripts/milestone_select.js
+5
-0
app/assets/javascripts/vue_shared/components/todo_button.vue
app/assets/javascripts/vue_shared/components/todo_button.vue
+28
-0
app/assets/stylesheets/pages/wiki.scss
app/assets/stylesheets/pages/wiki.scss
+4
-0
app/views/projects/blob/viewers/_gitlab_ci_yml_loading.html.haml
...ws/projects/blob/viewers/_gitlab_ci_yml_loading.html.haml
+1
-1
app/views/projects/blob/viewers/_loading.html.haml
app/views/projects/blob/viewers/_loading.html.haml
+2
-2
app/views/projects/blob/viewers/_loading_auxiliary.html.haml
app/views/projects/blob/viewers/_loading_auxiliary.html.haml
+1
-1
app/views/projects/blob/viewers/_route_map_loading.html.haml
app/views/projects/blob/viewers/_route_map_loading.html.haml
+1
-1
app/views/projects/blob/viewers/_sketch.html.haml
app/views/projects/blob/viewers/_sketch.html.haml
+2
-2
app/views/projects/blob/viewers/_stl.html.haml
app/views/projects/blob/viewers/_stl.html.haml
+1
-1
changelogs/unreleased/Resolve-Migrate--fa-spinner-app-views-projects-blob-viewers.yml
...e-Migrate--fa-spinner-app-views-projects-blob-viewers.yml
+5
-0
doc/development/database/strings_and_the_text_data_type.md
doc/development/database/strings_and_the_text_data_type.md
+3
-0
lib/gitlab/analytics/unique_visits.rb
lib/gitlab/analytics/unique_visits.rb
+10
-10
lib/gitlab/usage_data.rb
lib/gitlab/usage_data.rb
+4
-4
spec/features/cycle_analytics_spec.rb
spec/features/cycle_analytics_spec.rb
+6
-4
spec/features/issues/user_edits_issue_spec.rb
spec/features/issues/user_edits_issue_spec.rb
+21
-0
spec/frontend/vue_shared/components/todo_button_spec.js
spec/frontend/vue_shared/components/todo_button_spec.js
+48
-0
spec/lib/gitlab/usage_data_spec.rb
spec/lib/gitlab/usage_data_spec.rb
+4
-4
spec/models/packages/package_spec.rb
spec/models/packages/package_spec.rb
+5
-5
未找到文件。
.gitlab/ci/rules.gitlab-ci.yml
浏览文件 @
e65c1d31
...
...
@@ -127,6 +127,7 @@
-
"
{,ee/}{,spec/}{db,migrations}/**/*"
-
"
{,ee/}{,spec/}lib/{,ee/}gitlab/background_migration/**/*"
-
"
config/prometheus/common_metrics.yml"
# Used by Gitlab::DatabaseImporters::CommonMetrics::Importer
-
"
{,ee/}app/models/project_statistics.rb"
# Used to calculate sizes in migration specs
.backstage-patterns
:
&backstage-patterns
-
"
Dangerfile"
...
...
app/assets/javascripts/milestone_select.js
浏览文件 @
e65c1d31
...
...
@@ -76,6 +76,10 @@ export default class MilestoneSelect {
let
getMilestones
=
Api
.
projectMilestones
;
const
reqParams
=
{
state
:
'
active
'
,
include_parent_milestones
:
true
};
if
(
term
)
{
reqParams
.
search
=
term
.
trim
();
}
if
(
!
contextId
)
{
contextId
=
$dropdown
.
get
(
0
).
dataset
.
groupId
;
delete
reqParams
.
include_parent_milestones
;
...
...
@@ -162,6 +166,7 @@ export default class MilestoneSelect {
`
;
},
filterable
:
true
,
filterRemote
:
true
,
search
:
{
fields
:
[
'
title
'
],
},
...
...
app/assets/javascripts/vue_shared/components/todo_button.vue
0 → 100644
浏览文件 @
e65c1d31
<
script
>
import
{
GlButton
}
from
'
@gitlab/ui
'
;
import
{
__
}
from
'
~/locale
'
;
export
default
{
components
:
{
GlButton
,
},
props
:
{
isTodo
:
{
type
:
Boolean
,
required
:
false
,
default
:
true
,
},
},
computed
:
{
buttonLabel
()
{
return
this
.
isTodo
?
__
(
'
Mark as done
'
)
:
__
(
'
Add a To-Do
'
);
},
},
};
</
script
>
<
template
>
<gl-button
v-bind=
"$attrs"
:aria-label=
"buttonLabel"
@
click=
"$emit('click', $event)"
>
{{
buttonLabel
}}
</gl-button>
</
template
>
app/assets/stylesheets/pages/wiki.scss
浏览文件 @
e65c1d31
...
...
@@ -151,3 +151,7 @@ ul.wiki-pages-list.content-list {
.empty-state-wiki
.text-content
{
max-width
:
490px
;
// Widen to allow for the Confluence button
}
.wiki-form
.markdown-area
{
max-height
:
none
;
}
app/views/projects/blob/viewers/_gitlab_ci_yml_loading.html.haml
浏览文件 @
e65c1d31
=
icon
(
'spinner spin fw'
)
=
loading_icon
(
css_class:
"gl-vertical-align-text-bottom mr-1"
)
Validating GitLab CI configuration…
=
link_to
'Learn more'
,
help_page_path
(
'ci/yaml/README'
)
app/views/projects/blob/viewers/_loading.html.haml
浏览文件 @
e65c1d31
.text-center.gl-mt-
3
.gl-mb-3
=
icon
(
'spinner spin 2x'
,
'aria-hidden'
=>
'true'
,
'aria-label'
=>
'Loading content…'
,
class:
'qa-spinner'
)
.text-center.gl-mt-
4
.gl-mb-3
=
loading_icon
(
size:
"md"
,
css_class:
"qa-spinner"
)
app/views/projects/blob/viewers/_loading_auxiliary.html.haml
浏览文件 @
e65c1d31
=
icon
(
'spinner spin fw'
)
=
loading_icon
(
css_class:
"gl-vertical-align-text-bottom"
)
Analyzing file…
app/views/projects/blob/viewers/_route_map_loading.html.haml
浏览文件 @
e65c1d31
=
icon
(
'spinner spin fw'
)
=
loading_icon
(
css_class:
"gl-vertical-align-text-bottom gl-mr-1"
)
Validating Route Map…
=
link_to
'Learn more'
,
help_page_path
(
'ci/environments/index.md'
,
anchor:
'going-from-source-files-to-public-pages'
)
app/views/projects/blob/viewers/_sketch.html.haml
浏览文件 @
e65c1d31
.file-content
#js-sketch-viewer
{
data:
{
endpoint:
blob_raw_path
}
}
.
js-loading-icon.text-center.gl-mt-3.gl-mb-3.js-loading-icon
{
'aria-label'
=>
'Loading Sketch preview'
}
=
icon
(
'spinner spin 2x'
,
'aria-hidden'
=>
'true'
);
.
text-center.gl-mt-4.gl-mb-3.js-loading-icon
=
loading_icon
(
size:
"md"
)
app/views/projects/blob/viewers/_stl.html.haml
浏览文件 @
e65c1d31
.file-content.is-stl-loading
.text-center
#js-stl-viewer
{
data:
{
endpoint:
blob_raw_path
}
}
=
icon
(
'spinner spin 2x'
,
class:
'gl-mt-3 gl-mb-3'
,
'aria-hidden'
=>
'true'
,
'aria-label'
=>
'Loading'
)
=
loading_icon
(
size:
"md"
,
css_class:
"gl-mt-4 gl-mb-3"
)
.text-center.gl-mt-3.gl-mb-3.stl-controls
.btn-group
%button
.btn.btn-default.btn-sm.js-material-changer
{
data:
{
type:
'wireframe'
}
}
...
...
changelogs/unreleased/Resolve-Migrate--fa-spinner-app-views-projects-blob-viewers.yml
0 → 100644
浏览文件 @
e65c1d31
---
title
:
Migrate .fa-spinner to .spinner for app/views/projects/blob/viewers
merge_request
:
25046
author
:
nuwe1
type
:
other
doc/development/database/strings_and_the_text_data_type.md
浏览文件 @
e65c1d31
...
...
@@ -38,6 +38,8 @@ For example, consider a migration that creates a table with two text columns,
```
ruby
class
CreateDbGuides
<
ActiveRecord
::
Migration
[
6.0
]
include
Gitlab
::
Database
::
MigrationHelpers
DOWNTIME
=
false
disable_ddl_transaction!
...
...
@@ -179,6 +181,7 @@ in a post-deployment migration,
```
ruby
class
AddTextLimitMigration
<
ActiveRecord
::
Migration
[
6.0
]
include
Gitlab
::
Database
::
MigrationHelpers
DOWNTIME
=
false
disable_ddl_transaction!
...
...
lib/gitlab/analytics/unique_visits.rb
浏览文件 @
e65c1d31
...
...
@@ -14,23 +14,23 @@ module Gitlab
# @param [ActiveSupport::TimeWithZone] end_date end of time frame
# @return [Integer] number of unique visitors
def
unique_visits_for
(
targets
:,
start_date:
7
.
days
.
ago
,
end_date:
start_date
+
1
.
week
)
target_id
s
=
if
targets
==
:analytics
self
.
class
.
analytics_id
s
elsif
targets
==
:compliance
self
.
class
.
compliance_id
s
else
Array
(
targets
)
end
event
s
=
if
targets
==
:analytics
self
.
class
.
analytics_event
s
elsif
targets
==
:compliance
self
.
class
.
compliance_event
s
else
Array
(
targets
)
end
Gitlab
::
UsageDataCounters
::
HLLRedisCounter
.
unique_events
(
event_names:
target_id
s
,
start_date:
start_date
,
end_date:
end_date
)
Gitlab
::
UsageDataCounters
::
HLLRedisCounter
.
unique_events
(
event_names:
event
s
,
start_date:
start_date
,
end_date:
end_date
)
end
class
<<
self
def
analytics_
id
s
def
analytics_
event
s
Gitlab
::
UsageDataCounters
::
HLLRedisCounter
.
events_for_category
(
'analytics'
)
end
def
compliance_
id
s
def
compliance_
event
s
Gitlab
::
UsageDataCounters
::
HLLRedisCounter
.
events_for_category
(
'compliance'
)
end
end
...
...
lib/gitlab/usage_data.rb
浏览文件 @
e65c1d31
...
...
@@ -589,8 +589,8 @@ module Gitlab
end
def
analytics_unique_visits_data
results
=
::
Gitlab
::
Analytics
::
UniqueVisits
.
analytics_
ids
.
each_with_object
({})
do
|
target_id
,
hash
|
hash
[
target
_id
]
=
redis_usage_data
{
unique_visit_service
.
unique_visits_for
(
targets:
target_id
)
}
results
=
::
Gitlab
::
Analytics
::
UniqueVisits
.
analytics_
events
.
each_with_object
({})
do
|
target
,
hash
|
hash
[
target
]
=
redis_usage_data
{
unique_visit_service
.
unique_visits_for
(
targets:
target
)
}
end
results
[
'analytics_unique_visits_for_any_target'
]
=
redis_usage_data
{
unique_visit_service
.
unique_visits_for
(
targets: :analytics
)
}
results
[
'analytics_unique_visits_for_any_target_monthly'
]
=
redis_usage_data
{
unique_visit_service
.
unique_visits_for
(
targets: :analytics
,
start_date:
4
.
weeks
.
ago
.
to_date
,
end_date:
Date
.
current
)
}
...
...
@@ -599,8 +599,8 @@ module Gitlab
end
def
compliance_unique_visits_data
results
=
::
Gitlab
::
Analytics
::
UniqueVisits
.
compliance_
ids
.
each_with_object
({})
do
|
target_id
,
hash
|
hash
[
target
_id
]
=
redis_usage_data
{
unique_visit_service
.
unique_visits_for
(
targets:
target_id
)
}
results
=
::
Gitlab
::
Analytics
::
UniqueVisits
.
compliance_
events
.
each_with_object
({})
do
|
target
,
hash
|
hash
[
target
]
=
redis_usage_data
{
unique_visit_service
.
unique_visits_for
(
targets:
target
)
}
end
results
[
'compliance_unique_visits_for_any_target'
]
=
redis_usage_data
{
unique_visit_service
.
unique_visits_for
(
targets: :compliance
)
}
results
[
'compliance_unique_visits_for_any_target_monthly'
]
=
redis_usage_data
{
unique_visit_service
.
unique_visits_for
(
targets: :compliance
,
start_date:
4
.
weeks
.
ago
.
to_date
,
end_date:
Date
.
current
)
}
...
...
spec/features/cycle_analytics_spec.rb
浏览文件 @
e65c1d31
...
...
@@ -3,9 +3,9 @@
require
'spec_helper'
RSpec
.
describe
'Value Stream Analytics'
,
:js
do
let
(
:user
)
{
create
(
:user
)
}
let
(
:guest
)
{
create
(
:user
)
}
let
(
:project
)
{
create
(
:project
,
:repository
)
}
let
_it_be
(
:user
)
{
create
(
:user
)
}
let
_it_be
(
:guest
)
{
create
(
:user
)
}
let
_it_be
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:issue
)
{
create
(
:issue
,
project:
project
,
created_at:
2
.
days
.
ago
)
}
let
(
:milestone
)
{
create
(
:milestone
,
project:
project
)
}
let
(
:mr
)
{
create_merge_request_closing_issue
(
user
,
project
,
issue
,
commit_message:
"References
#{
issue
.
to_reference
}
"
)
}
...
...
@@ -13,9 +13,11 @@ RSpec.describe 'Value Stream Analytics', :js do
context
'as an allowed user'
do
context
'when project is new'
do
before
do
before
(
:all
)
do
project
.
add_maintainer
(
user
)
end
before
do
sign_in
(
user
)
visit
project_cycle_analytics_path
(
project
)
...
...
spec/features/issues/user_edits_issue_spec.rb
浏览文件 @
e65c1d31
...
...
@@ -4,13 +4,17 @@ require "spec_helper"
RSpec
.
describe
"Issues > User edits issue"
,
:js
do
let_it_be
(
:project
)
{
create
(
:project_empty_repo
,
:public
)
}
let_it_be
(
:project_with_milestones
)
{
create
(
:project_empty_repo
,
:public
)
}
let_it_be
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:issue
)
{
create
(
:issue
,
project:
project
,
author:
user
,
assignees:
[
user
])
}
let_it_be
(
:issue_with_milestones
)
{
create
(
:issue
,
project:
project_with_milestones
,
author:
user
,
assignees:
[
user
])
}
let_it_be
(
:label
)
{
create
(
:label
,
project:
project
)
}
let_it_be
(
:milestone
)
{
create
(
:milestone
,
project:
project
)
}
let_it_be
(
:milestones
)
{
create_list
(
:milestone
,
25
,
project:
project_with_milestones
)
}
before
do
project
.
add_developer
(
user
)
project_with_milestones
.
add_developer
(
user
)
sign_in
(
user
)
end
...
...
@@ -218,6 +222,23 @@ RSpec.describe "Issues > User edits issue", :js do
end
end
end
it
'allows user to search milestone'
do
visit
project_issue_path
(
project_with_milestones
,
issue_with_milestones
)
page
.
within
(
'.milestone'
)
do
click_link
'Edit'
wait_for_requests
# We need to enclose search string in quotes for exact match as all the milestone titles
# within tests are prefixed with `My title`.
find
(
'.dropdown-input-field'
,
visible:
true
).
send_keys
"
\"
#{
milestones
[
0
].
title
}
\"
"
wait_for_requests
page
.
within
'.dropdown-content'
do
expect
(
page
).
to
have_content
milestones
[
0
].
title
end
end
end
end
context
'by unauthorized user'
do
...
...
spec/frontend/vue_shared/components/todo_button_spec.js
0 → 100644
浏览文件 @
e65c1d31
import
{
shallowMount
,
mount
}
from
'
@vue/test-utils
'
;
import
{
GlButton
}
from
'
@gitlab/ui
'
;
import
TodoButton
from
'
~/vue_shared/components/todo_button.vue
'
;
describe
(
'
Todo Button
'
,
()
=>
{
let
wrapper
;
const
createComponent
=
(
props
=
{},
mountFn
=
shallowMount
)
=>
{
wrapper
=
mountFn
(
TodoButton
,
{
propsData
:
{
...
props
,
},
});
};
afterEach
(()
=>
{
wrapper
.
destroy
();
});
it
(
'
renders GlButton
'
,
()
=>
{
createComponent
();
expect
(
wrapper
.
find
(
GlButton
).
exists
()).
toBe
(
true
);
});
it
(
'
emits click event when clicked
'
,
()
=>
{
createComponent
({},
mount
);
wrapper
.
find
(
GlButton
).
trigger
(
'
click
'
);
expect
(
wrapper
.
emitted
().
click
).
toBeTruthy
();
});
it
.
each
`
label | isTodo
${
'
Mark as done
'
}
|
${
true
}
${
'
Add a To-Do
'
}
|
${
false
}
`
(
'
sets correct label when isTodo is $isTodo
'
,
({
label
,
isTodo
})
=>
{
createComponent
({
isTodo
});
expect
(
wrapper
.
find
(
GlButton
).
text
()).
toBe
(
label
);
});
it
(
'
binds additional props to GlButton
'
,
()
=>
{
createComponent
({
loading
:
true
});
expect
(
wrapper
.
find
(
GlButton
).
props
(
'
loading
'
)).
toBe
(
true
);
});
});
spec/lib/gitlab/usage_data_spec.rb
浏览文件 @
e65c1d31
...
...
@@ -960,8 +960,8 @@ RSpec.describe Gitlab::UsageData, :aggregate_failures do
subject
{
described_class
.
analytics_unique_visits_data
}
it
'returns the number of unique visits to pages with analytics features'
do
::
Gitlab
::
Analytics
::
UniqueVisits
.
analytics_
ids
.
each
do
|
target_id
|
expect_any_instance_of
(
::
Gitlab
::
Analytics
::
UniqueVisits
).
to
receive
(
:unique_visits_for
).
with
(
targets:
target
_id
).
and_return
(
123
)
::
Gitlab
::
Analytics
::
UniqueVisits
.
analytics_
events
.
each
do
|
target
|
expect_any_instance_of
(
::
Gitlab
::
Analytics
::
UniqueVisits
).
to
receive
(
:unique_visits_for
).
with
(
targets:
target
).
and_return
(
123
)
end
expect_any_instance_of
(
::
Gitlab
::
Analytics
::
UniqueVisits
).
to
receive
(
:unique_visits_for
).
with
(
targets: :analytics
).
and_return
(
543
)
...
...
@@ -996,8 +996,8 @@ RSpec.describe Gitlab::UsageData, :aggregate_failures do
described_class
.
clear_memoization
(
:unique_visit_service
)
allow_next_instance_of
(
::
Gitlab
::
Analytics
::
UniqueVisits
)
do
|
instance
|
::
Gitlab
::
Analytics
::
UniqueVisits
.
compliance_
ids
.
each
do
|
target_id
|
allow
(
instance
).
to
receive
(
:unique_visits_for
).
with
(
targets:
target
_id
).
and_return
(
123
)
::
Gitlab
::
Analytics
::
UniqueVisits
.
compliance_
events
.
each
do
|
target
|
allow
(
instance
).
to
receive
(
:unique_visits_for
).
with
(
targets:
target
).
and_return
(
123
)
end
allow
(
instance
).
to
receive
(
:unique_visits_for
).
with
(
targets: :compliance
).
and_return
(
543
)
...
...
spec/models/packages/package_spec.rb
浏览文件 @
e65c1d31
...
...
@@ -84,7 +84,7 @@ RSpec.describe Packages::Package, type: :model do
end
describe
'validations'
do
subject
{
create
(
:package
)
}
subject
{
build
(
:package
)
}
it
{
is_expected
.
to
validate_presence_of
(
:project
)
}
it
{
is_expected
.
to
validate_uniqueness_of
(
:name
).
scoped_to
(
:project_id
,
:version
,
:package_type
)
}
...
...
@@ -95,7 +95,7 @@ RSpec.describe Packages::Package, type: :model do
it
{
is_expected
.
not_to
allow_value
(
"my(dom$$$ain)com.my-app"
).
for
(
:name
)
}
context
'conan package'
do
subject
{
create
(
:conan_package
)
}
subject
{
build_stubbed
(
:conan_package
)
}
let
(
:fifty_one_characters
)
{
'f_b'
*
17
}
...
...
@@ -112,7 +112,7 @@ RSpec.describe Packages::Package, type: :model do
describe
'#version'
do
RSpec
.
shared_examples
'validating version to be SemVer compliant for'
do
|
factory_name
|
context
"for
#{
factory_name
}
"
do
subject
{
create
(
factory_name
)
}
subject
{
build_stubbed
(
factory_name
)
}
it
{
is_expected
.
to
allow_value
(
'1.2.3'
).
for
(
:version
)
}
it
{
is_expected
.
to
allow_value
(
'1.2.3-beta'
).
for
(
:version
)
}
...
...
@@ -126,7 +126,7 @@ RSpec.describe Packages::Package, type: :model do
end
context
'conan package'
do
subject
{
create
(
:conan_package
)
}
subject
{
build_stubbed
(
:conan_package
)
}
let
(
:fifty_one_characters
)
{
'1.2'
*
17
}
...
...
@@ -142,7 +142,7 @@ RSpec.describe Packages::Package, type: :model do
end
context
'maven package'
do
subject
{
create
(
:maven_package
)
}
subject
{
build_stubbed
(
:maven_package
)
}
it
{
is_expected
.
to
allow_value
(
'0'
).
for
(
:version
)
}
it
{
is_expected
.
to
allow_value
(
'1'
).
for
(
:version
)
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录