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
9e79d18d
Commit
9e79d18d
authored
Jan 18, 2018
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'upstream/master' into ce-to-ee-2018-01-18
parents
2a993dda
a4eb71dc
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
190 additions
and
69 deletions
+190
-69
app/assets/javascripts/pages/search/show/search.js
app/assets/javascripts/pages/search/show/search.js
+2
-0
app/assets/stylesheets/framework/files.scss
app/assets/stylesheets/framework/files.scss
+4
-0
app/assets/stylesheets/pages/cycle_analytics.scss
app/assets/stylesheets/pages/cycle_analytics.scss
+0
-41
changelogs/unreleased/41743-unused-selectors-for-cycle-analytics.yml
...unreleased/41743-unused-selectors-for-cycle-analytics.yml
+5
-0
changelogs/unreleased/file-content-large-screen-padding.yml
changelogs/unreleased/file-content-large-screen-padding.yml
+5
-0
changelogs/unreleased/winh-search-page-filters.yml
changelogs/unreleased/winh-search-page-filters.yml
+5
-0
db/migrate/20171215113714_populate_can_push_from_deploy_keys_projects.rb
...1215113714_populate_can_push_from_deploy_keys_projects.rb
+34
-14
db/post_migrate/20171215121205_post_populate_can_push_from_deploy_keys_projects.rb
...21205_post_populate_can_push_from_deploy_keys_projects.rb
+34
-14
spec/javascripts/fixtures/search.rb
spec/javascripts/fixtures/search.rb
+18
-0
spec/javascripts/search_spec.js
spec/javascripts/search_spec.js
+40
-0
spec/migrations/populate_can_push_from_deploy_keys_projects_spec.rb
...tions/populate_can_push_from_deploy_keys_projects_spec.rb
+43
-0
No files found.
app/assets/javascripts/pages/search/show/search.js
View file @
9e79d18d
...
...
@@ -15,6 +15,7 @@ export default class Search {
$groupDropdown
.
glDropdown
({
selectable
:
true
,
filterable
:
true
,
filterRemote
:
true
,
fieldName
:
'
group_id
'
,
search
:
{
fields
:
[
'
full_name
'
],
...
...
@@ -43,6 +44,7 @@ export default class Search {
$projectDropdown
.
glDropdown
({
selectable
:
true
,
filterable
:
true
,
filterRemote
:
true
,
fieldName
:
'
project_id
'
,
search
:
{
fields
:
[
'
name
'
],
...
...
app/assets/stylesheets/framework/files.scss
View file @
9e79d18d
...
...
@@ -124,6 +124,10 @@
&
.wiki
{
padding
:
$gl-padding
;
@media
(
min-width
:
$screen-md-min
)
{
padding
:
$gl-padding
*
2
;
}
}
&
.blob-no-preview
{
...
...
app/assets/stylesheets/pages/cycle_analytics.scss
View file @
9e79d18d
...
...
@@ -117,47 +117,6 @@
top
:
$gl-padding-top
;
}
.content-list
{
li
{
padding
:
18px
$gl-padding
$gl-padding
;
.container-fluid
{
padding
:
0
;
}
}
.title-col
{
p
{
margin
:
0
;
&
.title
{
line-height
:
19px
;
font-size
:
14px
;
font-weight
:
$gl-font-weight-bold
;
color
:
$gl-text-color
;
}
&
.text
{
color
:
$layout-link-gray
;
&
.value-col
{
color
:
$gl-text-color
;
}
}
}
}
.value-col
{
text-align
:
right
;
span
{
position
:
relative
;
vertical-align
:
middle
;
top
:
3px
;
}
}
}
.fa-spinner
{
font-size
:
28px
;
position
:
relative
;
...
...
changelogs/unreleased/41743-unused-selectors-for-cycle-analytics.yml
0 → 100644
View file @
9e79d18d
---
title
:
Remove unused CSS selectors for Cycle Analytics
merge_request
:
16270
author
:
Takuya Noguchi
type
:
other
changelogs/unreleased/file-content-large-screen-padding.yml
0 → 100644
View file @
9e79d18d
---
title
:
Double padding for file-content wiki class on larger screens
merge_request
:
author
:
type
:
changed
changelogs/unreleased/winh-search-page-filters.yml
0 → 100644
View file @
9e79d18d
---
title
:
Filter groups and projects dropdowns of search page on backend
merge_request
:
16336
author
:
type
:
fixed
db/migrate/20171215113714_populate_can_push_from_deploy_keys_projects.rb
View file @
9e79d18d
...
...
@@ -6,6 +6,8 @@ class PopulateCanPushFromDeployKeysProjects < ActiveRecord::Migration
# Set this constant to true if this migration requires downtime.
DOWNTIME
=
false
DATABASE_NAME
=
Gitlab
::
Database
.
database_name
disable_ddl_transaction!
class
DeploysKeyProject
<
ActiveRecord
::
Base
...
...
@@ -18,13 +20,22 @@ class PopulateCanPushFromDeployKeysProjects < ActiveRecord::Migration
DeploysKeyProject
.
each_batch
(
of:
10_000
)
do
|
batch
|
start_id
,
end_id
=
batch
.
pluck
(
'MIN(id), MAX(id)'
).
first
execute
<<-
EOF
UPDATE deploy_keys_projects
SET can_push = keys.can_push
FROM keys
WHERE deploy_key_id = keys.id
AND deploy_keys_projects.id BETWEEN
#{
start_id
}
AND
#{
end_id
}
EOF
if
Gitlab
::
Database
.
mysql?
execute
<<-
EOF
.
strip_heredoc
UPDATE deploy_keys_projects,
#{
DATABASE_NAME
}
.keys
SET deploy_keys_projects.can_push =
#{
DATABASE_NAME
}
.keys.can_push
WHERE deploy_keys_projects.deploy_key_id =
#{
DATABASE_NAME
}
.keys.id
AND deploy_keys_projects.id BETWEEN
#{
start_id
}
AND
#{
end_id
}
EOF
else
execute
<<-
EOF
.
strip_heredoc
UPDATE deploy_keys_projects
SET can_push = keys.can_push
FROM keys
WHERE deploy_key_id = keys.id
AND deploy_keys_projects.id BETWEEN
#{
start_id
}
AND
#{
end_id
}
EOF
end
end
end
...
...
@@ -32,13 +43,22 @@ class PopulateCanPushFromDeployKeysProjects < ActiveRecord::Migration
DeploysKeyProject
.
each_batch
(
of:
10_000
)
do
|
batch
|
start_id
,
end_id
=
batch
.
pluck
(
'MIN(id), MAX(id)'
).
first
execute
<<-
EOF
UPDATE keys
SET can_push = deploy_keys_projects.can_push
FROM deploy_keys_projects
WHERE deploy_keys_projects.deploy_key_id = keys.id
AND deploy_keys_projects.id BETWEEN
#{
start_id
}
AND
#{
end_id
}
EOF
if
Gitlab
::
Database
.
mysql?
execute
<<-
EOF
.
strip_heredoc
UPDATE deploy_keys_projects,
#{
DATABASE_NAME
}
.keys
SET
#{
DATABASE_NAME
}
.keys.can_push = deploy_keys_projects.can_push
WHERE deploy_keys_projects.deploy_key_id =
#{
DATABASE_NAME
}
.keys.id
AND deploy_keys_projects.id BETWEEN
#{
start_id
}
AND
#{
end_id
}
EOF
else
execute
<<-
EOF
.
strip_heredoc
UPDATE keys
SET can_push = deploy_keys_projects.can_push
FROM deploy_keys_projects
WHERE deploy_keys_projects.deploy_key_id = keys.id
AND deploy_keys_projects.id BETWEEN
#{
start_id
}
AND
#{
end_id
}
EOF
end
end
end
end
db/post_migrate/20171215121205_post_populate_can_push_from_deploy_keys_projects.rb
View file @
9e79d18d
...
...
@@ -5,6 +5,8 @@ class PostPopulateCanPushFromDeployKeysProjects < ActiveRecord::Migration
include
Gitlab
::
Database
::
MigrationHelpers
DOWNTIME
=
false
DATABASE_NAME
=
Gitlab
::
Database
.
database_name
disable_ddl_transaction!
class
DeploysKeyProject
<
ActiveRecord
::
Base
...
...
@@ -17,13 +19,22 @@ class PostPopulateCanPushFromDeployKeysProjects < ActiveRecord::Migration
DeploysKeyProject
.
each_batch
(
of:
10_000
)
do
|
batch
|
start_id
,
end_id
=
batch
.
pluck
(
'MIN(id), MAX(id)'
).
first
execute
<<-
EOF
UPDATE deploy_keys_projects
SET can_push = keys.can_push
FROM keys
WHERE deploy_key_id = keys.id
AND deploy_keys_projects.id BETWEEN
#{
start_id
}
AND
#{
end_id
}
EOF
if
Gitlab
::
Database
.
mysql?
execute
<<-
EOF
.
strip_heredoc
UPDATE deploy_keys_projects,
#{
DATABASE_NAME
}
.keys
SET deploy_keys_projects.can_push =
#{
DATABASE_NAME
}
.keys.can_push
WHERE deploy_keys_projects.deploy_key_id =
#{
DATABASE_NAME
}
.keys.id
AND deploy_keys_projects.id BETWEEN
#{
start_id
}
AND
#{
end_id
}
EOF
else
execute
<<-
EOF
.
strip_heredoc
UPDATE deploy_keys_projects
SET can_push = keys.can_push
FROM keys
WHERE deploy_key_id = keys.id
AND deploy_keys_projects.id BETWEEN
#{
start_id
}
AND
#{
end_id
}
EOF
end
end
end
...
...
@@ -31,13 +42,22 @@ class PostPopulateCanPushFromDeployKeysProjects < ActiveRecord::Migration
DeploysKeyProject
.
each_batch
(
of:
10_000
)
do
|
batch
|
start_id
,
end_id
=
batch
.
pluck
(
'MIN(id), MAX(id)'
).
first
execute
<<-
EOF
UPDATE keys
SET can_push = deploy_keys_projects.can_push
FROM deploy_keys_projects
WHERE deploy_keys_projects.deploy_key_id = keys.id
AND deploy_keys_projects.id BETWEEN
#{
start_id
}
AND
#{
end_id
}
EOF
if
Gitlab
::
Database
.
mysql?
execute
<<-
EOF
.
strip_heredoc
UPDATE deploy_keys_projects,
#{
DATABASE_NAME
}
.keys
SET
#{
DATABASE_NAME
}
.keys.can_push = deploy_keys_projects.can_push
WHERE deploy_keys_projects.deploy_key_id =
#{
DATABASE_NAME
}
.keys.id
AND deploy_keys_projects.id BETWEEN
#{
start_id
}
AND
#{
end_id
}
EOF
else
execute
<<-
EOF
.
strip_heredoc
UPDATE keys
SET can_push = deploy_keys_projects.can_push
FROM deploy_keys_projects
WHERE deploy_keys_projects.deploy_key_id = keys.id
AND deploy_keys_projects.id BETWEEN
#{
start_id
}
AND
#{
end_id
}
EOF
end
end
end
end
spec/javascripts/fixtures/search.rb
0 → 100644
View file @
9e79d18d
require
'spec_helper'
describe
SearchController
,
'(JavaScript fixtures)'
,
type: :controller
do
include
JavaScriptFixturesHelpers
render_views
before
(
:all
)
do
clean_frontend_fixtures
(
'search/'
)
end
it
'search/show.html.raw'
do
|
example
|
get
:show
expect
(
response
).
to
be_success
store_frontend_fixture
(
response
,
example
.
description
)
end
end
spec/javascripts/search_spec.js
0 → 100644
View file @
9e79d18d
import
Api
from
'
~/api
'
;
import
Search
from
'
~/pages/search/show/search
'
;
describe
(
'
Search
'
,
()
=>
{
const
fixturePath
=
'
search/show.html.raw
'
;
const
searchTerm
=
'
some search
'
;
const
fillDropdownInput
=
(
dropdownSelector
)
=>
{
const
dropdownElement
=
document
.
querySelector
(
dropdownSelector
).
parentNode
;
const
inputElement
=
dropdownElement
.
querySelector
(
'
.dropdown-input-field
'
);
inputElement
.
value
=
searchTerm
;
return
inputElement
;
};
preloadFixtures
(
fixturePath
);
beforeEach
(()
=>
{
loadFixtures
(
fixturePath
);
new
Search
();
// eslint-disable-line no-new
});
it
(
'
requests groups from backend when filtering
'
,
(
done
)
=>
{
spyOn
(
Api
,
'
groups
'
).
and
.
callFake
((
term
)
=>
{
expect
(
term
).
toBe
(
searchTerm
);
done
();
});
const
inputElement
=
fillDropdownInput
(
'
.js-search-group-dropdown
'
);
$
(
inputElement
).
trigger
(
'
input
'
);
});
it
(
'
requests projects from backend when filtering
'
,
(
done
)
=>
{
spyOn
(
Api
,
'
projects
'
).
and
.
callFake
((
term
)
=>
{
expect
(
term
).
toBe
(
searchTerm
);
done
();
});
const
inputElement
=
fillDropdownInput
(
'
.js-search-project-dropdown
'
);
$
(
inputElement
).
trigger
(
'
input
'
);
});
});
spec/migrations/populate_can_push_from_deploy_keys_projects_spec.rb
0 → 100644
View file @
9e79d18d
require
'spec_helper'
require
Rails
.
root
.
join
(
'db'
,
'migrate'
,
'20171215113714_populate_can_push_from_deploy_keys_projects.rb'
)
describe
PopulateCanPushFromDeployKeysProjects
,
:migration
do
let
(
:migration
)
{
described_class
.
new
}
let
(
:deploy_keys
)
{
table
(
:keys
)
}
let
(
:deploy_keys_projects
)
{
table
(
:deploy_keys_projects
)
}
let
(
:projects
)
{
table
(
:projects
)
}
before
do
deploy_keys
.
inheritance_column
=
nil
projects
.
create!
(
id:
1
,
name:
'gitlab1'
,
path:
'gitlab1'
)
(
1
..
10
).
each
do
|
index
|
deploy_keys
.
create!
(
id:
index
,
title:
'dummy'
,
type:
'DeployKey'
,
key:
Spec
::
Support
::
Helpers
::
KeyGeneratorHelper
.
new
(
1024
).
generate
+
' dummy@gitlab.com'
)
deploy_keys_projects
.
create!
(
id:
index
,
deploy_key_id:
index
,
project_id:
1
)
end
end
describe
'#up'
do
it
'migrates can_push from deploy_keys to deploy_keys_projects'
do
deploy_keys
.
limit
(
5
).
update_all
(
can_push:
true
)
expected
=
deploy_keys
.
order
(
:id
).
pluck
(
:id
,
:can_push
)
migration
.
up
expect
(
deploy_keys_projects
.
order
(
:id
).
pluck
(
:deploy_key_id
,
:can_push
)).
to
eq
expected
end
end
describe
'#down'
do
it
'migrates can_push from deploy_keys_projects to deploy_keys'
do
deploy_keys_projects
.
limit
(
5
).
update_all
(
can_push:
true
)
expected
=
deploy_keys_projects
.
order
(
:id
).
pluck
(
:deploy_key_id
,
:can_push
)
migration
.
down
expect
(
deploy_keys
.
order
(
:id
).
pluck
(
:id
,
:can_push
)).
to
eq
expected
end
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