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
cce9e50b
Commit
cce9e50b
authored
Jul 03, 2018
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'upstream/master' into ce-to-ee-2018-07-03
parents
b7aef3ae
cd578941
Changes
15
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
88 additions
and
11 deletions
+88
-11
app/assets/stylesheets/framework/header.scss
app/assets/stylesheets/framework/header.scss
+0
-2
app/controllers/admin/hooks_controller.rb
app/controllers/admin/hooks_controller.rb
+1
-2
app/controllers/projects/hooks_controller.rb
app/controllers/projects/hooks_controller.rb
+1
-2
app/models/hooks/web_hook_log.rb
app/models/hooks/web_hook_log.rb
+5
-0
app/views/layouts/header/_default.html.haml
app/views/layouts/header/_default.html.haml
+1
-1
changelogs/unreleased/18141-osw-use-monospaced-font-on-diffs-commit-ref.yml
...sed/18141-osw-use-monospaced-font-on-diffs-commit-ref.yml
+5
-0
changelogs/unreleased/48634-header-navbar-line-separator-is-missing.yml
...eleased/48634-header-navbar-line-separator-is-missing.yml
+5
-0
changelogs/unreleased/web-hooks-log-pagination.yml
changelogs/unreleased/web-hooks-log-pagination.yml
+5
-0
db/migrate/20180628124813_alter_web_hook_logs_indexes.rb
db/migrate/20180628124813_alter_web_hook_logs_indexes.rb
+28
-0
db/schema.rb
db/schema.rb
+1
-0
lib/banzai/filter/merge_request_reference_filter.rb
lib/banzai/filter/merge_request_reference_filter.rb
+4
-1
lib/banzai/filter/reference_filter.rb
lib/banzai/filter/reference_filter.rb
+6
-2
qa/qa/page/project/settings/deploy_keys.rb
qa/qa/page/project/settings/deploy_keys.rb
+1
-1
spec/lib/banzai/filter/merge_request_reference_filter_spec.rb
.../lib/banzai/filter/merge_request_reference_filter_spec.rb
+7
-0
spec/models/hooks/web_hook_log_spec.rb
spec/models/hooks/web_hook_log_spec.rb
+18
-0
No files found.
app/assets/stylesheets/framework/header.scss
View file @
cce9e50b
...
...
@@ -268,8 +268,6 @@
.navbar-sub-nav
,
.navbar-nav
{
align-items
:
center
;
>
li
{
>
a
:hover
,
>
a
:focus
{
...
...
app/controllers/admin/hooks_controller.rb
View file @
cce9e50b
...
...
@@ -52,8 +52,7 @@ class Admin::HooksController < Admin::ApplicationController
end
def
hook_logs
@hook_logs
||=
Kaminari
.
paginate_array
(
hook
.
web_hook_logs
.
order
(
created_at: :desc
)).
page
(
params
[
:page
])
@hook_logs
||=
hook
.
web_hook_logs
.
recent
.
page
(
params
[
:page
])
end
def
hook_params
...
...
app/controllers/projects/hooks_controller.rb
View file @
cce9e50b
...
...
@@ -58,8 +58,7 @@ class Projects::HooksController < Projects::ApplicationController
end
def
hook_logs
@hook_logs
||=
Kaminari
.
paginate_array
(
hook
.
web_hook_logs
.
order
(
created_at: :desc
)).
page
(
params
[
:page
])
@hook_logs
||=
hook
.
web_hook_logs
.
recent
.
page
(
params
[
:page
])
end
def
hook_params
...
...
app/models/hooks/web_hook_log.rb
View file @
cce9e50b
...
...
@@ -7,6 +7,11 @@ class WebHookLog < ActiveRecord::Base
validates
:web_hook
,
presence:
true
def
self
.
recent
where
(
'created_at >= ?'
,
2
.
days
.
ago
.
beginning_of_day
)
.
order
(
created_at: :desc
)
end
def
success?
response_status
=~
/^2/
end
...
...
app/views/layouts/header/_default.html.haml
View file @
cce9e50b
...
...
@@ -21,7 +21,7 @@
-
if
current_user
=
render
'layouts/header/new_dropdown'
-
if
header_link?
(
:search
)
%li
.nav-item.d-none.d-sm-none.d-md-block
%li
.nav-item.d-none.d-sm-none.d-md-block
.m-auto
=
render
'layouts/search'
unless
current_controller?
(
:search
)
%li
.nav-item.d-inline-block.d-sm-none.d-md-none
=
link_to
search_path
,
title:
'Search'
,
aria:
{
label:
"Search"
},
data:
{
toggle:
'tooltip'
,
placement:
'bottom'
,
container:
'body'
}
do
...
...
changelogs/unreleased/18141-osw-use-monospaced-font-on-diffs-commit-ref.yml
0 → 100644
View file @
cce9e50b
---
title
:
Use monospaced font for MR diff commit link ref on GFM
merge_request
:
author
:
type
:
other
changelogs/unreleased/48634-header-navbar-line-separator-is-missing.yml
0 → 100644
View file @
cce9e50b
---
title
:
Line separator to the left of the 'Admin area' wrench icon had vanished
merge_request
:
20282
author
:
bitsapien
type
:
fixed
changelogs/unreleased/web-hooks-log-pagination.yml
0 → 100644
View file @
cce9e50b
---
title
:
Fixed pagination of web hook logs
merge_request
:
author
:
type
:
performance
db/migrate/20180628124813_alter_web_hook_logs_indexes.rb
0 → 100644
View file @
cce9e50b
# frozen_string_literal: true
# See http://doc.gitlab.com/ce/development/migration_style_guide.html
# for more information on how to write migrations for GitLab.
class
AlterWebHookLogsIndexes
<
ActiveRecord
::
Migration
include
Gitlab
::
Database
::
MigrationHelpers
# Set this constant to true if this migration requires downtime.
DOWNTIME
=
false
disable_ddl_transaction!
# "created_at" comes first so the Sidekiq worker pruning old webhook logs can
# use a composite index index.
#
# We leave the old standalone index on "web_hook_id" in place so future code
# that doesn't care about "created_at" can still use that index.
COLUMNS_TO_INDEX
=
%i[created_at web_hook_id]
def
up
add_concurrent_index
(
:web_hook_logs
,
COLUMNS_TO_INDEX
)
end
def
down
remove_concurrent_index
(
:web_hook_logs
,
COLUMNS_TO_INDEX
)
end
end
db/schema.rb
View file @
cce9e50b
...
...
@@ -2745,6 +2745,7 @@ ActiveRecord::Schema.define(version: 20180702114215) do
t
.
datetime
"updated_at"
,
null:
false
end
add_index
"web_hook_logs"
,
[
"created_at"
,
"web_hook_id"
],
name:
"index_web_hook_logs_on_created_at_and_web_hook_id"
,
using: :btree
add_index
"web_hook_logs"
,
[
"web_hook_id"
],
name:
"index_web_hook_logs_on_web_hook_id"
,
using: :btree
create_table
"web_hooks"
,
force: :cascade
do
|
t
|
...
...
lib/banzai/filter/merge_request_reference_filter.rb
View file @
cce9e50b
...
...
@@ -25,7 +25,10 @@ module Banzai
extras
=
super
if
commit_ref
=
object_link_commit_ref
(
object
,
matches
)
return
extras
.
unshift
(
commit_ref
)
klass
=
reference_class
(
:commit
,
tooltip:
false
)
commit_ref_tag
=
%(<span class="#{klass}">#{commit_ref}</span>)
return
extras
.
unshift
(
commit_ref_tag
)
end
path
=
matches
[
:path
]
if
matches
.
names
.
include?
(
"path"
)
...
...
lib/banzai/filter/reference_filter.rb
View file @
cce9e50b
...
...
@@ -65,8 +65,12 @@ module Banzai
context
[
:skip_project_check
]
end
def
reference_class
(
type
)
"gfm gfm-
#{
type
}
has-tooltip"
def
reference_class
(
type
,
tooltip:
true
)
gfm_klass
=
"gfm gfm-
#{
type
}
"
return
gfm_klass
unless
tooltip
"
#{
gfm_klass
}
has-tooltip"
end
# Ensure that a :project key exists in context
...
...
qa/qa/page/project/settings/deploy_keys.rb
View file @
cce9e50b
...
...
@@ -58,7 +58,7 @@ module QA
def
within_project_deploy_keys
wait
(
reload:
false
)
do
find_element
(
:project_deploy_keys
)
has_css?
(
element_selector_css
(
:project_deploy_keys
)
)
end
within_element
(
:project_deploy_keys
)
do
...
...
spec/lib/banzai/filter/merge_request_reference_filter_spec.rb
View file @
cce9e50b
...
...
@@ -210,6 +210,13 @@ describe Banzai::Filter::MergeRequestReferenceFilter do
.
to
eq
reference
end
it
'commit ref tag is valid'
do
doc
=
reference_filter
(
"See
#{
reference
}
"
)
commit_ref_tag
=
doc
.
css
(
'a'
).
first
.
css
(
'span.gfm.gfm-commit'
)
expect
(
commit_ref_tag
.
text
).
to
eq
(
commit
.
short_id
)
end
it
'has valid text'
do
doc
=
reference_filter
(
"See
#{
reference
}
"
)
...
...
spec/models/hooks/web_hook_log_spec.rb
View file @
cce9e50b
...
...
@@ -9,6 +9,24 @@ describe WebHookLog do
it
{
is_expected
.
to
validate_presence_of
(
:web_hook
)
}
describe
'.recent'
do
let
(
:hook
)
{
create
(
:project_hook
)
}
it
'does not return web hook logs that are too old'
do
create
(
:web_hook_log
,
web_hook:
hook
,
created_at:
91
.
days
.
ago
)
expect
(
described_class
.
recent
.
size
).
to
be_zero
end
it
'returns the web hook logs in descending order'
do
hook1
=
create
(
:web_hook_log
,
web_hook:
hook
,
created_at:
2
.
hours
.
ago
)
hook2
=
create
(
:web_hook_log
,
web_hook:
hook
,
created_at:
1
.
hour
.
ago
)
hooks
=
described_class
.
recent
.
to_a
expect
(
hooks
).
to
eq
([
hook2
,
hook1
])
end
end
describe
'#success?'
do
let
(
:web_hook_log
)
{
build
(
:web_hook_log
,
response_status:
status
)
}
...
...
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