Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
4467c425
Commit
4467c425
authored
Oct 23, 2015
by
Kamil Trzcinski
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'fix-ci-regressions' into 8-1-stable
parents
71218345
940a7fc1
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
58 additions
and
31 deletions
+58
-31
CHANGELOG
CHANGELOG
+2
-0
app/assets/javascripts/ci/build.coffee
app/assets/javascripts/ci/build.coffee
+1
-1
app/controllers/ci/admin/runners_controller.rb
app/controllers/ci/admin/runners_controller.rb
+1
-0
app/controllers/ci/application_controller.rb
app/controllers/ci/application_controller.rb
+0
-8
app/controllers/projects/builds_controller.rb
app/controllers/projects/builds_controller.rb
+12
-5
app/controllers/projects/commit_controller.rb
app/controllers/projects/commit_controller.rb
+10
-1
app/models/ci/project.rb
app/models/ci/project.rb
+1
-0
app/models/commit_status.rb
app/models/commit_status.rb
+0
-1
app/views/ci/admin/runners/show.html.haml
app/views/ci/admin/runners/show.html.haml
+18
-12
app/views/ci/lints/_create.html.haml
app/views/ci/lints/_create.html.haml
+6
-1
app/views/projects/builds/show.html.haml
app/views/projects/builds/show.html.haml
+1
-1
db/migrate/20151023112551_fail_build_with_empty_name.rb
db/migrate/20151023112551_fail_build_with_empty_name.rb
+5
-0
db/schema.rb
db/schema.rb
+1
-1
No files found.
CHANGELOG
View file @
4467c425
...
...
@@ -24,6 +24,8 @@ v 8.1.0
- Fix error preventing displaying of commit data for a directory with a leading dot (Stan Hu)
- Speed up load times of issue detail pages by roughly 1.5x
- Require CI jobs to be named
- Fix CI rendering regressions
- Allow developer to manage builds
- If a merge request is to close an issue, show this on the issue page (Zeger-Jan van de Weg)
- Add a system note and update relevant merge requests when a branch is deleted or re-added (Stan Hu)
- Make diff file view easier to use on mobile screens (Stan Hu)
...
...
app/assets/javascripts/ci/build.coffee
View file @
4467c425
...
...
@@ -31,7 +31,7 @@ class CiBuild
$
(
'#build-trace code'
).
html
build
.
trace_html
$
(
'#build-trace code'
).
append
'<i class="fa fa-refresh fa-spin"/>'
@
checkAutoscroll
()
else
else
if
build
.
status
!=
build_status
Turbolinks
.
visit
build_url
,
4000
...
...
app/controllers/ci/admin/runners_controller.rb
View file @
4467c425
...
...
@@ -17,6 +17,7 @@ module Ci
@projects
=
@projects
.
where
(
gitlab_id:
@gl_projects
.
select
(
:id
))
end
@projects
=
@projects
.
where
(
"ci_projects.id NOT IN (?)"
,
@runner
.
projects
.
pluck
(
:id
))
if
@runner
.
projects
.
any?
@projects
=
@projects
.
joins
(
:gl_project
)
@projects
=
@projects
.
page
(
params
[
:page
]).
per
(
30
)
end
...
...
app/controllers/ci/application_controller.rb
View file @
4467c425
...
...
@@ -8,14 +8,6 @@ module Ci
private
def
authenticate_public_page!
unless
project
.
public
authenticate_user!
return
access_denied!
unless
can?
(
current_user
,
:read_project
,
gl_project
)
end
end
def
authenticate_token!
unless
project
.
valid_token?
(
params
[
:token
])
return
head
(
403
)
...
...
app/controllers/projects/builds_controller.rb
View file @
4467c425
...
...
@@ -2,23 +2,24 @@ class Projects::BuildsController < Projects::ApplicationController
before_action
:ci_project
before_action
:build
,
except:
[
:index
,
:cancel_all
]
before_action
:authorize_
admin_project
!
,
except:
[
:index
,
:show
,
:status
]
before_action
:authorize_
manage_builds
!
,
except:
[
:index
,
:show
,
:status
]
layout
"project"
def
index
@scope
=
params
[
:scope
]
@all_builds
=
project
.
ci_builds
@builds
=
@all_builds
.
order
(
'created_at DESC'
)
@builds
=
case
@scope
when
'all'
@
all_
builds
@builds
when
'finished'
@
all_
builds
.
finished
@builds
.
finished
else
@
all_builds
.
running_or_pending
@
builds
.
running_or_pending
.
reverse_order
end
@builds
=
@builds
.
order
(
'created_at DESC'
).
page
(
params
[
:page
]).
per
(
30
)
@builds
=
@builds
.
page
(
params
[
:page
]).
per
(
30
)
end
def
cancel_all
...
...
@@ -73,4 +74,10 @@ class Projects::BuildsController < Projects::ApplicationController
def
build_path
(
build
)
namespace_project_build_path
(
build
.
gl_project
.
namespace
,
build
.
gl_project
,
build
)
end
def
authorize_manage_builds!
unless
can?
(
current_user
,
:manage_builds
,
project
)
return
page_404
end
end
end
app/controllers/projects/commit_controller.rb
View file @
4467c425
...
...
@@ -4,7 +4,8 @@
class
Projects::CommitController
<
Projects
::
ApplicationController
# Authorize
before_action
:require_non_empty_project
before_action
:authorize_download_code!
before_action
:authorize_download_code!
,
except:
[
:cancel_builds
]
before_action
:authorize_manage_builds!
,
only:
[
:cancel_builds
]
before_action
:commit
def
show
...
...
@@ -55,4 +56,12 @@ class Projects::CommitController < Projects::ApplicationController
def
commit
@commit
||=
@project
.
commit
(
params
[
:id
])
end
private
def
authorize_manage_builds!
unless
can?
(
current_user
,
:manage_builds
,
project
)
return
page_404
end
end
end
app/models/ci/project.rb
View file @
4467c425
...
...
@@ -99,6 +99,7 @@ module Ci
def
ordered_by_last_commit_date
last_commit_subquery
=
"(SELECT gl_project_id, MAX(committed_at) committed_at FROM
#{
Ci
::
Commit
.
table_name
}
GROUP BY gl_project_id)"
joins
(
"LEFT JOIN
#{
last_commit_subquery
}
AS last_commit ON
#{
Ci
::
Project
.
table_name
}
.gitlab_id = last_commit.gl_project_id"
).
joins
(
:gl_project
).
order
(
"CASE WHEN last_commit.committed_at IS NULL THEN 1 ELSE 0 END, last_commit.committed_at DESC"
)
end
end
...
...
app/models/commit_status.rb
View file @
4467c425
...
...
@@ -20,7 +20,6 @@ class CommitStatus < ActiveRecord::Base
scope
:latest
,
->
{
where
(
id:
unscope
(
:select
).
select
(
'max(id)'
).
group
(
:name
,
:ref
))
}
scope
:ordered
,
->
{
order
(
:ref
,
:stage_idx
,
:name
)
}
scope
:for_ref
,
->
(
ref
)
{
where
(
ref:
ref
)
}
scope
:running_or_pending
,
->
{
where
(
status:
[
:running
,
:pending
])
}
state_machine
:status
,
initial: :pending
do
event
:run
do
...
...
app/views/ci/admin/runners/show.html.haml
View file @
4467c425
...
...
@@ -53,13 +53,14 @@
%th
-
@runner
.
runner_projects
.
each
do
|
runner_project
|
-
project
=
runner_project
.
project
%tr
.alert-info
%td
%strong
=
project
.
name
%td
.pull-right
=
link_to
'Disable'
,
[
:ci
,
:admin
,
project
,
runner_project
],
method: :delete
,
class:
'btn btn-danger btn-xs'
-
if
project
.
gl_project
%tr
.alert-info
%td
%strong
=
project
.
name
%td
.pull-right
=
link_to
'Disable'
,
[
:ci
,
:admin
,
project
,
runner_project
],
method: :delete
,
class:
'btn btn-danger btn-xs'
%table
.table
%thead
...
...
@@ -103,21 +104,26 @@
%th
Finished at
-
@builds
.
each
do
|
build
|
-
gl_project
=
build
.
gl_project
%tr
.build
%td
.id
-
gl_project
=
build
.
project
.
gl_project
=
link_to
namespace_project_build_path
(
gl_project
.
namespace
,
gl_project
,
build
)
do
-
if
gl_project
=
link_to
namespace_project_build_path
(
gl_project
.
namespace
,
gl_project
,
build
)
do
=
build
.
id
-
else
=
build
.
id
%td
.status
=
ci_status_with_icon
(
build
.
status
)
%td
.status
=
build
.
project
.
name
-
if
gl_project
=
gl_project
.
name_with_namespace
%td
.build-link
=
link_to
ci_status_path
(
build
.
commit
)
do
%strong
#{
build
.
commit
.
short_sha
}
-
if
gl_project
=
link_to
ci_status_path
(
build
.
commit
)
do
%strong
#{
build
.
commit
.
short_sha
}
%td
.timestamp
-
if
build
.
finished_at
...
...
app/views/ci/lints/_create.html.haml
View file @
4467c425
...
...
@@ -16,7 +16,7 @@
%td
#{
stage
.
capitalize
}
Job -
#{
build
[
:name
]
}
%td
%pre
=
simple_format
build
[
:
script
]
=
simple_format
build
[
:
commands
]
%br
%b
Tag list:
...
...
@@ -27,6 +27,11 @@
%br
%b
Refs except:
=
build
[
:except
]
&&
build
[
:except
].
join
(
", "
)
%br
%b
When:
=
build
[
:when
]
-
if
build
[
:allow_failure
]
%b
Allowed to fail
-
else
%p
...
...
app/views/projects/builds/show.html.haml
View file @
4467c425
...
...
@@ -155,7 +155,7 @@
-
if
@builds
.
present?
.build-widget
%h4
.title
#{
pluralize
(
@builds
.
count
,
"other build"
)
}
for
#{
@build
.
short_sha
}
:
%h4
.title
#{
pluralize
(
@builds
.
count
(
:id
)
,
"other build"
)
}
for
#{
@build
.
short_sha
}
:
%table
.table.builds
-
@builds
.
each_with_index
do
|
build
,
i
|
%tr
.build
...
...
db/migrate/20151023112551_fail_build_with_empty_name.rb
0 → 100644
View file @
4467c425
class
FailBuildWithEmptyName
<
ActiveRecord
::
Migration
def
change
execute
(
"UPDATE ci_builds SET status='failed' WHERE (name IS NULL OR name='') AND status='pending'"
)
end
end
db/schema.rb
View file @
4467c425
...
...
@@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord
::
Schema
.
define
(
version:
2015102
0173906
)
do
ActiveRecord
::
Schema
.
define
(
version:
2015102
3112551
)
do
# These are extensions that must be enabled in order to support this database
enable_extension
"plpgsql"
...
...
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