Skip to content
Snippets Groups Projects
Commit 4eea104c authored by GitLab Bot's avatar GitLab Bot
Browse files

Add latest changes from gitlab-org/gitlab@master

parent b86f474b
No related branches found
No related tags found
No related merge requests found
Showing
with 146 additions and 64 deletions
Loading
Loading
@@ -170,8 +170,8 @@ group :unicorn do
end
 
group :puma do
gem 'puma', '~> 4.3.0', require: false
gem 'puma_worker_killer', '~> 0.1.1', require: false
gem 'gitlab-puma', '~> 4.3.1.gitlab.2', require: false
gem 'gitlab-puma_worker_killer', '~> 0.1.1.gitlab.1', require: false
gem 'rack-timeout', require: false
end
 
Loading
Loading
@@ -346,7 +346,7 @@ group :development do
end
 
group :development, :test do
gem 'bullet', '~> 5.5.0', require: !!ENV['ENABLE_BULLET']
gem 'bullet', '~> 6.0.2', require: !!ENV['ENABLE_BULLET']
gem 'pry-byebug', '~> 3.5.1', platform: :mri
gem 'pry-rails', '~> 0.3.4'
 
Loading
Loading
Loading
Loading
@@ -118,9 +118,9 @@ GEM
brakeman (4.2.1)
browser (2.5.3)
builder (3.2.3)
bullet (5.5.1)
bullet (6.0.2)
activesupport (>= 3.0.0)
uniform_notifier (~> 1.10.0)
uniform_notifier (~> 1.11)
bundler-audit (0.5.0)
bundler (~> 1.2)
thor (~> 0.18)
Loading
Loading
@@ -372,6 +372,11 @@ GEM
gitlab-license (1.0.0)
gitlab-markup (1.7.0)
gitlab-net-dns (0.9.1)
gitlab-puma (4.3.1.gitlab.2)
nio4r (~> 2.0)
gitlab-puma_worker_killer (0.1.1.gitlab.1)
get_process_mem (~> 0.2)
gitlab-puma (>= 2.7, < 5)
gitlab-sidekiq-fetcher (0.5.2)
sidekiq (~> 5)
gitlab-styles (2.8.0)
Loading
Loading
@@ -619,7 +624,7 @@ GEM
net-ntp (2.1.3)
net-ssh (5.2.0)
netrc (0.11.0)
nio4r (2.3.1)
nio4r (2.5.2)
no_proxy_fix (0.1.2)
nokogiri (1.10.5)
mini_portile2 (~> 2.4.0)
Loading
Loading
@@ -748,11 +753,6 @@ GEM
pry-rails (0.3.6)
pry (>= 0.10.4)
public_suffix (3.1.1)
puma (4.3.1)
nio4r (~> 2.0)
puma_worker_killer (0.1.1)
get_process_mem (~> 0.2)
puma (>= 2.7, < 5)
pyu-ruby-sasl (0.0.3.3)
raabro (1.1.6)
rack (2.0.7)
Loading
Loading
@@ -1057,7 +1057,7 @@ GEM
unicorn-worker-killer (0.4.4)
get_process_mem (~> 0)
unicorn (>= 4, < 6)
uniform_notifier (1.10.0)
uniform_notifier (1.13.0)
unleash (0.1.5)
murmurhash3 (~> 0.1.6)
unparser (0.4.5)
Loading
Loading
@@ -1139,7 +1139,7 @@ DEPENDENCIES
bootstrap_form (~> 4.2.0)
brakeman (~> 4.2)
browser (~> 2.5)
bullet (~> 5.5.0)
bullet (~> 6.0.2)
bundler-audit (~> 0.5.0)
capybara (~> 3.22.0)
capybara-screenshot (~> 1.0.22)
Loading
Loading
@@ -1200,6 +1200,8 @@ DEPENDENCIES
gitlab-license (~> 1.0)
gitlab-markup (~> 1.7.0)
gitlab-net-dns (~> 0.9.1)
gitlab-puma (~> 4.3.1.gitlab.2)
gitlab-puma_worker_killer (~> 0.1.1.gitlab.1)
gitlab-sidekiq-fetcher (= 0.5.2)
gitlab-styles (~> 2.7)
gitlab_chronic_duration (~> 0.10.6.2)
Loading
Loading
@@ -1280,8 +1282,6 @@ DEPENDENCIES
prometheus-client-mmap (~> 0.9.10)
pry-byebug (~> 3.5.1)
pry-rails (~> 0.3.4)
puma (~> 4.3.0)
puma_worker_killer (~> 0.1.1)
rack (~> 2.0.7)
rack-attack (~> 6.2.0)
rack-cors (~> 1.0.0)
Loading
Loading
Loading
Loading
@@ -145,7 +145,8 @@ export default {
:is-loading="model.isLoadingDeployBoard"
:is-empty="model.isEmptyDeployBoard"
:has-legacy-app-label="model.hasLegacyAppLabel"
:logs-path="model.logs_path"
:project-path="model.project_path"
:environment-name="model.name"
/>
</div>
</div>
Loading
Loading
import { __ } from '~/locale';
import { parseUrlPathname, parseUrl } from '../lib/utils/common_utils';
function swapActiveState(activateBtn, deactivateBtn) {
activateBtn.classList.add('is-active');
deactivateBtn.classList.remove('is-active');
}
 
export default () => {
const shareBtn = document.querySelector('.js-share-btn');
 
if (shareBtn) {
const { protocol, host, pathname } = window.location;
const embedBtn = document.querySelector('.js-embed-btn');
const snippetUrlArea = document.querySelector('.js-snippet-url-area');
const embedAction = document.querySelector('.js-embed-action');
const url = `${protocol}//${host + pathname}`;
const dataUrl = snippetUrlArea.getAttribute('data-url');
snippetUrlArea.addEventListener('click', () => snippetUrlArea.select());
 
shareBtn.addEventListener('click', () => {
shareBtn.classList.add('is-active');
embedBtn.classList.remove('is-active');
snippetUrlArea.value = url;
swapActiveState(shareBtn, embedBtn);
snippetUrlArea.value = dataUrl;
embedAction.innerText = __('Share');
});
 
embedBtn.addEventListener('click', () => {
embedBtn.classList.add('is-active');
shareBtn.classList.remove('is-active');
const scriptTag = `<script src="${url}.js"></script>`;
const parser = parseUrl(dataUrl);
const url = `${parser.origin + parseUrlPathname(dataUrl)}`;
const params = parser.search;
const scriptTag = `<script src="${url}.js${params}"></script>`;
swapActiveState(embedBtn, shareBtn);
snippetUrlArea.value = scriptTag;
embedAction.innerText = __('Embed');
});
Loading
Loading
Loading
Loading
@@ -5,8 +5,8 @@ class Projects::MergeRequests::DiffsController < Projects::MergeRequests::Applic
include RendersNotes
 
before_action :apply_diff_view_cookie!
before_action :commit, except: :diffs_batch
before_action :define_diff_vars, except: :diffs_batch
before_action :commit
before_action :define_diff_vars
before_action :define_diff_comment_vars, except: [:diffs_batch, :diffs_metadata]
 
def show
Loading
Loading
@@ -20,11 +20,7 @@ class Projects::MergeRequests::DiffsController < Projects::MergeRequests::Applic
def diffs_batch
return render_404 unless Feature.enabled?(:diffs_batch_load, @merge_request.project)
 
diffable = @merge_request.merge_request_diff
return render_404 unless diffable
diffs = diffable.diffs_in_batch(params[:page], params[:per_page], diff_options: diff_options)
diffs = @compare.diffs_in_batch(params[:page], params[:per_page], diff_options: diff_options)
positions = @merge_request.note_positions_for_paths(diffs.diff_file_paths, current_user)
 
diffs.unfold_diff_files(positions.unfoldable)
Loading
Loading
@@ -40,8 +36,10 @@ class Projects::MergeRequests::DiffsController < Projects::MergeRequests::Applic
end
 
def diffs_metadata
diffs = @compare.diffs(diff_options)
render json: DiffsMetadataSerializer.new(project: @merge_request.project)
.represent(@diffs, additional_attributes)
.represent(diffs, additional_attributes)
end
 
private
Loading
Loading
@@ -50,11 +48,13 @@ class Projects::MergeRequests::DiffsController < Projects::MergeRequests::Applic
[{ source_project: :namespace }, { target_project: :namespace }]
end
 
# Deprecated: https://gitlab.com/gitlab-org/gitlab/issues/37735
def render_diffs
diffs = @compare.diffs(diff_options)
@environment = @merge_request.environments_for(current_user).last
 
@diffs.unfold_diff_files(note_positions.unfoldable)
@diffs.write_cache
diffs.unfold_diff_files(note_positions.unfoldable)
diffs.write_cache
 
request = {
current_user: current_user,
Loading
Loading
@@ -64,15 +64,14 @@ class Projects::MergeRequests::DiffsController < Projects::MergeRequests::Applic
 
options = additional_attributes.merge(diff_view: diff_view)
 
render json: DiffsSerializer.new(request).represent(@diffs, options)
render json: DiffsSerializer.new(request).represent(diffs, options)
end
 
# Deprecated: https://gitlab.com/gitlab-org/gitlab/issues/37735
def define_diff_vars
@merge_request_diffs = @merge_request.merge_request_diffs.viewable.order_id_desc
@compare = commit || find_merge_request_diff_compare
return render_404 unless @compare
@diffs = @compare.diffs(diff_options)
end
 
# rubocop: disable CodeReuse/ActiveRecord
Loading
Loading
@@ -85,6 +84,8 @@ class Projects::MergeRequests::DiffsController < Projects::MergeRequests::Applic
# rubocop: enable CodeReuse/ActiveRecord
 
# rubocop: disable CodeReuse/ActiveRecord
#
# Deprecated: https://gitlab.com/gitlab-org/gitlab/issues/37735
def find_merge_request_diff_compare
@merge_request_diff =
if diff_id = params[:diff_id].presence
Loading
Loading
@@ -127,6 +128,7 @@ class Projects::MergeRequests::DiffsController < Projects::MergeRequests::Applic
}
end
 
# Deprecated: https://gitlab.com/gitlab-org/gitlab/issues/37735
def define_diff_comment_vars
@new_diff_note_attrs = {
noteable_type: 'MergeRequest',
Loading
Loading
Loading
Loading
@@ -112,6 +112,17 @@ module SnippetsHelper
content_tag(:script, nil, src: gitlab_snippet_url(snippet, format: :js))
end
 
def snippet_embed_input(snippet)
content_tag(:input,
nil,
type: :text,
readonly: true,
class: 'js-snippet-url-area snippet-embed-input form-control',
data: { url: gitlab_snippet_url(snippet) },
value: snippet_embed_tag(snippet),
autocomplete: 'off')
end
def snippet_badge(snippet)
return unless attrs = snippet_badge_attributes(snippet)
 
Loading
Loading
Loading
Loading
@@ -12,6 +12,7 @@ class Commit
include StaticModel
include Presentable
include ::Gitlab::Utils::StrongMemoize
include ActsAsPaginatedDiff
include CacheMarkdownField
 
attr_mentionable :safe_message, pipeline: :single_line
Loading
Loading
Loading
Loading
@@ -4,6 +4,7 @@ require 'set'
 
class Compare
include Gitlab::Utils::StrongMemoize
include ActsAsPaginatedDiff
 
delegate :same, :head, :base, to: :@compare
 
Loading
Loading
# frozen_string_literal: true
module ActsAsPaginatedDiff
# Comparisons going back to the repository will need proper batch
# loading (https://gitlab.com/gitlab-org/gitlab/issues/32859).
# For now, we're returning all the diffs available with
# no pagination data.
def diffs_in_batch(_batch_page, _batch_size, diff_options:)
diffs(diff_options)
end
end
Loading
Loading
@@ -309,20 +309,25 @@ class MergeRequestDiff < ApplicationRecord
end
 
def diffs_in_batch(batch_page, batch_size, diff_options:)
Gitlab::Diff::FileCollection::MergeRequestDiffBatch.new(self,
batch_page,
batch_size,
diff_options: diff_options)
fetching_repository_diffs(diff_options) do |comparison|
if comparison
comparison.diffs_in_batch(batch_page, batch_size, diff_options: diff_options)
else
diffs_in_batch_collection(batch_page, batch_size, diff_options: diff_options)
end
end
end
 
def diffs(diff_options = nil)
if without_files? && comparison = diff_refs&.compare_in(project)
fetching_repository_diffs(diff_options) do |comparison|
# It should fetch the repository when diffs are cleaned by the system.
# We don't keep these for storage overload purposes.
# See https://gitlab.com/gitlab-org/gitlab-foss/issues/37639
comparison.diffs(diff_options)
else
diffs_collection(diff_options)
if comparison
comparison.diffs(diff_options)
else
diffs_collection(diff_options)
end
end
end
 
Loading
Loading
@@ -430,6 +435,13 @@ class MergeRequestDiff < ApplicationRecord
 
private
 
def diffs_in_batch_collection(batch_page, batch_size, diff_options:)
Gitlab::Diff::FileCollection::MergeRequestDiffBatch.new(self,
batch_page,
batch_size,
diff_options: diff_options)
end
def encode_in_base64?(diff_text)
(diff_text.encoding == Encoding::BINARY && !diff_text.ascii_only?) ||
diff_text.include?("\0")
Loading
Loading
@@ -487,6 +499,25 @@ class MergeRequestDiff < ApplicationRecord
end
end
 
# Yields the block with the repository Compare object if it should
# fetch diffs from the repository instead DB.
def fetching_repository_diffs(diff_options)
return unless block_given?
diff_options ||= {}
# Can be read as: fetch the persisted diffs if yielded without the
# Compare object.
return yield unless without_files? || diff_options[:ignore_whitespace_change]
return yield unless diff_refs&.complete?
comparison = diff_refs.compare_in(repository.project)
return yield unless comparison
yield(comparison)
end
def use_external_diff?
return false unless has_attribute?(:external_diff)
return false unless Gitlab.config.external_diffs.enabled
Loading
Loading
- page_title _('Pod logs')
.row.empty-state
.col-sm-12
.svg-content
= image_tag 'illustrations/operations_log_pods_empty.svg'
.col-12
.text-content
%h4.text-center
= s_('Environments|No deployed environments')
%p.state-description.text-center
= s_('Logs|To see the pod logs, deploy your code to an environment.')
.text-center
= link_to s_('Environments|Learn about environments'), help_page_path('ci/environments'), class: 'btn btn-success'
Loading
Loading
@@ -44,7 +44,7 @@
%li
%button.js-share-btn.btn.btn-transparent{ type: 'button' }
%strong.embed-toggle-list-item= _("Share")
%input.js-snippet-url-area.snippet-embed-input.form-control{ type: "text", autocomplete: 'off', value: snippet_embed_tag(@snippet) }
= snippet_embed_input(@snippet)
.input-group-append
= clipboard_button(title: _('Copy'), class: 'js-clipboard-btn snippet-clipboard-btn btn btn-default', target: '.js-snippet-url-area')
.clearfix
---
title: Allow Job-Token authentication on Releases creation API
merge_request: 20632
author:
type: added
---
title: Do not allow specifying a Kubernetes namespace via CI template for managed
clusters
merge_request: 21223
author:
type: added
---
title: Rework pod logs navigation scheme
merge_request: 20578
author:
type: changed
---
title: CI template for Sentry managed app
merge_request: 21208
author:
type: added
---
title: Respect snippet query params when displaying embed urls
merge_request: 21131
author:
type: fixed
---
title: Fork Puma to validate scheduler fixes
merge_request: 21547
author:
type: performance
Loading
Loading
@@ -6,6 +6,7 @@ last_update: 2019-07-03
# Merge Trains **(PREMIUM)**
 
> [Introduced](https://gitlab.com/gitlab-org/gitlab/issues/9186) in [GitLab Premium](https://about.gitlab.com/pricing/) 12.0.
> [Squash and merge](../../../../user/project/merge_requests/squash_and_merge.md) support [introduced](https://gitlab.com/gitlab-org/gitlab/issues/13001) in [GitLab Premium](https://about.gitlab.com/pricing/) 12.6.
 
[Pipelines for merged results](../index.md#pipelines-for-merged-results-premium) introduces
running a build on the result of the merged code prior to merging, as a way to keep master green.
Loading
Loading
@@ -36,7 +37,6 @@ Merge trains have the following requirements and limitations:
If more than twenty merge requests are added to the merge train, the merge requests
will be queued until a slot in the merge train is free. There is no limit to the
number of merge requests that can be queued.
- This feature does not support [squash and merge](../../../../user/project/merge_requests/squash_and_merge.md).
 
<i class="fa fa-youtube-play youtube" aria-hidden="true"></i>
Watch this video for a demonstration on [how parallel execution
Loading
Loading
Loading
Loading
@@ -524,7 +524,7 @@ Here are some common pitfalls and how to overcome them:
 
```ruby
u = User.find_by_username('your-username')
s = SearchService.new(u, {:search => 'search_term', :scope => blobs})
s = SearchService.new(u, {:search => 'search_term', :scope => 'blobs'})
pp s.search_objects.to_a
```
 
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment