Commit 34888f9a authored by 🤖 GitLab Bot 🤖's avatar 🤖 GitLab Bot 🤖

Merge branch 'ce-to-ee-2018-11-15' into 'master'

CE upstream - 2018-11-15 21:22 UTC

See merge request gitlab-org/gitlab-ee!8476
parents 392885b2 e89c0d20
...@@ -11,6 +11,7 @@ class Admin::ImpersonationTokensController < Admin::ApplicationController ...@@ -11,6 +11,7 @@ class Admin::ImpersonationTokensController < Admin::ApplicationController
@impersonation_token = finder.build(impersonation_token_params) @impersonation_token = finder.build(impersonation_token_params)
if @impersonation_token.save if @impersonation_token.save
PersonalAccessToken.redis_store!(current_user.id, @impersonation_token.token)
redirect_to admin_user_impersonation_tokens_path, notice: "A new impersonation token has been created." redirect_to admin_user_impersonation_tokens_path, notice: "A new impersonation token has been created."
else else
set_index_vars set_index_vars
...@@ -53,6 +54,8 @@ class Admin::ImpersonationTokensController < Admin::ApplicationController ...@@ -53,6 +54,8 @@ class Admin::ImpersonationTokensController < Admin::ApplicationController
@impersonation_token ||= finder.build @impersonation_token ||= finder.build
@inactive_impersonation_tokens = finder(state: 'inactive').execute @inactive_impersonation_tokens = finder(state: 'inactive').execute
@active_impersonation_tokens = finder(state: 'active').execute.order(:expires_at) @active_impersonation_tokens = finder(state: 'active').execute.order(:expires_at)
@new_impersonation_token = PersonalAccessToken.redis_getdel(current_user.id)
end end
# rubocop: enable CodeReuse/ActiveRecord # rubocop: enable CodeReuse/ActiveRecord
end end
...@@ -5,6 +5,11 @@ ...@@ -5,6 +5,11 @@
.row.prepend-top-default .row.prepend-top-default
.col-lg-12 .col-lg-12
- if @new_impersonation_token
= render "shared/personal_access_tokens_created_container", new_token_value: @new_impersonation_token,
container_title: 'Your New Impersonation Token',
clipboard_button_title: 'Copy impersonation token to clipboard'
= render "shared/personal_access_tokens_form", path: admin_user_impersonation_tokens_path, impersonation: true, token: @impersonation_token, scopes: @scopes = render "shared/personal_access_tokens_form", path: admin_user_impersonation_tokens_path, impersonation: true, token: @impersonation_token, scopes: @scopes
= render "shared/personal_access_tokens_table", impersonation: true, active_tokens: @active_impersonation_tokens, inactive_tokens: @inactive_impersonation_tokens = render "shared/personal_access_tokens_table", impersonation: true, active_tokens: @active_impersonation_tokens, inactive_tokens: @inactive_impersonation_tokens
...@@ -14,17 +14,7 @@ ...@@ -14,17 +14,7 @@
.col-lg-8 .col-lg-8
- if @new_personal_access_token - if @new_personal_access_token
.created-personal-access-token-container = render "shared/personal_access_tokens_created_container", new_token_value: @new_personal_access_token
%h5.prepend-top-0
Your New Personal Access Token
.form-group
.input-group
= text_field_tag 'created-personal-access-token', @new_personal_access_token, readonly: true, class: "form-control js-select-on-focus", 'aria-describedby' => "created-personal-access-token-help-block"
%span.input-group-append
= clipboard_button(text: @new_personal_access_token, title: "Copy personal access token to clipboard", placement: "left", class: "input-group-text btn-default btn-clipboard")
%span#created-personal-access-token-help-block.form-text.text-muted.text-danger Make sure you save it - you won't be able to access it again.
%hr
= render "shared/personal_access_tokens_form", path: profile_personal_access_tokens_path, impersonation: false, token: @personal_access_token, scopes: @scopes = render "shared/personal_access_tokens_form", path: profile_personal_access_tokens_path, impersonation: false, token: @personal_access_token, scopes: @scopes
......
- container_title = local_assigns.fetch(:container_title, 'Your New Personal Access Token')
- clipboard_button_title = local_assigns.fetch(:clipboard_button_title, 'Copy personal access token to clipboard')
.created-personal-access-token-container
%h5.prepend-top-0
= container_title
.form-group
.input-group
= text_field_tag 'created-personal-access-token', new_token_value, readonly: true, class: "form-control js-select-on-focus", 'aria-describedby' => "created-token-help-block"
%span.input-group-append
= clipboard_button(text: new_token_value, title: clipboard_button_title, placement: "left", class: "input-group-text btn-default btn-clipboard")
%span#created-token-help-block.form-text.text-muted.text-danger Make sure you save it - you won't be able to access it again.
%hr
...@@ -15,8 +15,6 @@ ...@@ -15,8 +15,6 @@
%th Created %th Created
%th Expires %th Expires
%th Scopes %th Scopes
- if impersonation
%th Token
%th %th
%tbody %tbody
- active_tokens.each do |token| - active_tokens.each do |token|
...@@ -30,10 +28,6 @@ ...@@ -30,10 +28,6 @@
- else - else
%span.token-never-expires-label Never %span.token-never-expires-label Never
%td= token.scopes.present? ? token.scopes.join(", ") : "<no scopes selected>" %td= token.scopes.present? ? token.scopes.join(", ") : "<no scopes selected>"
- if impersonation
%td.token-token-container
= text_field_tag 'impersonation-token-token', token.token, readonly: true, class: "form-control"
= clipboard_button(text: token.token)
- path = impersonation ? revoke_admin_user_impersonation_token_path(token.user, token) : revoke_profile_personal_access_token_path(token) - path = impersonation ? revoke_admin_user_impersonation_token_path(token.user, token) : revoke_profile_personal_access_token_path(token)
%td= link_to "Revoke", path, method: :put, class: "btn btn-danger float-right", data: { confirm: "Are you sure you want to revoke this #{type} Token? This action cannot be undone." } %td= link_to "Revoke", path, method: :put, class: "btn btn-danger float-right", data: { confirm: "Are you sure you want to revoke this #{type} Token? This action cannot be undone." }
- else - else
......
---
title: Display impersonation token value only after creation
merge_request: 22916
author:
type: fixed
---
title: Enable even more frozen string in lib/gitlab/**/*.rb
merge_request:
author: gfyoung
type: performance
...@@ -1077,7 +1077,6 @@ Example response: ...@@ -1077,7 +1077,6 @@ Example response:
[ [
{ {
"active" : true, "active" : true,
"token" : "EsMo-vhKfXGwX9RKrwiy",
"scopes" : [ "scopes" : [
"api" "api"
], ],
...@@ -1094,7 +1093,6 @@ Example response: ...@@ -1094,7 +1093,6 @@ Example response:
"read_user" "read_user"
], ],
"revoked" : true, "revoked" : true,
"token" : "ZcZRpLeEuQRprkRjYydY",
"name" : "mytoken2", "name" : "mytoken2",
"created_at" : "2017-03-17T17:19:28.697Z", "created_at" : "2017-03-17T17:19:28.697Z",
"id" : 3, "id" : 3,
...@@ -1130,7 +1128,6 @@ Example response: ...@@ -1130,7 +1128,6 @@ Example response:
```json ```json
{ {
"active" : true, "active" : true,
"token" : "EsMo-vhKfXGwX9RKrwiy",
"scopes" : [ "scopes" : [
"api" "api"
], ],
...@@ -1147,6 +1144,8 @@ Example response: ...@@ -1147,6 +1144,8 @@ Example response:
> Requires admin permissions. > Requires admin permissions.
> Token values are returned once. Make sure you save it - you won't be able to access it again.
It creates a new impersonation token. Note that only administrators can do this. It creates a new impersonation token. Note that only administrators can do this.
You are only able to create impersonation tokens to impersonate the user and perform You are only able to create impersonation tokens to impersonate the user and perform
both API calls and Git reads and writes. The user will not see these tokens in their profile both API calls and Git reads and writes. The user will not see these tokens in their profile
......
...@@ -1291,7 +1291,11 @@ module API ...@@ -1291,7 +1291,11 @@ module API
expose :token expose :token
end end
class ImpersonationToken < PersonalAccessTokenWithToken class ImpersonationToken < PersonalAccessToken
expose :impersonation
end
class ImpersonationTokenWithToken < PersonalAccessTokenWithToken
expose :impersonation expose :impersonation
end end
......
...@@ -537,7 +537,7 @@ module API ...@@ -537,7 +537,7 @@ module API
desc 'Create a impersonation token. Available only for admins.' do desc 'Create a impersonation token. Available only for admins.' do
detail 'This feature was introduced in GitLab 9.0' detail 'This feature was introduced in GitLab 9.0'
success Entities::ImpersonationToken success Entities::ImpersonationTokenWithToken
end end
params do params do
requires :name, type: String, desc: 'The name of the impersonation token' requires :name, type: String, desc: 'The name of the impersonation token'
...@@ -548,7 +548,7 @@ module API ...@@ -548,7 +548,7 @@ module API
impersonation_token = finder.build(declared_params(include_missing: false)) impersonation_token = finder.build(declared_params(include_missing: false))
if impersonation_token.save if impersonation_token.save
present impersonation_token, with: Entities::ImpersonationToken present impersonation_token, with: Entities::ImpersonationTokenWithToken
else else
render_validation_error!(impersonation_token) render_validation_error!(impersonation_token)
end end
......
# frozen_string_literal: true
require 'fogbugz' require 'fogbugz'
module Gitlab module Gitlab
......
# frozen_string_literal: true
module Gitlab module Gitlab
module FogbugzImport module FogbugzImport
class Importer class Importer
......
# frozen_string_literal: true
module Gitlab module Gitlab
module FogbugzImport module FogbugzImport
class ProjectCreator class ProjectCreator
......
# frozen_string_literal: true
module Gitlab module Gitlab
module FogbugzImport module FogbugzImport
class Repository class Repository
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Gfm module Gfm
## ##
......
# frozen_string_literal: true
require 'fileutils' require 'fileutils'
module Gitlab module Gitlab
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Git module Git
# Parses root .gitattributes file at a given ref # Parses root .gitattributes file at a given ref
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Git module Git
# Class for parsing Git attribute files and extracting the attributes for # Class for parsing Git attribute files and extracting the attributes for
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Git module Git
class Blame class Blame
......
# frozen_string_literal: true
# Gitaly note: JV: seems to be completely migrated (behind feature flags). # Gitaly note: JV: seems to be completely migrated (behind feature flags).
module Gitlab module Gitlab
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Git module Git
class Branch < Ref class Branch < Ref
......
# frozen_string_literal: true
# Gitlab::Git::Commit is a wrapper around Gitaly::GitCommit # Gitlab::Git::Commit is a wrapper around Gitaly::GitCommit
module Gitlab module Gitlab
module Git module Git
......
# frozen_string_literal: true
# Gitlab::Git::CommitStats counts the additions, deletions, and total changes # Gitlab::Git::CommitStats counts the additions, deletions, and total changes
# in a commit. # in a commit.
module Gitlab module Gitlab
......
# frozen_string_literal: true
# Gitaly note: JV: no RPC's here. # Gitaly note: JV: no RPC's here.
module Gitlab module Gitlab
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Git module Git
module Conflict module Conflict
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Git module Git
module Conflict module Conflict
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Git module Git
module Conflict module Conflict
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Git module Git
module Conflict module Conflict
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Git module Git
class Diff class Diff
......
# frozen_string_literal: true
# Gitaly note: JV: no RPC's here. # Gitaly note: JV: no RPC's here.
module Gitlab module Gitlab
......
# frozen_string_literal: true
# Gitaly note: JV: no RPC's here. # Gitaly note: JV: no RPC's here.
module Gitlab module Gitlab
......
# frozen_string_literal: true
# Gitaly note: JV: no RPC's here. # Gitaly note: JV: no RPC's here.
module Gitlab module Gitlab
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Git module Git
class Index class Index
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Git module Git
class LfsChanges class LfsChanges
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Git module Git
class LfsPointerFile class LfsPointerFile
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Git module Git
class OperationService class OperationService
......
# frozen_string_literal: true
# Gitaly note: JV: no RPC's here. # Gitaly note: JV: no RPC's here.
module Gitlab module Gitlab
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Git module Git
# #
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Git module Git
# This class behaves like a struct with fields :blob_id, :blob_size, :operation, :old_path, :new_path # This class behaves like a struct with fields :blob_id, :blob_size, :operation, :old_path, :new_path
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Git module Git
class Ref class Ref
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Git module Git
class RemoteMirror class RemoteMirror
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Git module Git
# #
......
# frozen_string_literal: true
require 'tempfile' require 'tempfile'
require 'forwardable' require 'forwardable'
require "rubygems/package" require "rubygems/package"
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Git module Git
module RepositoryMirroring module RepositoryMirroring
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Git module Git
class Tag < Ref class Tag < Ref
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Git module Git
class Tree class Tree
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Git module Git
class User class User
......
# frozen_string_literal: true
# Gitaly note: JV: no RPC's here. # Gitaly note: JV: no RPC's here.
module Gitlab module Gitlab
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Git module Git
module Version module Version
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Git module Git
class Wiki class Wiki
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Git module Git
class WikiFile class WikiFile
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Git module Git
class WikiPage class WikiPage
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Git module Git
class WikiPageVersion class WikiPageVersion
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Git module Git
module WrapsGitalyErrors module WrapsGitalyErrors
......
# frozen_string_literal: true
module Gitlab module Gitlab
module GitalyClient module GitalyClient
# This module expects an `ATTRS` const to be defined on the subclass # This module expects an `ATTRS` const to be defined on the subclass
......
# frozen_string_literal: true
module Gitlab module Gitlab
module GitalyClient module GitalyClient
class BlobService class BlobService
...@@ -15,7 +17,7 @@ module Gitlab ...@@ -15,7 +17,7 @@ module Gitlab
) )
response = GitalyClient.call(@gitaly_repo.storage_name, :blob_service, :get_blob, request, timeout: GitalyClient.fast_timeout) response = GitalyClient.call(@gitaly_repo.storage_name, :blob_service, :get_blob, request, timeout: GitalyClient.fast_timeout)
data = '' data = []
blob = nil blob = nil
response.each do |msg| response.each do |msg|
if blob.nil? if blob.nil?
...@@ -27,6 +29,8 @@ module Gitlab ...@@ -27,6 +29,8 @@ module Gitlab
return nil if blob.oid.blank? return nil if blob.oid.blank?
data = data.join
Gitlab::Git::Blob.new( Gitlab::Git::Blob.new(
id: blob.oid, id: blob.oid,
size: blob.size, size: blob.size,
......
# frozen_string_literal: true
module Gitlab module Gitlab
module GitalyClient module GitalyClient
class BlobsStitcher class BlobsStitcher
......
# frozen_string_literal: true
module Gitlab module Gitlab
module GitalyClient module GitalyClient
class CommitService class CommitService
...@@ -93,7 +95,7 @@ module Gitlab ...@@ -93,7 +95,7 @@ module Gitlab
response = GitalyClient.call(@repository.storage, :commit_service, :tree_entry, request, timeout: GitalyClient.medium_timeout) response = GitalyClient.call(@repository.storage, :commit_service, :tree_entry, request, timeout: GitalyClient.medium_timeout)
entry = nil entry = nil
data = '' data = []
response.each do |msg| response.each do |msg|
if entry.nil? if entry.nil?
entry = msg entry = msg
...@@ -103,7 +105,7 @@ module Gitlab ...@@ -103,7 +105,7 @@ module Gitlab
data << msg.data data << msg.data
end end
entry.data = data entry.data = data.join
entry unless entry.oid.blank? entry unless entry.oid.blank?
end end
...@@ -254,7 +256,7 @@ module Gitlab ...@@ -254,7 +256,7 @@ module Gitlab
) )
response = GitalyClient.call(@repository.storage, :commit_service, :raw_blame, request, timeout: GitalyClient.medium_timeout) response = GitalyClient.call(@repository.storage, :commit_service, :raw_blame, request, timeout: GitalyClient.medium_timeout)
response.reduce("") { |memo, msg| memo << msg.data } response.reduce([]) { |memo, msg| memo << msg.data }.join
end end
def find_commit(revision) def find_commit(revision)
...@@ -345,8 +347,8 @@ module Gitlab ...@@ -345,8 +347,8 @@ module Gitlab
request = Gitaly::ExtractCommitSignatureRequest.new(repository: @gitaly_repo, commit_id: commit_id) request = Gitaly::ExtractCommitSignatureRequest.new(repository: @gitaly_repo, commit_id: commit_id)
response = GitalyClient.call(@repository.storage, :commit_service, :extract_commit_signature, request) response = GitalyClient.call(@repository.storage, :commit_service, :extract_commit_signature, request)
signature = ''.b signature = +''.b
signed_text = ''.b signed_text = +''.b
response.each do |message| response.each do |message|
signature << message.signature signature << message.signature
...@@ -364,7 +366,7 @@ module Gitlab ...@@ -364,7 +366,7 @@ module Gitlab
request = Gitaly::GetCommitSignaturesRequest.new(repository: @gitaly_repo, commit_ids: commit_ids) request = Gitaly::GetCommitSignaturesRequest.new(repository: @gitaly_repo, commit_ids: commit_ids)
response = GitalyClient.call(@repository.storage, :commit_service, :get_commit_signatures, request, timeout: GitalyClient.fast_timeout) response = GitalyClient.call(@repository.storage, :commit_service, :get_commit_signatures, request, timeout: GitalyClient.fast_timeout)
signatures = Hash.new { |h, k| h[k] = [''.b, ''.b] } signatures = Hash.new { |h, k| h[k] = [+''.b, +''.b] }
current_commit_id = nil current_commit_id = nil
response.each do |message| response.each do |message|
...@@ -383,7 +385,7 @@ module Gitlab ...@@ -383,7 +385,7 @@ module Gitlab
request = Gitaly::GetCommitMessagesRequest.new(repository: @gitaly_repo, commit_ids: commit_ids) request = Gitaly::GetCommitMessagesRequest.new(repository: @gitaly_repo, commit_ids: commit_ids)
response = GitalyClient.call(@repository.storage, :commit_service, :get_commit_messages, request, timeout: GitalyClient.fast_timeout) response = GitalyClient.call(@repository.storage, :commit_service, :get_commit_messages, request, timeout: GitalyClient.fast_timeout)
messages = Hash.new { |h, k| h[k] = ''.b } messages = Hash.new { |h, k| h[k] = +''.b }
current_commit_id = nil current_commit_id = nil
response.each do |rpc_message| response.each do |rpc_message|
......
# frozen_string_literal: true
module Gitlab module Gitlab
module GitalyClient module GitalyClient
class ConflictFilesStitcher class ConflictFilesStitcher
...@@ -17,7 +19,7 @@ module Gitlab ...@@ -17,7 +19,7 @@ module Gitlab
current_file = file_from_gitaly_header(gitaly_file.header) current_file = file_from_gitaly_header(gitaly_file.header)
else else
current_file.raw_content << gitaly_file.content current_file.raw_content = "#{current_file.raw_content}#{gitaly_file.content}"
end end
end end
end end
......
# frozen_string_literal: true
module Gitlab module Gitlab
module GitalyClient module GitalyClient
class ConflictsService class ConflictsService
......
# frozen_string_literal: true
module Gitlab module Gitlab
module GitalyClient module GitalyClient
class Diff class Diff
......
# frozen_string_literal: true
module Gitlab module Gitlab
module GitalyClient module GitalyClient
class DiffStitcher class DiffStitcher
...@@ -20,7 +22,7 @@ module Gitlab ...@@ -20,7 +22,7 @@ module Gitlab
current_diff = GitalyClient::Diff.new(diff_params) current_diff = GitalyClient::Diff.new(diff_params)
else else
current_diff.patch += diff_msg.raw_patch_data current_diff.patch = "#{current_diff.patch}#{diff_msg.raw_patch_data}"
end end
if diff_msg.end_of_patch if diff_msg.end_of_patch
......
# frozen_string_literal: true
module Gitlab module Gitlab
module GitalyClient module GitalyClient
class HealthCheckService class HealthCheckService
......
# frozen_string_literal: true
module Gitlab module Gitlab
module GitalyClient module GitalyClient
class NamespaceService class NamespaceService
......
# frozen_string_literal: true
module Gitlab module Gitlab
module GitalyClient module GitalyClient
class NotificationService class NotificationService
......
# frozen_string_literal: true
module Gitlab module Gitlab
module GitalyClient module GitalyClient
class OperationService class OperationService
......
# frozen_string_literal: true
module Gitlab module Gitlab
module GitalyClient module GitalyClient
class QueueEnumerator class QueueEnumerator
......
# frozen_string_literal: true
module Gitlab module Gitlab
module GitalyClient module GitalyClient
class RefService class RefService
...@@ -225,7 +227,7 @@ module Gitlab ...@@ -225,7 +227,7 @@ module Gitlab
request = Gitaly::GetTagMessagesRequest.new(repository: @gitaly_repo, tag_ids: tag_ids) request = Gitaly::GetTagMessagesRequest.new(repository: @gitaly_repo, tag_ids: tag_ids)
response = GitalyClient.call(@repository.storage, :ref_service, :get_tag_messages, request, timeout: GitalyClient.fast_timeout) response = GitalyClient.call(@repository.storage, :ref_service, :get_tag_messages, request, timeout: GitalyClient.fast_timeout)
messages = Hash.new { |h, k| h[k] = ''.b } messages = Hash.new { |h, k| h[k] = +''.b }
current_tag_id = nil current_tag_id = nil
response.each do |rpc_message| response.each do |rpc_message|
......
# frozen_string_literal: true
module Gitlab module Gitlab
module GitalyClient module GitalyClient
class RemoteService class RemoteService
......
# frozen_string_literal: true
module Gitlab module Gitlab
module GitalyClient module GitalyClient
class RepositoryService class RepositoryService
...@@ -56,9 +58,9 @@ module Gitlab ...@@ -56,9 +58,9 @@ module Gitlab
request = Gitaly::GetInfoAttributesRequest.new(repository: @gitaly_repo) request = Gitaly::GetInfoAttributesRequest.new(repository: @gitaly_repo)
response = GitalyClient.call(@storage, :repository_service, :get_info_attributes, request, timeout: GitalyClient.fast_timeout) response = GitalyClient.call(@storage, :repository_service, :get_info_attributes, request, timeout: GitalyClient.fast_timeout)
response.each_with_object("") do |message, attributes| response.each_with_object([]) do |message, attributes|
attributes << message.attributes attributes << message.attributes
end end.join
end end
def fetch_remote(remote, ssh_auth:, forced:, no_tags:, timeout:, prune: true) def fetch_remote(remote, ssh_auth:, forced:, no_tags:, timeout:, prune: true)
......
# frozen_string_literal: true
module Gitlab module Gitlab
module GitalyClient module GitalyClient
# Meant for extraction of server data, and later maybe to perform misc task # Meant for extraction of server data, and later maybe to perform misc task
......
# frozen_string_literal: true
module Gitlab module Gitlab
module GitalyClient module GitalyClient
class StorageService class StorageService
......
# frozen_string_literal: true
module Gitlab module Gitlab
module GitalyClient module GitalyClient
# This is a chokepoint that is meant to help us stop remove all places # This is a chokepoint that is meant to help us stop remove all places
......
# frozen_string_literal: true
module Gitlab module Gitlab
module GitalyClient module GitalyClient
module Util module Util
......
# frozen_string_literal: true
module Gitlab module Gitlab
module GitalyClient module GitalyClient
class WikiFile class WikiFile
......
# frozen_string_literal: true
module Gitlab module Gitlab
module GitalyClient module GitalyClient
class WikiPage class WikiPage
......
# frozen_string_literal: true
require 'stringio' require 'stringio'
module Gitlab module Gitlab
...@@ -139,7 +141,7 @@ module Gitlab ...@@ -139,7 +141,7 @@ module Gitlab
next unless message.name.present? || wiki_file next unless message.name.present? || wiki_file
if wiki_file if wiki_file
wiki_file.raw_data << message.raw_data wiki_file.raw_data = "#{wiki_file.raw_data}#{message.raw_data}"
else else
wiki_file = GitalyClient::WikiFile.new(message.to_h) wiki_file = GitalyClient::WikiFile.new(message.to_h)
# All gRPC strings in a response are frozen, so we get # All gRPC strings in a response are frozen, so we get
...@@ -160,7 +162,7 @@ module Gitlab ...@@ -160,7 +162,7 @@ module Gitlab
) )
response = GitalyClient.call(@repository.storage, :wiki_service, :wiki_get_formatted_data, request) response = GitalyClient.call(@repository.storage, :wiki_service, :wiki_get_formatted_data, request)
response.reduce("") { |memo, msg| memo << msg.data } response.reduce([]) { |memo, msg| memo << msg.data }.join
end end
private private
......
# frozen_string_literal: true
module Gitlab module Gitlab
module GitlabImport module GitlabImport
class Client class Client
......
# frozen_string_literal: true
module Gitlab module Gitlab
module GitlabImport module GitlabImport
class Importer class Importer
...@@ -22,22 +24,22 @@ module Gitlab ...@@ -22,22 +24,22 @@ module Gitlab
issues = client.issues(project_identifier) issues = client.issues(project_identifier)
issues.each do |issue| issues.each do |issue|
body = @formatter.author_line(issue["author"]["name"]) body = [@formatter.author_line(issue["author"]["name"])]
body += issue["description"] body << issue["description"]
comments = client.issue_comments(project_identifier, issue["iid"]) comments = client.issue_comments(project_identifier, issue["iid"])
if comments.any? if comments.any?
body += @formatter.comments_header body << @formatter.comments_header
end end
comments.each do |comment| comments.each do |comment|
body += @formatter.comment(comment["author"]["name"], comment["created_at"], comment["body"]) body << @formatter.comment(comment["author"]["name"], comment["created_at"], comment["body"])
end end
project.issues.create!( project.issues.create!(
iid: issue["iid"], iid: issue["iid"],
description: body, description: body.join,
title: issue["title"], title: issue["title"],
state: issue["state"], state: issue["state"],
updated_at: issue["updated_at"], updated_at: issue["updated_at"],
......
# frozen_string_literal: true
module Gitlab module Gitlab
module GitlabImport module GitlabImport
class ProjectCreator class ProjectCreator
......
# frozen_string_literal: true
module Gitlab module Gitlab
module GoogleCodeImport module GoogleCodeImport
class Client class Client
......
# frozen_string_literal: true
module Gitlab module Gitlab
module GoogleCodeImport module GoogleCodeImport
class Importer class Importer
......
# frozen_string_literal: true
module Gitlab module Gitlab
module GoogleCodeImport module GoogleCodeImport
class ProjectCreator class ProjectCreator
......
# frozen_string_literal: true
module Gitlab module Gitlab
module GoogleCodeImport module GoogleCodeImport
class Repository class Repository
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Gpg module Gpg
class Commit class Commit
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Gpg module Gpg
class InvalidGpgSignatureUpdater class InvalidGpgSignatureUpdater
......
# frozen_string_literal: true
module Gitlab module Gitlab
module GrapeLogging module GrapeLogging
module Formatters module Formatters
......
# frozen_string_literal: true
# This grape_logging module (https://github.com/aserafin/grape_logging) makes it # This grape_logging module (https://github.com/aserafin/grape_logging) makes it
# possible to log how much time an API request was queued by Workhorse. # possible to log how much time an API request was queued by Workhorse.
module Gitlab module Gitlab
......
# frozen_string_literal: true
# This grape_logging module (https://github.com/aserafin/grape_logging) makes it # This grape_logging module (https://github.com/aserafin/grape_logging) makes it
# possible to log the user who performed the Grape API action by retrieving # possible to log the user who performed the Grape API action by retrieving
# the user context from the request environment. # the user context from the request environment.
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Graphql module Graphql
# Allow fields to declare permissions their objects must have. The field # Allow fields to declare permissions their objects must have. The field
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Graphql module Graphql
module Authorize module Authorize
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Graphql module Graphql
module Authorize module Authorize
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Graphql module Graphql
module Connections module Connections
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Graphql module Graphql
module Connections module Connections
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Graphql module Graphql
module Errors module Errors
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Graphql module Graphql
module ExposePermissions module ExposePermissions
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Graphql module Graphql
module Present module Present
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Graphql module Graphql
module Present module Present
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Graphql module Graphql
class Variables class Variables
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Graphs module Graphs
class Commits class Commits
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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