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
81cdb9a1
Commit
81cdb9a1
authored
Jul 24, 2018
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'upstream/master' into ce-to-ee-2018-07-24
parents
83b2da49
d1148002
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
28 additions
and
3 deletions
+28
-3
changelogs/unreleased/sh-revert-markdown-changes.yml
changelogs/unreleased/sh-revert-markdown-changes.yml
+5
-0
doc/development/background_migrations.md
doc/development/background_migrations.md
+8
-0
lib/banzai/filter/sanitization_filter.rb
lib/banzai/filter/sanitization_filter.rb
+1
-1
spec/lib/banzai/filter/sanitization_filter_spec.rb
spec/lib/banzai/filter/sanitization_filter_spec.rb
+12
-0
spec/lib/gitlab/background_migration/delete_diff_files_spec.rb
...lib/gitlab/background_migration/delete_diff_files_spec.rb
+1
-1
spec/lib/gitlab/background_migration/schedule_diff_files_deletion_spec.rb
...background_migration/schedule_diff_files_deletion_spec.rb
+1
-1
No files found.
changelogs/unreleased/sh-revert-markdown-changes.yml
0 → 100644
View file @
81cdb9a1
---
title
:
Fix slow Markdown rendering
merge_request
:
20820
author
:
type
:
performance
doc/development/background_migrations.md
View file @
81cdb9a1
...
...
@@ -296,10 +296,18 @@ for more details.
## Best practices
1.
Make sure to know how much data you're dealing with
1.
Make sure that background migration jobs are idempotent.
1.
Make sure that tests you write are not false positives.
1.
Make sure that if the data being migrated is critical and cannot be lost, the
clean-up migration also checks the final state of the data before completing.
1.
Make sure to know how much time it'll take to run all scheduled migrations
1.
When migrating many columns, make sure it won't generate too many
dead tuples in the process (you may need to directly query the number of dead tuples
and adjust the scheduling according to this piece of data)
1.
Make sure to discuss the numbers with a database specialist, the migration may add
more pressure on DB than you expect (measure on staging,
or ask someone to measure on production)
[
migrations-readme
]:
https://gitlab.com/gitlab-org/gitlab-ce/blob/master/spec/migrations/README.md
[
issue-rspec-hooks
]:
https://gitlab.com/gitlab-org/gitlab-ce/issues/35351
...
...
lib/banzai/filter/sanitization_filter.rb
View file @
81cdb9a1
...
...
@@ -13,7 +13,7 @@ module Banzai
def
whitelist
strong_memoize
(
:whitelist
)
do
customize_whitelist
(
super
.
dup
)
customize_whitelist
(
super
.
d
eep_d
up
)
end
end
...
...
spec/lib/banzai/filter/sanitization_filter_spec.rb
View file @
81cdb9a1
...
...
@@ -54,6 +54,18 @@ describe Banzai::Filter::SanitizationFilter do
expect
(
instance
.
whitelist
[
:transformers
].
size
).
to
eq
control_count
end
it
'customizes the whitelist only once for different instances'
do
instance1
=
described_class
.
new
(
'Foo1'
)
instance2
=
described_class
.
new
(
'Foo2'
)
control_count
=
instance1
.
whitelist
[
:transformers
].
size
instance1
.
whitelist
instance2
.
whitelist
expect
(
instance1
.
whitelist
[
:transformers
].
size
).
to
eq
control_count
expect
(
instance2
.
whitelist
[
:transformers
].
size
).
to
eq
control_count
end
it
'sanitizes `class` attribute from all elements'
do
act
=
%q{<pre class="code highlight white c"><code><span class="k">def</span></code></pre>}
exp
=
%q{<pre><code><span class="k">def</span></code></pre>}
...
...
spec/lib/gitlab/background_migration/delete_diff_files_spec.rb
View file @
81cdb9a1
require
'spec_helper'
describe
Gitlab
::
BackgroundMigration
::
DeleteDiffFiles
,
:migration
,
schema:
20180619121030
do
describe
Gitlab
::
BackgroundMigration
::
DeleteDiffFiles
,
:migration
,
:sidekiq
,
schema:
20180619121030
do
describe
'#perform'
do
context
'when diff files can be deleted'
do
let
(
:merge_request
)
{
create
(
:merge_request
,
:merged
)
}
...
...
spec/lib/gitlab/background_migration/schedule_diff_files_deletion_spec.rb
View file @
81cdb9a1
require
'spec_helper'
describe
Gitlab
::
BackgroundMigration
::
ScheduleDiffFilesDeletion
,
:migration
,
schema:
20180619121030
do
describe
Gitlab
::
BackgroundMigration
::
ScheduleDiffFilesDeletion
,
:migration
,
:sidekiq
,
schema:
20180619121030
do
describe
'#perform'
do
let
(
:merge_request_diffs
)
{
table
(
:merge_request_diffs
)
}
let
(
:merge_requests
)
{
table
(
:merge_requests
)
}
...
...
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