Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
2605a0a8
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 搜索 >>
提交
2605a0a8
编写于
6月 01, 2016
作者:
J
Josh Frye
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Refactor. Add tests.
上级
4d9622e7
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
10 addition
and
17 deletion
+10
-17
CHANGELOG
CHANGELOG
+1
-0
app/models/ci/build.rb
app/models/ci/build.rb
+1
-1
app/models/project.rb
app/models/project.rb
+2
-6
app/views/layouts/nav/_project.html.haml
app/views/layouts/nav/_project.html.haml
+0
-9
app/views/projects/pipelines/_head.html.haml
app/views/projects/pipelines/_head.html.haml
+1
-1
features/project/builds/summary.feature
features/project/builds/summary.feature
+1
-0
features/steps/project/builds/summary.rb
features/steps/project/builds/summary.rb
+4
-0
未找到文件。
CHANGELOG
浏览文件 @
2605a0a8
...
...
@@ -28,6 +28,7 @@ v 8.9.0 (unreleased)
- Make authentication service for Container Registry to be compatible with < Docker 1.11
- Add Application Setting to configure Container Registry token expire delay (default 5min)
- Cache assigned issue and merge request counts in sidebar nav
- Cache project build count in sidebar nav
v 8.8.3
- Fix incorrect links on pipeline page when merge request created from fork
...
...
app/models/ci/build.rb
浏览文件 @
2605a0a8
...
...
@@ -313,7 +313,7 @@ module Ci
build_data
=
Gitlab
::
BuildDataBuilder
.
build
(
self
)
project
.
execute_hooks
(
build_data
.
dup
,
:build_hooks
)
project
.
execute_services
(
build_data
.
dup
,
:build_hooks
)
project
.
expire_running_or_pending_build_count
project
.
running_or_pending_build_count
(
force:
true
)
end
def
artifacts?
...
...
app/models/project.rb
浏览文件 @
2605a0a8
...
...
@@ -1012,13 +1012,9 @@ class Project < ActiveRecord::Base
update_attribute
(
:pending_delete
,
true
)
end
def
running_or_pending_build_count
Rails
.
cache
.
fetch
([
'projects'
,
id
,
'running_or_pending_build_count'
])
do
def
running_or_pending_build_count
(
force:
false
)
Rails
.
cache
.
fetch
([
'projects'
,
id
,
'running_or_pending_build_count'
]
,
force:
force
)
do
builds
.
running_or_pending
.
count
(
:all
)
end
end
def
expire_running_or_pending_build_count
Rails
.
cache
.
delete
([
'projects'
,
id
,
'running_or_pending_build_count'
])
end
end
app/views/layouts/nav/_project.html.haml
浏览文件 @
2605a0a8
...
...
@@ -52,15 +52,6 @@
=
icon
(
'ship fw'
)
%span
Pipelines
%span
.badge.count.ci_counter
=
number_with_delimiter
(
@project
.
ci_commits
.
running_or_pending
.
count
)
-
if
project_nav_tab?
:builds
=
nav_link
(
controller:
%w(builds)
)
do
=
link_to
project_builds_path
(
@project
),
title:
'Builds'
,
class:
'shortcuts-builds'
do
=
icon
(
'cubes fw'
)
%span
Builds
%span
.badge.count.builds_counter
=
number_with_delimiter
(
@project
.
running_or_pending_build_count
)
-
if
project_nav_tab?
:container_registry
=
nav_link
(
controller:
%w(container_registry)
)
do
...
...
app/views/projects/pipelines/_head.html.haml
浏览文件 @
2605a0a8
...
...
@@ -11,4 +11,4 @@
=
link_to
project_builds_path
(
@project
),
title:
'Builds'
,
class:
'shortcuts-builds'
do
%span
Builds
%span
.badge.count.builds_counter
=
number_with_delimiter
(
@project
.
builds
.
running_or_pending
.
count
(
:all
)
)
%span
.badge.count.builds_counter
=
number_with_delimiter
(
@project
.
running_or_pending_build_count
)
features/project/builds/summary.feature
浏览文件 @
2605a0a8
...
...
@@ -24,3 +24,4 @@ Feature: Project Builds Summary
Then
recent build has been erased
And
recent build summary does not have artifacts widget
And
recent build summary contains information saying that build has been erased
And
the build count cache is updated
features/steps/project/builds/summary.rb
浏览文件 @
2605a0a8
...
...
@@ -36,4 +36,8 @@ class Spinach::Features::ProjectBuildsSummary < Spinach::FeatureSteps
expect
(
page
).
to
have_content
'Build has been erased'
end
end
step
'the build count cache is updated'
do
expect
(
@build
.
project
.
running_or_pending_build_count
).
to
eq
@build
.
project
.
builds
.
running_or_pending
.
count
(
:all
)
end
end
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录