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

Add latest changes from gitlab-org/gitlab@master

parent 13867d66
No related branches found
No related tags found
No related merge requests found
Showing
with 76 additions and 20 deletions
Loading
Loading
@@ -417,7 +417,7 @@ end
 
gem 'octokit', '~> 4.9'
 
gem 'mail_room', '~> 0.9.1'
gem 'mail_room', '~> 0.10.0'
 
gem 'email_reply_trimmer', '~> 0.1'
gem 'html2text'
Loading
Loading
Loading
Loading
@@ -593,7 +593,7 @@ GEM
lumberjack (1.0.13)
mail (2.7.1)
mini_mime (>= 0.1.1)
mail_room (0.9.1)
mail_room (0.10.0)
marcel (0.3.3)
mimemagic (~> 0.3.2)
marginalia (1.8.0)
Loading
Loading
@@ -1247,7 +1247,7 @@ DEPENDENCIES
licensee (~> 8.9)
lograge (~> 0.5)
loofah (~> 2.2)
mail_room (~> 0.9.1)
mail_room (~> 0.10.0)
marginalia (~> 1.8.0)
memory_profiler (~> 0.9)
method_source (~> 0.8)
Loading
Loading
import { SwaggerUIBundle } from 'swagger-ui-dist';
import flash from '~/flash';
import { __ } from '~/locale';
export default () => {
const el = document.getElementById('js-openapi-viewer');
Promise.all([import(/* webpackChunkName: 'openapi' */ 'swagger-ui-dist/swagger-ui.css')])
.then(() => {
SwaggerUIBundle({
url: el.dataset.endpoint,
dom_id: '#js-openapi-viewer',
});
})
.catch(error => {
flash(__('Something went wrong while initializing the OpenAPI viewer'));
throw error;
});
};
import renderOpenApi from './openapi';
export default renderOpenApi;
Loading
Loading
@@ -39,6 +39,9 @@ export default class BlobViewer {
case 'notebook':
initViewer(import(/* webpackChunkName: 'notebook_viewer' */ '../notebook_viewer'));
break;
case 'openapi':
initViewer(import(/* webpackChunkName: 'openapi_viewer' */ '../openapi_viewer'));
break;
case 'pdf':
initViewer(import(/* webpackChunkName: 'pdf_viewer' */ '../pdf_viewer'));
break;
Loading
Loading
Loading
Loading
@@ -33,11 +33,9 @@ window.addEventListener('beforeunload', () => {
 
// Ignore AJAX errors caused by requests
// being cancelled due to browser navigation
const { gon } = window;
const featureFlagEnabled = gon && gon.features && gon.features.suppressAjaxNavigationErrors;
axios.interceptors.response.use(
response => response,
err => suppressAjaxErrorsDuringNavigation(err, isUserNavigating, featureFlagEnabled),
err => suppressAjaxErrorsDuringNavigation(err, isUserNavigating),
);
 
export default axios;
Loading
Loading
Loading
Loading
@@ -2,8 +2,8 @@
* An Axios error interceptor that suppresses AJAX errors caused
* by the request being cancelled when the user navigates to a new page
*/
export default (err, isUserNavigating, featureFlagEnabled) => {
if (featureFlagEnabled && isUserNavigating && err.code === 'ECONNABORTED') {
export default (err, isUserNavigating) => {
if (isUserNavigating && err.code === 'ECONNABORTED') {
// If the user is navigating away from the current page,
// prevent .then() and .catch() handlers from being
// called by returning a Promise that never resolves
Loading
Loading
Loading
Loading
@@ -486,3 +486,8 @@ span.idiff {
overflow-y: auto;
max-height: 20rem;
}
#js-openapi-viewer pre.version {
background-color: transparent;
border: transparent;
}
Loading
Loading
@@ -165,7 +165,7 @@ class ApplicationController < ActionController::Base
end
 
def log_exception(exception)
Gitlab::Sentry.track_exception(exception)
Gitlab::ErrorTracking.track_exception(exception)
 
backtrace_cleaner = request.env["action_dispatch.backtrace_cleaner"]
application_trace = ActionDispatch::ExceptionWrapper.new(backtrace_cleaner, exception).application_trace
Loading
Loading
@@ -533,7 +533,7 @@ class ApplicationController < ActionController::Base
end
 
def sentry_context(&block)
Gitlab::Sentry.with_context(current_user, &block)
Gitlab::ErrorTracking.with_context(current_user, &block)
end
 
def allow_gitaly_ref_name_caching
Loading
Loading
Loading
Loading
@@ -98,7 +98,7 @@ module IssuableActions
 
error_message = "Destroy confirmation not provided for #{issuable.human_class_name}"
exception = RuntimeError.new(error_message)
Gitlab::Sentry.track_exception(
Gitlab::ErrorTracking.track_exception(
exception,
project_path: issuable.project.full_path,
issuable_type: issuable.class.name,
Loading
Loading
Loading
Loading
@@ -8,11 +8,13 @@ class Projects::Ci::LintsController < Projects::ApplicationController
 
def create
@content = params[:content]
@error = Gitlab::Ci::YamlProcessor.validation_message(@content, yaml_processor_options)
@status = @error.blank?
result = Gitlab::Ci::YamlProcessor.new_with_validation_errors(@content, yaml_processor_options)
 
if @error.blank?
@config_processor = Gitlab::Ci::YamlProcessor.new(@content, yaml_processor_options)
@error = result.errors.join(', ')
@status = result.valid?
if result.valid?
@config_processor = result.content
@stages = @config_processor.stages
@builds = @config_processor.builds
@jobs = @config_processor.jobs
Loading
Loading
Loading
Loading
@@ -232,6 +232,7 @@ module ApplicationSettingsHelper
:metrics_port,
:metrics_sample_interval,
:metrics_timeout,
:minimum_password_length,
:mirror_available,
:pages_domain_verification_enabled,
:password_authentication_enabled_for_web,
Loading
Loading
Loading
Loading
@@ -44,7 +44,7 @@ module IconsHelper
def sprite_icon(icon_name, size: nil, css_class: nil)
if known_sprites&.exclude?(icon_name)
exception = ArgumentError.new("#{icon_name} is not a known icon in @gitlab-org/gitlab-svg")
Gitlab::Sentry.track_and_raise_for_dev_exception(exception)
Gitlab::ErrorTracking.track_and_raise_for_dev_exception(exception)
end
 
css_classes = []
Loading
Loading
Loading
Loading
@@ -57,7 +57,7 @@ module UsersHelper
 
unless user.association(:status).loaded?
exception = RuntimeError.new("Status was not preloaded")
Gitlab::Sentry.track_and_raise_for_dev_exception(exception, user: user.inspect)
Gitlab::ErrorTracking.track_and_raise_for_dev_exception(exception, user: user.inspect)
end
 
return unless user.status
Loading
Loading
Loading
Loading
@@ -46,6 +46,12 @@ class ApplicationSetting < ApplicationRecord
presence: true,
numericality: { only_integer: true, greater_than_or_equal_to: 0 }
 
validates :minimum_password_length,
presence: true,
numericality: { only_integer: true,
greater_than_or_equal_to: DEFAULT_MINIMUM_PASSWORD_LENGTH,
less_than_or_equal_to: Devise.password_length.max }
validates :home_page_url,
allow_blank: true,
addressable_url: true,
Loading
Loading
Loading
Loading
@@ -30,6 +30,8 @@ module ApplicationSettingImplementation
'/admin/session'
].freeze
 
DEFAULT_MINIMUM_PASSWORD_LENGTH = 8
class_methods do
def defaults
{
Loading
Loading
@@ -106,6 +108,7 @@ module ApplicationSettingImplementation
sourcegraph_enabled: false,
sourcegraph_url: nil,
sourcegraph_public_only: true,
minimum_password_length: DEFAULT_MINIMUM_PASSWORD_LENGTH,
terminal_max_session_time: 0,
throttle_authenticated_api_enabled: false,
throttle_authenticated_api_period_in_seconds: 3600,
Loading
Loading
Loading
Loading
@@ -26,6 +26,7 @@ class Blob < SimpleDelegator
BlobViewer::Markup,
BlobViewer::Notebook,
BlobViewer::SVG,
BlobViewer::OpenApi,
 
BlobViewer::Image,
BlobViewer::Sketch,
Loading
Loading
# frozen_string_literal: true
module BlobViewer
class OpenApi < Base
include Rich
include ClientSide
self.partial_name = 'openapi'
self.file_types = %i(openapi)
self.binary = false
# TODO: get an icon for OpenAPI
self.switcher_icon = 'file-pdf-o'
self.switcher_title = 'OpenAPI'
end
end
Loading
Loading
@@ -289,7 +289,7 @@ module Ci
begin
build.deployment.drop!
rescue => e
Gitlab::Sentry.track_and_raise_for_dev_exception(e, build_id: build.id)
Gitlab::ErrorTracking.track_and_raise_for_dev_exception(e, build_id: build.id)
end
 
true
Loading
Loading
Loading
Loading
@@ -26,7 +26,7 @@ module Ci
 
create_ref(sha, path)
rescue => e
Gitlab::Sentry
Gitlab::ErrorTracking
.track_exception(e, pipeline_id: pipeline.id)
end
 
Loading
Loading
@@ -37,7 +37,7 @@ module Ci
rescue Gitlab::Git::Repository::NoRepository
# no-op
rescue => e
Gitlab::Sentry
Gitlab::ErrorTracking
.track_exception(e, pipeline_id: pipeline.id)
end
 
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