BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
c428aaac
Commit
c428aaac
authored
Mar 06, 2018
by
Shinya Maeda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert unnecessary code running_or_pending_build_count removal
parent
60664373
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
0 deletions
+9
-0
build.rb
app/models/ci/build.rb
+1
-0
project.rb
app/models/project.rb
+6
-0
user_browses_job_spec.rb
spec/features/projects/jobs/user_browses_job_spec.rb
+2
-0
No files found.
app/models/ci/build.rb
View file @
c428aaac
...
...
@@ -359,6 +359,7 @@ module Ci
project
.
execute_hooks
(
build_data
.
dup
,
:job_hooks
)
project
.
execute_services
(
build_data
.
dup
,
:job_hooks
)
PagesService
.
new
(
build_data
).
execute
project
.
running_or_pending_build_count
(
force:
true
)
end
def
artifacts_metadata_entry
(
path
,
**
options
)
...
...
app/models/project.rb
View file @
c428aaac
...
...
@@ -1494,6 +1494,12 @@ class Project < ActiveRecord::Base
update_column
(
:import_jid
,
nil
)
end
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
# Lazy loading of the `pipeline_status` attribute
def
pipeline_status
@pipeline_status
||=
Gitlab
::
Cache
::
Ci
::
ProjectPipelineStatus
.
load_for_project
(
self
)
...
...
spec/features/projects/jobs/user_browses_job_spec.rb
View file @
c428aaac
...
...
@@ -31,5 +31,7 @@ describe 'User browses a job', :js do
page
.
within
(
'.erased'
)
do
expect
(
page
).
to
have_content
(
'Job has been erased'
)
end
expect
(
build
.
project
.
running_or_pending_build_count
).
to
eq
(
build
.
project
.
builds
.
running_or_pending
.
count
(
:all
))
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment