Commit c7e385e2 authored by GitLab Bot's avatar GitLab Bot

Add latest changes from gitlab-org/gitlab@master

parent cd3e2c7b
...@@ -345,6 +345,8 @@ RSpec/HaveGitlabHttpStatus: ...@@ -345,6 +345,8 @@ RSpec/HaveGitlabHttpStatus:
- 'ee/spec/controllers/**/*' - 'ee/spec/controllers/**/*'
- 'spec/requests/*.rb' - 'spec/requests/*.rb'
- 'ee/spec/requests/*.rb' - 'ee/spec/requests/*.rb'
- 'spec/requests/{groups,projects,repositories}/**/*'
- 'ee/spec/requests/{groups,projects,repositories}/**/*'
- 'spec/requests/api/*/**/*.rb' - 'spec/requests/api/*/**/*.rb'
- 'ee/spec/requests/api/*/**/*.rb' - 'ee/spec/requests/api/*/**/*.rb'
......
import sqljs from 'sql.js'; import sqljs from 'sql.js';
import { template as _template } from 'underscore'; import { template as _template } from 'lodash';
import axios from '~/lib/utils/axios_utils'; import axios from '~/lib/utils/axios_utils';
import { successCodes } from '~/lib/utils/http_status'; import { successCodes } from '~/lib/utils/http_status';
......
...@@ -3,7 +3,11 @@ import registryExplorer from '~/registry/explorer/index'; ...@@ -3,7 +3,11 @@ import registryExplorer from '~/registry/explorer/index';
document.addEventListener('DOMContentLoaded', () => { document.addEventListener('DOMContentLoaded', () => {
initRegistryImages(); initRegistryImages();
const { attachMainComponent, attachBreadcrumb } = registryExplorer();
attachBreadcrumb(); const explorer = registryExplorer();
attachMainComponent();
if (explorer) {
explorer.attachBreadcrumb();
explorer.attachMainComponent();
}
}); });
...@@ -17,7 +17,6 @@ class Snippet < ApplicationRecord ...@@ -17,7 +17,6 @@ class Snippet < ApplicationRecord
include HasRepository include HasRepository
extend ::Gitlab::Utils::Override extend ::Gitlab::Utils::Override
ignore_column :storage_version, remove_with: '12.9', remove_after: '2020-03-22'
ignore_column :repository_storage, remove_with: '12.10', remove_after: '2020-04-22' ignore_column :repository_storage, remove_with: '12.10', remove_after: '2020-04-22'
cache_markdown_field :title, pipeline: :single_line cache_markdown_field :title, pipeline: :single_line
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
%section %section
.row.registry-placeholder.prepend-bottom-10 .row.registry-placeholder.prepend-bottom-10
.col-12 .col-12
- if Feature.enabled?(:vue_container_registry_explorer) - if Feature.enabled?(:vue_container_registry_explorer, @group)
#js-container-registry{ data: { endpoint: group_container_registries_path(@group), #js-container-registry{ data: { endpoint: group_container_registries_path(@group),
"help_page_path" => help_page_path('user/packages/container_registry/index'), "help_page_path" => help_page_path('user/packages/container_registry/index'),
"two_factor_auth_help_link" => help_page_path('user/profile/account/two_factor_authentication'), "two_factor_auth_help_link" => help_page_path('user/profile/account/two_factor_authentication'),
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
%section %section
.row.registry-placeholder.prepend-bottom-10 .row.registry-placeholder.prepend-bottom-10
.col-12 .col-12
- if Feature.enabled?(:vue_container_registry_explorer) - if Feature.enabled?(:vue_container_registry_explorer, @project)
#js-container-registry{ data: { endpoint: project_container_registry_index_path(@project), #js-container-registry{ data: { endpoint: project_container_registry_index_path(@project),
project_path: @project.full_path, project_path: @project.full_path,
"help_page_path" => help_page_path('user/packages/container_registry/index'), "help_page_path" => help_page_path('user/packages/container_registry/index'),
......
---
title: Replace underscore with lodash in /app/assets/javascripts/blob/
merge_request: 25113
author: rkpattnaik780
type: changed
...@@ -28,7 +28,7 @@ unless Gitlab::Runtime.sidekiq? ...@@ -28,7 +28,7 @@ unless Gitlab::Runtime.sidekiq?
payload = { payload = {
time: Time.now.utc.iso8601(3), time: Time.now.utc.iso8601(3),
params: Gitlab::Utils::LogLimitedArray.log_limited_array(params), params: Gitlab::Utils::LogLimitedArray.log_limited_array(params, sentinel: { key: 'truncated', value: '...' }),
remote_ip: event.payload[:remote_ip], remote_ip: event.payload[:remote_ip],
user_id: event.payload[:user_id], user_id: event.payload[:user_id],
username: event.payload[:username], username: event.payload[:username],
......
...@@ -15,8 +15,6 @@ The following are required to install and test the app: ...@@ -15,8 +15,6 @@ The following are required to install and test the app:
or [ngrok](https://ngrok.com). These also take care of SSL for you because Jira or [ngrok](https://ngrok.com). These also take care of SSL for you because Jira
requires all connections to the app host to be over SSL. requires all connections to the app host to be over SSL.
> This feature is currently behind the `:jira_connect_app` feature flag
## Installing the app in Jira ## Installing the app in Jira
1. Enable Jira development mode to install apps that are not from the Atlassian Marketplace 1. Enable Jira development mode to install apps that are not from the Atlassian Marketplace
......
...@@ -165,7 +165,7 @@ module Gitlab ...@@ -165,7 +165,7 @@ module Gitlab
helpers :before_script, :script, :stage, :type, :after_script, helpers :before_script, :script, :stage, :type, :after_script,
:cache, :image, :services, :only, :except, :variables, :cache, :image, :services, :only, :except, :variables,
:artifacts, :environment, :coverage, :retry, :rules, :artifacts, :environment, :coverage, :retry, :rules,
:parallel, :needs, :interruptible, :release :parallel, :needs, :interruptible, :release, :tags
attributes :script, :tags, :allow_failure, :when, :dependencies, attributes :script, :tags, :allow_failure, :when, :dependencies,
:needs, :retry, :parallel, :extends, :start_in, :rules, :needs, :retry, :parallel, :extends, :start_in, :rules,
...@@ -242,6 +242,7 @@ module Gitlab ...@@ -242,6 +242,7 @@ module Gitlab
services: services_value, services: services_value,
stage: stage_value, stage: stage_value,
cache: cache_value, cache: cache_value,
tags: tags_value,
only: only_value, only: only_value,
except: except_value, except: except_value,
rules: has_rules? ? rules_value : nil, rules: has_rules? ? rules_value : nil,
......
...@@ -30,7 +30,8 @@ module Gitlab ...@@ -30,7 +30,8 @@ module Gitlab
.each_pair .each_pair
.map { |k, v| { key: k, value: utf8_encode_values(v) } } .map { |k, v| { key: k, value: utf8_encode_values(v) } }
Gitlab::Utils::LogLimitedArray.log_limited_array(params_array) Gitlab::Utils::LogLimitedArray.log_limited_array(params_array,
sentinel: { key: 'truncated', value: '...' })
end end
def utf8_encode_values(data) def utf8_encode_values(data)
......
...@@ -6,9 +6,9 @@ module Gitlab ...@@ -6,9 +6,9 @@ module Gitlab
MAXIMUM_ARRAY_LENGTH = 10.kilobytes MAXIMUM_ARRAY_LENGTH = 10.kilobytes
# Prepare an array for logging by limiting its JSON representation # Prepare an array for logging by limiting its JSON representation
# to around 10 kilobytes. Once we hit the limit, add "..." as the # to around 10 kilobytes. Once we hit the limit, add the sentinel
# last item in the returned array. # value as the last item in the returned array.
def self.log_limited_array(array) def self.log_limited_array(array, sentinel: '...')
return [] unless array.is_a?(Array) return [] unless array.is_a?(Array)
total_length = 0 total_length = 0
...@@ -18,7 +18,7 @@ module Gitlab ...@@ -18,7 +18,7 @@ module Gitlab
total_length <= MAXIMUM_ARRAY_LENGTH total_length <= MAXIMUM_ARRAY_LENGTH
end end
limited_array.push('...') if total_length > MAXIMUM_ARRAY_LENGTH limited_array.push(sentinel) if total_length > MAXIMUM_ARRAY_LENGTH
limited_array limited_array
end end
......
...@@ -8,13 +8,24 @@ namespace :gitlab do ...@@ -8,13 +8,24 @@ namespace :gitlab do
OUTPUT_DIR = Rails.root.join("doc/api/graphql/reference") OUTPUT_DIR = Rails.root.join("doc/api/graphql/reference")
TEMPLATES_DIR = 'lib/gitlab/graphql/docs/templates/' TEMPLATES_DIR = 'lib/gitlab/graphql/docs/templates/'
# Consider all feature flags disabled
# to avoid pipeline failures in case developer
# dumps schema with flags enabled locally before pushing
task disable_feature_flags: :environment do
class Feature
def self.enabled?(*args)
false
end
end
end
# Defines tasks for dumping the GraphQL schema: # Defines tasks for dumping the GraphQL schema:
# - gitlab:graphql:schema:dump # - gitlab:graphql:schema:dump
# - gitlab:graphql:schema:idl # - gitlab:graphql:schema:idl
# - gitlab:graphql:schema:json # - gitlab:graphql:schema:json
GraphQL::RakeTask.new( GraphQL::RakeTask.new(
schema_name: 'GitlabSchema', schema_name: 'GitlabSchema',
dependencies: [:environment], dependencies: [:environment, :disable_feature_flags],
directory: OUTPUT_DIR, directory: OUTPUT_DIR,
idl_outfile: "gitlab_schema.graphql", idl_outfile: "gitlab_schema.graphql",
json_outfile: "gitlab_schema.json" json_outfile: "gitlab_schema.json"
......
...@@ -17,7 +17,7 @@ describe 'lograge', type: :request do ...@@ -17,7 +17,7 @@ describe 'lograge', type: :request do
end end
let(:limited_params) do let(:limited_params) do
large_params.slice(:a, :b).map { |k, v| { key: k.to_s, value: v } } + ['...'] large_params.slice(:a, :b).map { |k, v| { key: k.to_s, value: v } } + [{ key: 'truncated', value: '...' }]
end end
context 'for API requests' do context 'for API requests' do
......
...@@ -87,6 +87,28 @@ module Gitlab ...@@ -87,6 +87,28 @@ module Gitlab
end end
end end
describe 'tags entry with default values' do
it 'applies default values' do
config = YAML.dump({ default: { tags: %w[A B] },
rspec: { script: "rspec" } })
config_processor = Gitlab::Ci::YamlProcessor.new(config)
expect(config_processor.stage_builds_attributes("test").size).to eq(1)
expect(config_processor.stage_builds_attributes("test").first).to eq({
stage: "test",
stage_idx: 2,
name: "rspec",
only: { refs: %w[branches tags] },
options: { script: ["rspec"] },
tag_list: %w[A B],
allow_failure: false,
when: "on_success",
yaml_variables: []
})
end
end
describe 'interruptible entry' do describe 'interruptible entry' do
describe 'interruptible job' do describe 'interruptible job' do
let(:config) do let(:config) do
......
...@@ -18,12 +18,26 @@ describe Gitlab::Utils::LogLimitedArray do ...@@ -18,12 +18,26 @@ describe Gitlab::Utils::LogLimitedArray do
end end
context 'when the array exceeds the limit' do context 'when the array exceeds the limit' do
it 'replaces arguments after the limit with an ellipsis string' do let(:long_array) do
half_limit = described_class::MAXIMUM_ARRAY_LENGTH / 2 half_limit = described_class::MAXIMUM_ARRAY_LENGTH / 2
long_array = ['a' * half_limit, 'b' * half_limit, 'c']
expect(described_class.log_limited_array(long_array)) ['a' * half_limit, 'b' * half_limit, 'c']
.to eq(long_array.take(1) + ['...']) end
context 'when no sentinel value is passed' do
it 'replaces arguments after the limit with an ellipsis string' do
expect(described_class.log_limited_array(long_array))
.to eq(long_array.take(1) + ['...'])
end
end
context 'when a sentinel value is passed' do
it 'replaces arguments after the limit with the sentinel' do
sentinel = { truncated: true }
expect(described_class.log_limited_array(long_array, sentinel: sentinel))
.to eq(long_array.take(1) + [sentinel])
end
end end
end end
......
...@@ -24,7 +24,7 @@ describe Groups::MilestonesController do ...@@ -24,7 +24,7 @@ describe Groups::MilestonesController do
end end
expect { get "/groups/#{public_group.to_param}/-/milestones.json" }.not_to exceed_all_query_limit(control_count) expect { get "/groups/#{public_group.to_param}/-/milestones.json" }.not_to exceed_all_query_limit(control_count)
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(:ok)
milestones = json_response milestones = json_response
expect(milestones.count).to eq(3) expect(milestones.count).to eq(3)
......
...@@ -28,7 +28,7 @@ describe Groups::Registry::RepositoriesController do ...@@ -28,7 +28,7 @@ describe Groups::Registry::RepositoriesController do
expect { get(endpoint) }.not_to exceed_all_query_limit(control_count) expect { get(endpoint) }.not_to exceed_all_query_limit(control_count)
# sanity check that response is 200 # sanity check that response is 200
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(:ok)
repositories = json_response repositories = json_response
expect(repositories.count).to eq(5) expect(repositories.count).to eq(5)
end end
......
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