Commit 1070558d authored by Filipa Lacerda's avatar Filipa Lacerda

Merge branch 'master' into 48960-namespace-diff-module

* master:
  Resolve "MR refactor: Performance costs of main element with `v-if`"
  Add documentation on private projects
  Make blob and other RPC's mandatory
  Removed return statements from prettier script
  Add missing strings to `locale/gitlab.pot`
  Update `gettext:updated_check` regenerate pot file
  Include wget in apk add command
  [Rails5] Fix 'Invalid single-table inheritance type: Group is not a subclass of Gitlab::BackgroundMigration::FixCrossProjectLabelLinks::Namespace'
  Updated color
  Update doc on new option to add README when creating a project
  Make more things mandatory
  Updated (color of indent guide in Web IDE
  Make all Gitaly diff flags mandatory
parents 81b9b6f4 67157de1
...@@ -15,9 +15,7 @@ export default { ...@@ -15,9 +15,7 @@ export default {
</script> </script>
<template> <template>
<div <div>
v-if="discussions.length"
>
<div <div
v-for="discussion in discussions" v-for="discussion in discussions"
:key="discussion.id" :key="discussion.id"
......
...@@ -47,6 +47,9 @@ export default { ...@@ -47,6 +47,9 @@ export default {
false, false,
); );
}, },
showExpandMessage() {
return this.isCollapsed && !this.isLoadingCollapsedDiff && !this.file.tooLarge;
},
}, },
mounted() { mounted() {
document.addEventListener('scroll', this.handleScroll); document.addEventListener('scroll', this.handleScroll);
...@@ -159,7 +162,7 @@ export default { ...@@ -159,7 +162,7 @@ export default {
</div> </div>
<diff-content <diff-content
v-show="!isCollapsed" v-if="!isCollapsed"
:class="{ hidden: isCollapsed || file.tooLarge }" :class="{ hidden: isCollapsed || file.tooLarge }"
:diff-file="file" :diff-file="file"
/> />
...@@ -168,7 +171,7 @@ export default { ...@@ -168,7 +171,7 @@ export default {
class="diff-content loading" class="diff-content loading"
/> />
<div <div
v-show="isCollapsed && !isLoadingCollapsedDiff && !file.tooLarge" v-if="showExpandMessage"
class="nothing-here-block diff-collapsed" class="nothing-here-block diff-collapsed"
> >
{{ __('This diff is collapsed.') }} {{ __('This diff is collapsed.') }}
......
...@@ -31,22 +31,9 @@ export default { ...@@ -31,22 +31,9 @@ export default {
diffLineCommentForms: state => state.diffs.diffLineCommentForms, diffLineCommentForms: state => state.diffs.diffLineCommentForms,
}), }),
...mapGetters(['discussionsByLineCode']), ...mapGetters(['discussionsByLineCode']),
isDiscussionExpanded() {
if (!this.discussions.length) {
return false;
}
return this.discussions.every(discussion => discussion.expanded);
},
hasCommentForm() {
return this.diffLineCommentForms[this.line.lineCode];
},
discussions() { discussions() {
return this.discussionsByLineCode[this.line.lineCode] || []; return this.discussionsByLineCode[this.line.lineCode] || [];
}, },
shouldRender() {
return this.isDiscussionExpanded || this.hasCommentForm;
},
className() { className() {
return this.discussions.length ? '' : 'js-temp-notes-holder'; return this.discussions.length ? '' : 'js-temp-notes-holder';
}, },
...@@ -56,7 +43,6 @@ export default { ...@@ -56,7 +43,6 @@ export default {
<template> <template>
<tr <tr
v-if="shouldRender"
:class="className" :class="className"
class="notes_holder" class="notes_holder"
> >
...@@ -67,6 +53,7 @@ export default { ...@@ -67,6 +53,7 @@ export default {
<td class="notes_content"> <td class="notes_content">
<div class="content"> <div class="content">
<diff-discussions <diff-discussions
v-if="discussions.length"
:discussions="discussions" :discussions="discussions"
/> />
<diff-line-note-form <diff-line-note-form
......
<script> <script>
import { mapGetters } from 'vuex'; import { mapGetters, mapState } from 'vuex';
import inlineDiffTableRow from './inline_diff_table_row.vue'; import inlineDiffTableRow from './inline_diff_table_row.vue';
import inlineDiffCommentRow from './inline_diff_comment_row.vue'; import inlineDiffCommentRow from './inline_diff_comment_row.vue';
import { trimFirstCharOfLineContent } from '../store/utils'; import { trimFirstCharOfLineContent } from '../store/utils';
...@@ -21,6 +21,10 @@ export default { ...@@ -21,6 +21,10 @@ export default {
}, },
computed: { computed: {
...mapGetters('diffs', ['commitId']), ...mapGetters('diffs', ['commitId']),
...mapGetters(['discussionsByLineCode']),
...mapState({
diffLineCommentForms: state => state.diffs.diffLineCommentForms,
}),
normalizedDiffLines() { normalizedDiffLines() {
return this.diffLines.map(line => (line.richText ? trimFirstCharOfLineContent(line) : line)); return this.diffLines.map(line => (line.richText ? trimFirstCharOfLineContent(line) : line));
}, },
...@@ -31,6 +35,18 @@ export default { ...@@ -31,6 +35,18 @@ export default {
return window.gon.user_color_scheme; return window.gon.user_color_scheme;
}, },
}, },
methods: {
shouldRenderCommentRow(line) {
if (this.diffLineCommentForms[line.lineCode]) return true;
const lineDiscussions = this.discussionsByLineCode[line.lineCode];
if (lineDiscussions === undefined) {
return false;
}
return lineDiscussions.every(discussion => discussion.expanded);
},
},
}; };
</script> </script>
...@@ -50,6 +66,7 @@ export default { ...@@ -50,6 +66,7 @@ export default {
:key="line.lineCode" :key="line.lineCode"
/> />
<inline-diff-comment-row <inline-diff-comment-row
v-if="shouldRenderCommentRow(line)"
:diff-file="diffFile" :diff-file="diffFile"
:diff-lines="normalizedDiffLines" :diff-lines="normalizedDiffLines"
:line="line" :line="line"
......
...@@ -55,13 +55,6 @@ export default { ...@@ -55,13 +55,6 @@ export default {
hasAnyExpandedDiscussion() { hasAnyExpandedDiscussion() {
return this.hasExpandedDiscussionOnLeft || this.hasExpandedDiscussionOnRight; return this.hasExpandedDiscussionOnLeft || this.hasExpandedDiscussionOnRight;
}, },
shouldRenderDiscussionsRow() {
const hasDiscussion = this.hasDiscussion && this.hasAnyExpandedDiscussion;
const hasCommentFormOnLeft = this.diffLineCommentForms[this.leftLineCode];
const hasCommentFormOnRight = this.diffLineCommentForms[this.rightLineCode];
return hasDiscussion || hasCommentFormOnLeft || hasCommentFormOnRight;
},
shouldRenderDiscussionsOnLeft() { shouldRenderDiscussionsOnLeft() {
return this.discussionsByLineCode[this.leftLineCode] && this.hasExpandedDiscussionOnLeft; return this.discussionsByLineCode[this.leftLineCode] && this.hasExpandedDiscussionOnLeft;
}, },
...@@ -81,7 +74,6 @@ export default { ...@@ -81,7 +74,6 @@ export default {
<template> <template>
<tr <tr
v-if="shouldRenderDiscussionsRow"
:class="className" :class="className"
class="notes_holder" class="notes_holder"
> >
...@@ -92,6 +84,7 @@ export default { ...@@ -92,6 +84,7 @@ export default {
class="content" class="content"
> >
<diff-discussions <diff-discussions
v-if="discussionsByLineCode[leftLineCode].length"
:discussions="discussionsByLineCode[leftLineCode]" :discussions="discussionsByLineCode[leftLineCode]"
/> />
</div> </div>
...@@ -112,6 +105,7 @@ export default { ...@@ -112,6 +105,7 @@ export default {
class="content" class="content"
> >
<diff-discussions <diff-discussions
v-if="discussionsByLineCode[rightLineCode].length"
:discussions="discussionsByLineCode[rightLineCode]" :discussions="discussionsByLineCode[rightLineCode]"
/> />
</div> </div>
......
<script> <script>
import { mapGetters } from 'vuex'; import { mapState, mapGetters } from 'vuex';
import parallelDiffTableRow from './parallel_diff_table_row.vue'; import parallelDiffTableRow from './parallel_diff_table_row.vue';
import parallelDiffCommentRow from './parallel_diff_comment_row.vue'; import parallelDiffCommentRow from './parallel_diff_comment_row.vue';
import { EMPTY_CELL_TYPE } from '../constants'; import { EMPTY_CELL_TYPE } from '../constants';
...@@ -22,6 +22,10 @@ export default { ...@@ -22,6 +22,10 @@ export default {
}, },
computed: { computed: {
...mapGetters('diffs', ['commitId']), ...mapGetters('diffs', ['commitId']),
...mapGetters(['discussionsByLineCode']),
...mapState({
diffLineCommentForms: state => state.diffs.diffLineCommentForms,
}),
parallelDiffLines() { parallelDiffLines() {
return this.diffLines.map(line => { return this.diffLines.map(line => {
const parallelLine = Object.assign({}, line); const parallelLine = Object.assign({}, line);
...@@ -48,6 +52,32 @@ export default { ...@@ -48,6 +52,32 @@ export default {
return window.gon.user_color_scheme; return window.gon.user_color_scheme;
}, },
}, },
methods: {
shouldRenderCommentRow(line) {
const leftLineCode = line.left.lineCode;
const rightLineCode = line.right.lineCode;
const discussions = this.discussionsByLineCode;
const leftDiscussions = discussions[leftLineCode];
const rightDiscussions = discussions[rightLineCode];
const hasDiscussion = leftDiscussions || rightDiscussions;
const hasExpandedDiscussionOnLeft = leftDiscussions
? leftDiscussions.every(discussion => discussion.expanded)
: false;
const hasExpandedDiscussionOnRight = rightDiscussions
? rightDiscussions.every(discussion => discussion.expanded)
: false;
if (hasDiscussion && (hasExpandedDiscussionOnLeft || hasExpandedDiscussionOnRight)) {
return true;
}
const hasCommentFormOnLeft = this.diffLineCommentForms[leftLineCode];
const hasCommentFormOnRight = this.diffLineCommentForms[rightLineCode];
return hasCommentFormOnLeft || hasCommentFormOnRight;
},
},
}; };
</script> </script>
...@@ -69,6 +99,7 @@ export default { ...@@ -69,6 +99,7 @@ export default {
:key="index" :key="index"
/> />
<parallel-diff-comment-row <parallel-diff-comment-row
v-if="shouldRenderCommentRow(line)"
:key="line.left.lineCode || line.right.lineCode" :key="line.left.lineCode || line.right.lineCode"
:line="line" :line="line"
:diff-file="diffFile" :diff-file="diffFile"
......
...@@ -9,6 +9,7 @@ export default { ...@@ -9,6 +9,7 @@ export default {
'diffEditor.insertedTextBackground': '#ddfbe6', 'diffEditor.insertedTextBackground': '#ddfbe6',
'diffEditor.removedTextBackground': '#f9d7dc', 'diffEditor.removedTextBackground': '#f9d7dc',
'editor.selectionBackground': '#aad6f8', 'editor.selectionBackground': '#aad6f8',
'editorIndentGuide.activeBackground': '#cccccc',
}, },
}, },
}; };
---
title: "[Rails5] Fix 'Invalid single-table inheritance type: Group is not a subclass
of Gitlab::BackgroundMigration::FixCrossProjectLabelLinks::Namespace'"
merge_request: 20462
author: "@blackst0ne"
type: fixed
---
title: Fixes base command used in Helm installations
merge_request: 20471
author:
type: fixed
...@@ -281,7 +281,7 @@ Now that the new content is marked for translation, we need to update the PO ...@@ -281,7 +281,7 @@ Now that the new content is marked for translation, we need to update the PO
files with the following command: files with the following command:
```sh ```sh
bin/rake gettext:find bin/rake gettext:regenerate
``` ```
This command will update the `locale/gitlab.pot` file with the newly externalized This command will update the `locale/gitlab.pot` file with the newly externalized
...@@ -292,16 +292,6 @@ file in. Once the changes are on master, they will be picked up by ...@@ -292,16 +292,6 @@ file in. Once the changes are on master, they will be picked up by
If there are merge conflicts in the `gitlab.pot` file, you can delete the file If there are merge conflicts in the `gitlab.pot` file, you can delete the file
and regenerate it using the same command. Confirm that you are not deleting any strings accidentally by looking over the diff. and regenerate it using the same command. Confirm that you are not deleting any strings accidentally by looking over the diff.
The command also updates the translation files for each language: `locale/*/gitlab.po`
These changes can be discarded, the language files will be updated by Crowdin
automatically.
Discard all of them at once like this:
```sh
git checkout locale/*/gitlab.po
```
### Validating PO files ### Validating PO files
To make sure we keep our translation files up to date, there's a linter that is To make sure we keep our translation files up to date, there's a linter that is
......
...@@ -30,6 +30,9 @@ ...@@ -30,6 +30,9 @@
idea to fill this in. idea to fill this in.
- Changing the **Visibility Level** modifies the project's - Changing the **Visibility Level** modifies the project's
[viewing and access rights](../public_access/public_access.md) for users. [viewing and access rights](../public_access/public_access.md) for users.
- Selecting the **Initialize repository with a README** option creates a
README so that the Git repository is initialized, has a default branch and
can be cloned.
1. Click **Create project**. 1. Click **Create project**.
......
...@@ -30,6 +30,12 @@ in users. ...@@ -30,6 +30,12 @@ in users.
Any logged in user will have [Guest](../user/permissions.md) permissions Any logged in user will have [Guest](../user/permissions.md) permissions
on the repository. on the repository.
### Private projects
Private projects can only be cloned and viewed by project members, and
they will only appear to project members on the public access directory
(`https://gitlab.example.com/public`).
### How to change project visibility ### How to change project visibility
1. Go to your project's **Settings** 1. Go to your project's **Settings**
......
...@@ -11,6 +11,7 @@ module Gitlab ...@@ -11,6 +11,7 @@ module Gitlab
end end
class Label < ActiveRecord::Base class Label < ActiveRecord::Base
self.inheritance_column = :_type_disabled
self.table_name = 'labels' self.table_name = 'labels'
end end
...@@ -27,6 +28,7 @@ module Gitlab ...@@ -27,6 +28,7 @@ module Gitlab
end end
class Namespace < ActiveRecord::Base class Namespace < ActiveRecord::Base
self.inheritance_column = :_type_disabled
self.table_name = 'namespaces' self.table_name = 'namespaces'
def self.groups_with_descendants_ids(start_id, stop_id) def self.groups_with_descendants_ids(start_id, stop_id)
......
...@@ -50,13 +50,7 @@ module Gitlab ...@@ -50,13 +50,7 @@ module Gitlab
end end
def raw(repository, sha) def raw(repository, sha)
Gitlab::GitalyClient.migrate(:git_blob_raw) do |is_enabled| repository.gitaly_blob_client.get_blob(oid: sha, limit: MAX_DATA_DISPLAY_SIZE)
if is_enabled
repository.gitaly_blob_client.get_blob(oid: sha, limit: MAX_DATA_DISPLAY_SIZE)
else
rugged_raw(repository, sha, limit: MAX_DATA_DISPLAY_SIZE)
end
end
end end
# Returns an array of Blob instances, specified in blob_references as # Returns an array of Blob instances, specified in blob_references as
...@@ -207,16 +201,7 @@ module Gitlab ...@@ -207,16 +201,7 @@ module Gitlab
return if @loaded_all_data return if @loaded_all_data
@data = Gitlab::GitalyClient.migrate(:git_blob_load_all_data) do |is_enabled| @data = repository.gitaly_blob_client.get_blob(oid: id, limit: -1).data
begin
if is_enabled
repository.gitaly_blob_client.get_blob(oid: id, limit: -1).data
else
repository.lookup(id).content
end
end
end
@loaded_all_data = true @loaded_all_data = true
@loaded_size = @data.bytesize @loaded_size = @data.bytesize
end end
......
...@@ -164,13 +164,8 @@ module Gitlab ...@@ -164,13 +164,8 @@ module Gitlab
# relation to each other. The last 10 commits for a branch for example, # relation to each other. The last 10 commits for a branch for example,
# should go through .where # should go through .where
def batch_by_oid(repo, oids) def batch_by_oid(repo, oids)
repo.gitaly_migrate(:list_commits_by_oid, repo.wrapped_gitaly_errors do
status: Gitlab::GitalyClient::MigrationStatus::OPT_OUT) do |is_enabled| repo.gitaly_commit_client.list_commits_by_oid(oids)
if is_enabled
repo.gitaly_commit_client.list_commits_by_oid(oids)
else
oids.map { |oid| find(repo, oid) }.compact
end
end end
end end
...@@ -289,14 +284,7 @@ module Gitlab ...@@ -289,14 +284,7 @@ module Gitlab
def deltas def deltas
@deltas ||= begin @deltas ||= begin
deltas = Gitlab::GitalyClient.migrate(:commit_deltas) do |is_enabled| deltas = @repository.gitaly_commit_client.commit_deltas(self)
if is_enabled
@repository.gitaly_commit_client.commit_deltas(self)
else
rugged_diff_from_parent.each_delta
end
end
deltas.map { |delta| Gitlab::Git::Diff.new(delta) } deltas.map { |delta| Gitlab::Git::Diff.new(delta) }
end end
end end
......
...@@ -42,12 +42,10 @@ module Gitlab ...@@ -42,12 +42,10 @@ module Gitlab
return if @overflow return if @overflow
return if @iterator.nil? return if @iterator.nil?
Gitlab::GitalyClient.migrate(:commit_raw_diffs) do |is_enabled| if @iterator.is_a?(Gitlab::GitalyClient::DiffStitcher)
if is_enabled && @iterator.is_a?(Gitlab::GitalyClient::DiffStitcher) each_gitaly_patch(&block)
each_gitaly_patch(&block) else
else each_serialized_patch(&block)
each_rugged_patch(&block)
end
end end
@populated = true @populated = true
...@@ -118,7 +116,7 @@ module Gitlab ...@@ -118,7 +116,7 @@ module Gitlab
end end
end end
def each_rugged_patch def each_serialized_patch
i = @array.length i = @array.length
@iterator.each do |raw| @iterator.each do |raw|
......
...@@ -439,31 +439,11 @@ module Gitlab ...@@ -439,31 +439,11 @@ module Gitlab
raise ArgumentError.new("invalid Repository#log limit: #{limit.inspect}") raise ArgumentError.new("invalid Repository#log limit: #{limit.inspect}")
end end
gitaly_migrate(:find_commits) do |is_enabled| wrapped_gitaly_errors do
if is_enabled gitaly_commit_client.find_commits(options)
gitaly_commit_client.find_commits(options)
else
raw_log(options).map { |c| Commit.decorate(self, c) }
end
end end
end end
# Used in gitaly-ruby
def raw_log(options)
sha =
unless options[:all]
actual_ref = options[:ref] || root_ref
begin
sha_from_ref(actual_ref)
rescue Rugged::OdbError, Rugged::InvalidError, Rugged::ReferenceError
# Return an empty array if the ref wasn't found
return []
end
end
log_by_shell(sha, options)
end
def count_commits(options) def count_commits(options)
options = process_count_commits_options(options.dup) options = process_count_commits_options(options.dup)
...@@ -555,13 +535,7 @@ module Gitlab ...@@ -555,13 +535,7 @@ module Gitlab
# diff options. The +options+ hash can also include :break_rewrites to # diff options. The +options+ hash can also include :break_rewrites to
# split larger rewrites into delete/add pairs. # split larger rewrites into delete/add pairs.
def diff(from, to, options = {}, *paths) def diff(from, to, options = {}, *paths)
iterator = gitaly_migrate(:diff_between) do |is_enabled| iterator = gitaly_commit_client.diff(from, to, options.merge(paths: paths))
if is_enabled
gitaly_commit_client.diff(from, to, options.merge(paths: paths))
else
diff_patches(from, to, options, *paths)
end
end
Gitlab::Git::DiffCollection.new(iterator, options) Gitlab::Git::DiffCollection.new(iterator, options)
end end
...@@ -1229,12 +1203,10 @@ module Gitlab ...@@ -1229,12 +1203,10 @@ module Gitlab
end end
def find_commits_by_message(query, ref, path, limit, offset) def find_commits_by_message(query, ref, path, limit, offset)
gitaly_migrate(:commits_by_message) do |is_enabled| wrapped_gitaly_errors do
if is_enabled gitaly_commit_client
find_commits_by_message_by_gitaly(query, ref, path, limit, offset) .commits_by_message(query, revision: ref, path: path, limit: limit, offset: offset)
else .map { |c| commit(c) }
find_commits_by_message_by_shelling_out(query, ref, path, limit, offset)
end
end end
end end
...@@ -1244,12 +1216,8 @@ module Gitlab ...@@ -1244,12 +1216,8 @@ module Gitlab
end end
def last_commit_for_path(sha, path) def last_commit_for_path(sha, path)
gitaly_migrate(:last_commit_for_path) do |is_enabled| wrapped_gitaly_errors do
if is_enabled gitaly_commit_client.last_commit_for_path(sha, path)
last_commit_for_path_by_gitaly(sha, path)
else
last_commit_for_path_by_rugged(sha, path)
end
end end
end end
...@@ -1460,46 +1428,6 @@ module Gitlab ...@@ -1460,46 +1428,6 @@ module Gitlab
end end
end end
# Gitaly note: JV: although #log_by_shell shells out to Git I think the
# complexity is such that we should migrate it as Ruby before trying to
# do it in Go.
def log_by_shell(sha, options)
limit = options[:limit].to_i
offset = options[:offset].to_i
use_follow_flag = options[:follow] && options[:path].present?
# We will perform the offset in Ruby because --follow doesn't play well with --skip.
# See: https://gitlab.com/gitlab-org/gitlab-ce/issues/3574#note_3040520
offset_in_ruby = use_follow_flag && options[:offset].present?
limit += offset if offset_in_ruby
cmd = %w[log]
cmd << "--max-count=#{limit}"
cmd << '--format=%H'
cmd << "--skip=#{offset}" unless offset_in_ruby
cmd << '--follow' if use_follow_flag
cmd << '--no-merges' if options[:skip_merges]
cmd << "--after=#{options[:after].iso8601}" if options[:after]
cmd << "--before=#{options[:before].iso8601}" if options[:before]
if options[:all]
cmd += %w[--all --reverse]
else
cmd << sha
end
# :path can be a string or an array of strings
if options[:path].present?
cmd << '--'
cmd += Array(options[:path])
end
raw_output, _status = run_git(cmd)
lines = offset_in_ruby ? raw_output.lines.drop(offset) : raw_output.lines
lines.map! { |c| Rugged::Commit.new(rugged, c.strip) }
end
# We are trying to deprecate this method because it does a lot of work # We are trying to deprecate this method because it does a lot of work
# but it seems to be used only to look up submodule URL's. # but it seems to be used only to look up submodule URL's.
# https://gitlab.com/gitlab-org/gitaly/issues/329 # https://gitlab.com/gitlab-org/gitaly/issues/329
...@@ -1629,11 +1557,6 @@ module Gitlab ...@@ -1629,11 +1557,6 @@ module Gitlab
end end
end end
def last_commit_for_path_by_rugged(sha, path)
sha = last_commit_id_for_path_by_shelling_out(sha, path)
commit(sha)
end
# Returns true if the given ref name exists # Returns true if the given ref name exists
# #
# Ref names must start with `refs/`. # Ref names must start with `refs/`.
...@@ -1826,35 +1749,6 @@ module Gitlab ...@@ -1826,35 +1749,6 @@ module Gitlab
raise CommandError, @gitlab_projects.output raise CommandError, @gitlab_projects.output
end end
def find_commits_by_message_by_shelling_out(query, ref, path, limit, offset)
ref ||= root_ref
args = %W(
log #{ref} --pretty=%H --skip #{offset}
--max-count #{limit} --grep=#{query} --regexp-ignore-case
)
args = args.concat(%W(-- #{path})) if path.present?
git_log_results = run_git(args).first.lines
git_log_results.map { |c| commit(c.chomp) }.compact
end
def find_commits_by_message_by_gitaly(query, ref, path, limit, offset)
gitaly_commit_client
.commits_by_message(query, revision: ref, path: path, limit: limit, offset: offset)
.map { |c| commit(c) }
end
def last_commit_for_path_by_gitaly(sha, path)
gitaly_commit_client.last_commit_for_path(sha, path)
end
def last_commit_id_for_path_by_shelling_out(sha, path)
args = %W(rev-list --max-count=1 #{sha} -- #{path})
run_git_with_timeout(args, Gitlab::Git::Popen::FAST_GIT_PROCESS_TIMEOUT).first.strip
end
def rugged_merge_base(from, to) def rugged_merge_base(from, to)
rugged.merge_base(from, to) rugged.merge_base(from, to)
rescue Rugged::ReferenceError rescue Rugged::ReferenceError
...@@ -1868,35 +1762,6 @@ module Gitlab ...@@ -1868,35 +1762,6 @@ module Gitlab
def sha_from_ref(ref) def sha_from_ref(ref)
rev_parse_target(ref).oid rev_parse_target(ref).oid
end end
def build_git_cmd(*args)
object_directories = alternate_object_directories.join(File::PATH_SEPARATOR)
env = { 'PWD' => self.path }
env['GIT_ALTERNATE_OBJECT_DIRECTORIES'] = object_directories if object_directories.present?
[
env,
::Gitlab.config.git.bin_path,
*args,
{ chdir: self.path }
]
end
def git_diff_cmd(old_rev, new_rev)
old_rev = old_rev == ::Gitlab::Git::BLANK_SHA ? ::Gitlab::Git::EMPTY_TREE_ID : old_rev
build_git_cmd('diff', old_rev, new_rev, '--raw')
end
def git_cat_file_cmd
format = '%(objectname) %(objectsize) %(rest)'
build_git_cmd('cat-file', "--batch-check=#{format}")
end
def format_git_cat_file_script
File.expand_path('../support/format-git-cat-file-input', __FILE__)
end
end end
end end
end end
#!/usr/bin/env ruby
# This script formats the output of the `git diff <old_rev> <new_rev> --raw`
# command so it can be processed by `git cat-file`
# We need to convert this:
# ":100644 100644 5f53439... 85bc2f9... R060\tfiles/js/commit.js.coffee\tfiles/js/commit.coffee"
# To:
# "85bc2f9 R\tfiles/js/commit.js.coffee\tfiles/js/commit.coffee"
ARGF.each do |line|
_, _, old_blob_id, new_blob_id, rest = line.split(/\s/, 5)
old_blob_id.gsub!(/[^\h]/, '')
new_blob_id.gsub!(/[^\h]/, '')
# We can't pass '0000000...' to `git cat-file` given it will not return info about the deleted file
blob_id = new_blob_id =~ /\A0+\z/ ? old_blob_id : new_blob_id
$stdout.puts "#{blob_id} #{rest}"
end
...@@ -18,7 +18,7 @@ module Gitlab ...@@ -18,7 +18,7 @@ module Gitlab
ALPINE_VERSION=$(cat /etc/alpine-release | cut -d '.' -f 1,2) ALPINE_VERSION=$(cat /etc/alpine-release | cut -d '.' -f 1,2)
echo http://mirror.clarkson.edu/alpine/v$ALPINE_VERSION/main >> /etc/apk/repositories echo http://mirror.clarkson.edu/alpine/v$ALPINE_VERSION/main >> /etc/apk/repositories
echo http://mirror1.hs-esslingen.de/pub/Mirrors/alpine/v$ALPINE_VERSION/main >> /etc/apk/repositories echo http://mirror1.hs-esslingen.de/pub/Mirrors/alpine/v$ALPINE_VERSION/main >> /etc/apk/repositories
apk add -U ca-certificates openssl >/dev/null apk add -U wget ca-certificates openssl >/dev/null
wget -q -O - https://kubernetes-helm.storage.googleapis.com/helm-v#{Gitlab::Kubernetes::Helm::HELM_VERSION}-linux-amd64.tar.gz | tar zxC /tmp >/dev/null wget -q -O - https://kubernetes-helm.storage.googleapis.com/helm-v#{Gitlab::Kubernetes::Helm::HELM_VERSION}-linux-amd64.tar.gz | tar zxC /tmp >/dev/null
mv /tmp/linux-amd64/helm /usr/bin/ mv /tmp/linux-amd64/helm /usr/bin/
HEREDOC HEREDOC
......
...@@ -74,17 +74,10 @@ module Gitlab ...@@ -74,17 +74,10 @@ module Gitlab
relative_path = name.dup relative_path = name.dup
relative_path << '.git' unless relative_path.end_with?('.git') relative_path << '.git' unless relative_path.end_with?('.git')
gitaly_migrate(:create_repository, repository = Gitlab::Git::Repository.new(storage, relative_path, '')
status: Gitlab::GitalyClient::MigrationStatus::OPT_OUT) do |is_enabled| wrapped_gitaly_errors { repository.gitaly_repository_client.create_repository }
if is_enabled
repository = Gitlab::Git::Repository.new(storage, relative_path, '') true
repository.gitaly_repository_client.create_repository
true
else
repo_path = File.join(Gitlab.config.repositories.storages[storage].legacy_disk_path, relative_path)
Gitlab::Git::Repository.create(repo_path, bare: true, symlink_hooks_to: gitlab_shell_hooks_path)
end
end
rescue => err # Once the Rugged codes gets removes this can be improved rescue => err # Once the Rugged codes gets removes this can be improved
Rails.logger.error("Failed to add repository #{storage}/#{name}: #{err}") Rails.logger.error("Failed to add repository #{storage}/#{name}: #{err}")
false false
...@@ -448,7 +441,11 @@ module Gitlab ...@@ -448,7 +441,11 @@ module Gitlab
end end
def gitaly_migrate(method, status: Gitlab::GitalyClient::MigrationStatus::OPT_IN, &block) def gitaly_migrate(method, status: Gitlab::GitalyClient::MigrationStatus::OPT_IN, &block)
Gitlab::GitalyClient.migrate(method, status: status, &block) wrapped_gitaly_errors { Gitlab::GitalyClient.migrate(method, status: status, &block) }
end
def wrapped_gitaly_errors
yield
rescue GRPC::NotFound, GRPC::BadStatus => e rescue GRPC::NotFound, GRPC::BadStatus => e
# Old Popen code returns [Error, output] to the caller, so we # Old Popen code returns [Error, output] to the caller, so we
# need to do the same here... # need to do the same here...
......
...@@ -37,21 +37,14 @@ module Gitlab ...@@ -37,21 +37,14 @@ module Gitlab
end end
def send_git_blob(repository, blob) def send_git_blob(repository, blob)
params = if Gitlab::GitalyClient.feature_enabled?(:workhorse_raw_show, status: Gitlab::GitalyClient::MigrationStatus::OPT_OUT) params = {
{ 'GitalyServer' => gitaly_server_hash(repository),
'GitalyServer' => gitaly_server_hash(repository), 'GetBlobRequest' => {
'GetBlobRequest' => { repository: repository.gitaly_repository.to_h,
repository: repository.gitaly_repository.to_h, oid: blob.id,
oid: blob.id, limit: -1
limit: -1 }
} }
}
else
{
'RepoPath' => repository.path_to_repo,
'BlobId' => blob.id
}
end
[ [
SEND_DATA_HEADER, SEND_DATA_HEADER,
...@@ -91,16 +84,12 @@ module Gitlab ...@@ -91,16 +84,12 @@ module Gitlab
end end
def send_git_diff(repository, diff_refs) def send_git_diff(repository, diff_refs)
params = if Gitlab::GitalyClient.feature_enabled?(:workhorse_send_git_diff, status: Gitlab::GitalyClient::MigrationStatus::OPT_OUT) params = {
{ 'GitalyServer' => gitaly_server_hash(repository),
'GitalyServer' => gitaly_server_hash(repository), 'RawDiffRequest' => Gitaly::RawDiffRequest.new(
'RawDiffRequest' => Gitaly::RawDiffRequest.new( gitaly_diff_or_patch_hash(repository, diff_refs)
gitaly_diff_or_patch_hash(repository, diff_refs) ).to_json
).to_json }
}
else
workhorse_diff_or_patch_hash(repository, diff_refs)
end
[ [
SEND_DATA_HEADER, SEND_DATA_HEADER,
......
...@@ -19,6 +19,23 @@ namespace :gettext do ...@@ -19,6 +19,23 @@ namespace :gettext do
Rake::Task['gettext:po_to_json'].invoke Rake::Task['gettext:po_to_json'].invoke
end end
task :regenerate do
# Remove all translated files, this speeds up finding
FileUtils.rm Dir['locale/**/gitlab.*']
# remove the `pot` file to ensure it's completely regenerated
FileUtils.rm_f 'locale/gitlab.pot'
Rake::Task['gettext:find'].invoke
# leave only the required changes.
`git checkout -- locale/*/gitlab.po`
puts <<~MSG
All done. Please commit the changes to `locale/gitlab.pot`.
MSG
end
desc 'Lint all po files in `locale/' desc 'Lint all po files in `locale/'
task lint: :environment do task lint: :environment do
require 'simple_po_parser' require 'simple_po_parser'
...@@ -50,13 +67,12 @@ namespace :gettext do ...@@ -50,13 +67,12 @@ namespace :gettext do
end end
task :updated_check do task :updated_check do
pot_file = 'locale/gitlab.pot'
# Removing all pre-translated files speeds up `gettext:find` as the # Removing all pre-translated files speeds up `gettext:find` as the
# files don't need to be merged. # files don't need to be merged.
# Having `LC_MESSAGES/gitlab.mo files present also confuses the output. # Having `LC_MESSAGES/gitlab.mo files present also confuses the output.
FileUtils.rm Dir['locale/**/gitlab.*'] FileUtils.rm Dir['locale/**/gitlab.*']
FileUtils.rm_f pot_file
# Make sure we start out with a clean pot.file
`git checkout -- locale/gitlab.pot`
# `gettext:find` writes touches to temp files to `stderr` which would cause # `gettext:find` writes touches to temp files to `stderr` which would cause
# `static-analysis` to report failures. We can ignore these. # `static-analysis` to report failures. We can ignore these.
...@@ -64,18 +80,18 @@ namespace :gettext do ...@@ -64,18 +80,18 @@ namespace :gettext do
Rake::Task['gettext:find'].invoke Rake::Task['gettext:find'].invoke
end end
pot_diff = `git diff -- locale/gitlab.pot`.strip pot_diff = `git diff -- #{pot_file} | grep -E '^(\\+|-)msgid'`.strip
# reset the locale folder for potential next tasks # reset the locale folder for potential next tasks
`git checkout -- locale` `git checkout -- locale`
if pot_diff.present? if pot_diff.present?
raise <<~MSG raise <<~MSG
Newly translated strings found, please add them to `gitlab.pot` by running: Newly translated strings found, please add them to `#{pot_file}` by running:
rm locale/**/gitlab.*; bin/rake gettext:find; git checkout -- locale/*/gitlab.po bin/rake gettext:regenerate
Then commit and push the resulting changes to `locale/gitlab.pot`. Then commit and push the resulting changes to `#{pot_file}`.
The diff was: The diff was:
......
...@@ -8,8 +8,8 @@ msgid "" ...@@ -8,8 +8,8 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: gitlab 1.0.0\n" "Project-Id-Version: gitlab 1.0.0\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-07-01 21:24+1000\n" "POT-Creation-Date: 2018-07-09 08:28+0200\n"
"PO-Revision-Date: 2018-07-01 21:24+1000\n" "PO-Revision-Date: 2018-07-09 08:28+0200\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n" "Language: \n"
...@@ -369,9 +369,18 @@ msgstr "" ...@@ -369,9 +369,18 @@ msgstr ""
msgid "Alternatively, you can use a %{personal_access_token_link}. When you create your Personal Access Token, you will need to select the <code>repo</code> scope, so we can display a list of your public and private repositories which are available to import." msgid "Alternatively, you can use a %{personal_access_token_link}. When you create your Personal Access Token, you will need to select the <code>repo</code> scope, so we can display a list of your public and private repositories which are available to import."
msgstr "" msgstr ""
msgid "An error accured whilst committing your changes."
msgstr ""
msgid "An error occured creating the new branch." msgid "An error occured creating the new branch."
msgstr "" msgstr ""
msgid "An error occured whilst fetching the job trace."
msgstr ""
msgid "An error occured whilst fetching the latest pipline."
msgstr ""
msgid "An error occured whilst loading all the files." msgid "An error occured whilst loading all the files."
msgstr "" msgstr ""
...@@ -390,6 +399,9 @@ msgstr "" ...@@ -390,6 +399,9 @@ msgstr ""
msgid "An error occured whilst loading the merge request." msgid "An error occured whilst loading the merge request."
msgstr "" msgstr ""
msgid "An error occured whilst loading the pipelines jobs."
msgstr ""
msgid "An error occurred previewing the blob" msgid "An error occurred previewing the blob"
msgstr "" msgstr ""
...@@ -1085,9 +1097,6 @@ msgstr "" ...@@ -1085,9 +1097,6 @@ msgstr ""
msgid "ClusterIntegration|Add Kubernetes cluster" msgid "ClusterIntegration|Add Kubernetes cluster"
msgstr "" msgstr ""
msgid "ClusterIntegration|Add an existing Kubernetes cluster"
msgstr ""
msgid "ClusterIntegration|Advanced options on this Kubernetes cluster's integration" msgid "ClusterIntegration|Advanced options on this Kubernetes cluster's integration"
msgstr "" msgstr ""
...@@ -1109,9 +1118,6 @@ msgstr "" ...@@ -1109,9 +1118,6 @@ msgstr ""
msgid "ClusterIntegration|Certificate Authority bundle (PEM format)" msgid "ClusterIntegration|Certificate Authority bundle (PEM format)"
msgstr "" msgstr ""
msgid "ClusterIntegration|Choose how to set up Kubernetes cluster integration"
msgstr ""
msgid "ClusterIntegration|Choose which of your project's environments will use this Kubernetes cluster." msgid "ClusterIntegration|Choose which of your project's environments will use this Kubernetes cluster."
msgstr "" msgstr ""
...@@ -1139,18 +1145,6 @@ msgstr "" ...@@ -1139,18 +1145,6 @@ msgstr ""
msgid "ClusterIntegration|Create Kubernetes cluster" msgid "ClusterIntegration|Create Kubernetes cluster"
msgstr "" msgstr ""
msgid "ClusterIntegration|Create Kubernetes cluster on Google Kubernetes Engine"
msgstr ""
msgid "ClusterIntegration|Create a new Kubernetes cluster on Google Kubernetes Engine right from GitLab"
msgstr ""
msgid "ClusterIntegration|Create on Google Kubernetes Engine"
msgstr ""
msgid "ClusterIntegration|Enter the details for an existing Kubernetes cluster"
msgstr ""
msgid "ClusterIntegration|Enter the details for your Kubernetes cluster" msgid "ClusterIntegration|Enter the details for your Kubernetes cluster"
msgstr "" msgstr ""
...@@ -2150,15 +2144,9 @@ msgstr "" ...@@ -2150,15 +2144,9 @@ msgstr ""
msgid "Error Reporting and Logging" msgid "Error Reporting and Logging"
msgstr "" msgstr ""
msgid "Error committing changes. Please try again."
msgstr ""
msgid "Error fetching contributors data." msgid "Error fetching contributors data."
msgstr "" msgstr ""
msgid "Error fetching job trace"
msgstr ""
msgid "Error fetching labels." msgid "Error fetching labels."
msgstr "" msgstr ""
...@@ -2177,6 +2165,9 @@ msgstr "" ...@@ -2177,6 +2165,9 @@ msgstr ""
msgid "Error loading last commit." msgid "Error loading last commit."
msgstr "" msgstr ""
msgid "Error loading markdown preview"
msgstr ""
msgid "Error loading merge requests." msgid "Error loading merge requests."
msgstr "" msgstr ""
...@@ -2234,6 +2225,9 @@ msgstr "" ...@@ -2234,6 +2225,9 @@ msgstr ""
msgid "Expand sidebar" msgid "Expand sidebar"
msgstr "" msgstr ""
msgid "Explore groups"
msgstr ""
msgid "Explore projects" msgid "Explore projects"
msgstr "" msgstr ""
...@@ -2449,6 +2443,27 @@ msgstr "" ...@@ -2449,6 +2443,27 @@ msgstr ""
msgid "Groups can also be nested by creating %{subgroup_docs_link_start}subgroups%{subgroup_docs_link_end}." msgid "Groups can also be nested by creating %{subgroup_docs_link_start}subgroups%{subgroup_docs_link_end}."
msgstr "" msgstr ""
msgid "GroupsDropdown|Frequently visited"
msgstr ""
msgid "GroupsDropdown|Groups you visit often will appear here"
msgstr ""
msgid "GroupsDropdown|Loading groups"
msgstr ""
msgid "GroupsDropdown|Search your groups"
msgstr ""
msgid "GroupsDropdown|Something went wrong on our end."
msgstr ""
msgid "GroupsDropdown|Sorry, no groups matched your search"
msgstr ""
msgid "GroupsDropdown|This feature requires browser localStorage support"
msgstr ""
msgid "GroupsEmptyState|A group is a collection of several projects." msgid "GroupsEmptyState|A group is a collection of several projects."
msgstr "" msgstr ""
...@@ -2631,7 +2646,7 @@ msgstr "" ...@@ -2631,7 +2646,7 @@ msgstr ""
msgid "Introducing Cycle Analytics" msgid "Introducing Cycle Analytics"
msgstr "" msgstr ""
msgid "Issue Board" msgid "Issue Boards"
msgstr "" msgstr ""
msgid "Issue events" msgid "Issue events"
...@@ -2825,9 +2840,6 @@ msgstr "" ...@@ -2825,9 +2840,6 @@ msgstr ""
msgid "Locked to current projects" msgid "Locked to current projects"
msgstr "" msgstr ""
msgid "Login"
msgstr ""
msgid "Manage all notifications" msgid "Manage all notifications"
msgstr "" msgstr ""
...@@ -2864,6 +2876,9 @@ msgstr "" ...@@ -2864,6 +2876,9 @@ msgstr ""
msgid "Members" msgid "Members"
msgstr "" msgstr ""
msgid "Merge Request"
msgstr ""
msgid "Merge Request:" msgid "Merge Request:"
msgstr "" msgstr ""
...@@ -2906,12 +2921,42 @@ msgstr "" ...@@ -2906,12 +2921,42 @@ msgstr ""
msgid "Messages" msgid "Messages"
msgstr "" msgstr ""
msgid "Metrics"
msgstr ""
msgid "Metrics - Influx" msgid "Metrics - Influx"
msgstr "" msgstr ""
msgid "Metrics - Prometheus" msgid "Metrics - Prometheus"
msgstr "" msgstr ""
msgid "Metrics|Check out the CI/CD documentation on deploying to an environment"
msgstr ""
msgid "Metrics|Environment"
msgstr ""
msgid "Metrics|Learn about environments"
msgstr ""
msgid "Metrics|No deployed environments"
msgstr ""
msgid "Metrics|There was an error fetching the environments data, please try again"
msgstr ""
msgid "Metrics|There was an error getting deployment information."
msgstr ""
msgid "Metrics|There was an error getting environments information."
msgstr ""
msgid "Metrics|Unexpected deployment data response from prometheus endpoint"
msgstr ""
msgid "Metrics|Unexpected metrics data response from prometheus endpoint"
msgstr ""
msgid "Milestone" msgid "Milestone"
msgstr "" msgstr ""
...@@ -2995,12 +3040,6 @@ msgid_plural "New Issues" ...@@ -2995,12 +3040,6 @@ msgid_plural "New Issues"
msgstr[0] "" msgstr[0] ""
msgstr[1] "" msgstr[1] ""
msgid "New Kubernetes Cluster"
msgstr ""
msgid "New Kubernetes cluster"
msgstr ""
msgid "New Label" msgid "New Label"
msgstr "" msgstr ""
...@@ -3217,6 +3256,9 @@ msgstr "" ...@@ -3217,6 +3256,9 @@ msgstr ""
msgid "Only project members can comment." msgid "Only project members can comment."
msgstr "" msgstr ""
msgid "Oops, are you sure?"
msgstr ""
msgid "Open in Xcode" msgid "Open in Xcode"
msgstr "" msgstr ""
...@@ -3505,6 +3547,9 @@ msgstr "" ...@@ -3505,6 +3547,9 @@ msgstr ""
msgid "Profiles|Account scheduled for removal." msgid "Profiles|Account scheduled for removal."
msgstr "" msgstr ""
msgid "Profiles|Add key"
msgstr ""
msgid "Profiles|Change username" msgid "Profiles|Change username"
msgstr "" msgstr ""
...@@ -3532,9 +3577,15 @@ msgstr "" ...@@ -3532,9 +3577,15 @@ msgstr ""
msgid "Profiles|Path" msgid "Profiles|Path"
msgstr "" msgstr ""
msgid "Profiles|This doesn't look like a public SSH key, are you sure you want to add it?"
msgstr ""
msgid "Profiles|Type your %{confirmationValue} to confirm:" msgid "Profiles|Type your %{confirmationValue} to confirm:"
msgstr "" msgstr ""
msgid "Profiles|Typically starts with \"ssh-rsa …\""
msgstr ""
msgid "Profiles|Update username" msgid "Profiles|Update username"
msgstr "" msgstr ""
...@@ -3553,6 +3604,9 @@ msgstr "" ...@@ -3553,6 +3604,9 @@ msgstr ""
msgid "Profiles|Your account is currently an owner in these groups:" msgid "Profiles|Your account is currently an owner in these groups:"
msgstr "" msgstr ""
msgid "Profiles|e.g. My MacBook key"
msgstr ""
msgid "Profiles|your account" msgid "Profiles|your account"
msgstr "" msgstr ""
...@@ -3640,9 +3694,6 @@ msgstr "" ...@@ -3640,9 +3694,6 @@ msgstr ""
msgid "ProjectsDropdown|Sorry, no projects matched your search" msgid "ProjectsDropdown|Sorry, no projects matched your search"
msgstr "" msgstr ""
msgid "ProjectsDropdown|This feature requires browser localStorage support"
msgstr ""
msgid "PrometheusDashboard|Time" msgid "PrometheusDashboard|Time"
msgstr "" msgstr ""
...@@ -4528,12 +4579,6 @@ msgstr "" ...@@ -4528,12 +4579,6 @@ msgstr ""
msgid "There are problems accessing Git storage: " msgid "There are problems accessing Git storage: "
msgstr "" msgstr ""
msgid "There was an error loading jobs"
msgstr ""
msgid "There was an error loading latest pipeline"
msgstr ""
msgid "There was an error loading users activity calendar." msgid "There was an error loading users activity calendar."
msgstr "" msgstr ""
...@@ -4814,6 +4859,9 @@ msgstr "" ...@@ -4814,6 +4859,9 @@ msgstr ""
msgid "Tip:" msgid "Tip:"
msgstr "" msgstr ""
msgid "Title"
msgstr ""
msgid "To GitLab" msgid "To GitLab"
msgstr "" msgstr ""
...@@ -5182,6 +5230,9 @@ msgstr "" ...@@ -5182,6 +5230,9 @@ msgstr ""
msgid "Yes" msgid "Yes"
msgstr "" msgstr ""
msgid "Yes, add it"
msgstr ""
msgid "You are going to remove %{group_name}. Removed groups CANNOT be restored! Are you ABSOLUTELY sure?" msgid "You are going to remove %{group_name}. Removed groups CANNOT be restored! Are you ABSOLUTELY sure?"
msgstr "" msgstr ""
...@@ -5441,6 +5492,9 @@ msgstr "" ...@@ -5441,6 +5492,9 @@ msgstr ""
msgid "mrWidget|Merged by" msgid "mrWidget|Merged by"
msgstr "" msgstr ""
msgid "mrWidget|Open in Web IDE"
msgstr ""
msgid "mrWidget|Plain diff" msgid "mrWidget|Plain diff"
msgstr "" msgstr ""
...@@ -5510,9 +5564,6 @@ msgstr "" ...@@ -5510,9 +5564,6 @@ msgstr ""
msgid "mrWidget|This project is archived, write access has been disabled" msgid "mrWidget|This project is archived, write access has been disabled"
msgstr "" msgstr ""
msgid "mrWidget|Web IDE"
msgstr ""
msgid "mrWidget|You can merge this merge request manually using the" msgid "mrWidget|You can merge this merge request manually using the"
msgstr "" msgstr ""
......
...@@ -49,7 +49,7 @@ const stagedFiles = ...@@ -49,7 +49,7 @@ const stagedFiles =
if (stagedFiles) { if (stagedFiles) {
if (!stagedFiles.length || (stagedFiles.length === 1 && !stagedFiles[0])) { if (!stagedFiles.length || (stagedFiles.length === 1 && !stagedFiles[0])) {
console.log('No matching staged files.'); console.log('No matching staged files.');
return; process.exit(1);
} }
console.log(`Matching staged Files : ${stagedFiles.length}`); console.log(`Matching staged Files : ${stagedFiles.length}`);
} }
...@@ -78,7 +78,7 @@ files = prettierIgnore.filter(files); ...@@ -78,7 +78,7 @@ files = prettierIgnore.filter(files);
if (!files.length) { if (!files.length) {
console.log('No Files found to process with Prettier'); console.log('No Files found to process with Prettier');
return; process.exit(1);
} }
console.log(`${shouldSave ? 'Updating' : 'Checking'} ${files.length} file(s)`); console.log(`${shouldSave ? 'Updating' : 'Checking'} ${files.length} file(s)`);
......
...@@ -31,12 +31,12 @@ describe('DiffFile', () => { ...@@ -31,12 +31,12 @@ describe('DiffFile', () => {
describe('collapsed', () => { describe('collapsed', () => {
it('should not have file content', done => { it('should not have file content', done => {
expect(vm.$el.querySelectorAll('.diff-content.hidden').length).toEqual(0); expect(vm.$el.querySelectorAll('.diff-content').length).toEqual(1);
expect(vm.file.collapsed).toEqual(false); expect(vm.file.collapsed).toEqual(false);
vm.file.collapsed = true; vm.file.collapsed = true;
vm.$nextTick(() => { vm.$nextTick(() => {
expect(vm.$el.querySelectorAll('.diff-content.hidden').length).toEqual(1); expect(vm.$el.querySelectorAll('.diff-content').length).toEqual(0);
done(); done();
}); });
......
...@@ -532,8 +532,8 @@ describe Gitlab::Git::Blob, seed_helper: true do ...@@ -532,8 +532,8 @@ describe Gitlab::Git::Blob, seed_helper: true do
subject { blob.load_all_data!(repository) } subject { blob.load_all_data!(repository) }
it 'loads missing data' do it 'loads missing data' do
expect(Gitlab::GitalyClient).to receive(:migrate) expect(repository.gitaly_blob_client).to receive(:get_blob)
.with(:git_blob_load_all_data).and_return(full_data) .and_return(double(:response, data: full_data))
subject subject
...@@ -544,8 +544,7 @@ describe Gitlab::Git::Blob, seed_helper: true do ...@@ -544,8 +544,7 @@ describe Gitlab::Git::Blob, seed_helper: true do
let(:blob) { Gitlab::Git::Blob.new(name: 'test', size: 4, data: full_data) } let(:blob) { Gitlab::Git::Blob.new(name: 'test', size: 4, data: full_data) }
it "doesn't perform any loading" do it "doesn't perform any loading" do
expect(Gitlab::GitalyClient).not_to receive(:migrate) expect(repository.gitaly_blob_client).not_to receive(:get_blob)
.with(:git_blob_load_all_data)
subject subject
......
...@@ -143,34 +143,22 @@ describe Gitlab::Workhorse do ...@@ -143,34 +143,22 @@ describe Gitlab::Workhorse do
let(:diff_refs) { double(base_sha: "base", head_sha: "head") } let(:diff_refs) { double(base_sha: "base", head_sha: "head") }
subject { described_class.send_git_diff(repository, diff_refs) } subject { described_class.send_git_diff(repository, diff_refs) }
context 'when Gitaly workhorse_send_git_diff feature is enabled' do it 'sets the header correctly' do
it 'sets the header correctly' do key, command, params = decode_workhorse_header(subject)
key, command, params = decode_workhorse_header(subject)
expect(key).to eq("Gitlab-Workhorse-Send-Data")
expect(command).to eq("git-diff")
expect(params).to eq({
'GitalyServer' => {
address: Gitlab::GitalyClient.address(project.repository_storage),
token: Gitlab::GitalyClient.token(project.repository_storage)
},
'RawDiffRequest' => Gitaly::RawDiffRequest.new(
repository: repository.gitaly_repository,
left_commit_id: 'base',
right_commit_id: 'head'
).to_json
}.deep_stringify_keys)
end
end
context 'when Gitaly workhorse_send_git_diff feature is disabled', :disable_gitaly do
it 'sets the header correctly' do
key, command, params = decode_workhorse_header(subject)
expect(key).to eq("Gitlab-Workhorse-Send-Data") expect(key).to eq("Gitlab-Workhorse-Send-Data")
expect(command).to eq("git-diff") expect(command).to eq("git-diff")
expect(params).to eq("RepoPath" => repository.path_to_repo, "ShaFrom" => "base", "ShaTo" => "head") expect(params).to eq({
end 'GitalyServer' => {
address: Gitlab::GitalyClient.address(project.repository_storage),
token: Gitlab::GitalyClient.token(project.repository_storage)
},
'RawDiffRequest' => Gitaly::RawDiffRequest.new(
repository: repository.gitaly_repository,
left_commit_id: 'base',
right_commit_id: 'head'
).to_json
}.deep_stringify_keys)
end end
end end
...@@ -425,34 +413,22 @@ describe Gitlab::Workhorse do ...@@ -425,34 +413,22 @@ describe Gitlab::Workhorse do
subject { described_class.send_git_blob(repository, blob) } subject { described_class.send_git_blob(repository, blob) }
context 'when Gitaly workhorse_raw_show feature is enabled' do it 'sets the header correctly' do
it 'sets the header correctly' do key, command, params = decode_workhorse_header(subject)
key, command, params = decode_workhorse_header(subject)
expect(key).to eq('Gitlab-Workhorse-Send-Data')
expect(command).to eq('git-blob')
expect(params).to eq({
'GitalyServer' => {
address: Gitlab::GitalyClient.address(project.repository_storage),
token: Gitlab::GitalyClient.token(project.repository_storage)
},
'GetBlobRequest' => {
repository: repository.gitaly_repository.to_h,
oid: blob.id,
limit: -1
}
}.deep_stringify_keys)
end
end
context 'when Gitaly workhorse_raw_show feature is disabled', :disable_gitaly do
it 'sets the header correctly' do
key, command, params = decode_workhorse_header(subject)
expect(key).to eq('Gitlab-Workhorse-Send-Data') expect(key).to eq('Gitlab-Workhorse-Send-Data')
expect(command).to eq('git-blob') expect(command).to eq('git-blob')
expect(params).to eq('RepoPath' => repository.path_to_repo, 'BlobId' => blob.id) expect(params).to eq({
end 'GitalyServer' => {
address: Gitlab::GitalyClient.address(project.repository_storage),
token: Gitlab::GitalyClient.token(project.repository_storage)
},
'GetBlobRequest' => {
repository: repository.gitaly_repository.to_h,
oid: blob.id,
limit: -1
}
}.deep_stringify_keys)
end end
end end
......
...@@ -6,7 +6,7 @@ shared_examples 'helm commands' do ...@@ -6,7 +6,7 @@ shared_examples 'helm commands' do
ALPINE_VERSION=$(cat /etc/alpine-release | cut -d '.' -f 1,2) ALPINE_VERSION=$(cat /etc/alpine-release | cut -d '.' -f 1,2)
echo http://mirror.clarkson.edu/alpine/v$ALPINE_VERSION/main >> /etc/apk/repositories echo http://mirror.clarkson.edu/alpine/v$ALPINE_VERSION/main >> /etc/apk/repositories
echo http://mirror1.hs-esslingen.de/pub/Mirrors/alpine/v$ALPINE_VERSION/main >> /etc/apk/repositories echo http://mirror1.hs-esslingen.de/pub/Mirrors/alpine/v$ALPINE_VERSION/main >> /etc/apk/repositories
apk add -U ca-certificates openssl >/dev/null apk add -U wget ca-certificates openssl >/dev/null
wget -q -O - https://kubernetes-helm.storage.googleapis.com/helm-v2.7.0-linux-amd64.tar.gz | tar zxC /tmp >/dev/null wget -q -O - https://kubernetes-helm.storage.googleapis.com/helm-v2.7.0-linux-amd64.tar.gz | tar zxC /tmp >/dev/null
mv /tmp/linux-amd64/helm /usr/bin/ mv /tmp/linux-amd64/helm /usr/bin/
EOS EOS
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment