diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-19 18:09:09 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-19 18:09:09 +0300 |
commit | c7e385e282bcb8505589bce526e692b7bb819ffa (patch) | |
tree | 3e64affe1c2eebdcaa18cc6319b603f44b03b07e /lib | |
parent | cd3e2c7b9355f8990ab294b34b5e4add4f3985fa (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/ci/config/entry/job.rb | 3 | ||||
-rw-r--r-- | lib/gitlab/grape_logging/formatters/lograge_with_timestamp.rb | 3 | ||||
-rw-r--r-- | lib/gitlab/utils/log_limited_array.rb | 8 | ||||
-rw-r--r-- | lib/tasks/gitlab/graphql.rake | 13 |
4 files changed, 20 insertions, 7 deletions
diff --git a/lib/gitlab/ci/config/entry/job.rb b/lib/gitlab/ci/config/entry/job.rb index ffc8cb887e8..666c6e23eb4 100644 --- a/lib/gitlab/ci/config/entry/job.rb +++ b/lib/gitlab/ci/config/entry/job.rb @@ -165,7 +165,7 @@ module Gitlab helpers :before_script, :script, :stage, :type, :after_script, :cache, :image, :services, :only, :except, :variables, :artifacts, :environment, :coverage, :retry, :rules, - :parallel, :needs, :interruptible, :release + :parallel, :needs, :interruptible, :release, :tags attributes :script, :tags, :allow_failure, :when, :dependencies, :needs, :retry, :parallel, :extends, :start_in, :rules, @@ -242,6 +242,7 @@ module Gitlab services: services_value, stage: stage_value, cache: cache_value, + tags: tags_value, only: only_value, except: except_value, rules: has_rules? ? rules_value : nil, diff --git a/lib/gitlab/grape_logging/formatters/lograge_with_timestamp.rb b/lib/gitlab/grape_logging/formatters/lograge_with_timestamp.rb index 837473d47cd..1eb1e1b783b 100644 --- a/lib/gitlab/grape_logging/formatters/lograge_with_timestamp.rb +++ b/lib/gitlab/grape_logging/formatters/lograge_with_timestamp.rb @@ -30,7 +30,8 @@ module Gitlab .each_pair .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 def utf8_encode_values(data) diff --git a/lib/gitlab/utils/log_limited_array.rb b/lib/gitlab/utils/log_limited_array.rb index fe8aadf9020..9c207758580 100644 --- a/lib/gitlab/utils/log_limited_array.rb +++ b/lib/gitlab/utils/log_limited_array.rb @@ -6,9 +6,9 @@ module Gitlab MAXIMUM_ARRAY_LENGTH = 10.kilobytes # Prepare an array for logging by limiting its JSON representation - # to around 10 kilobytes. Once we hit the limit, add "..." as the - # last item in the returned array. - def self.log_limited_array(array) + # to around 10 kilobytes. Once we hit the limit, add the sentinel + # value as the last item in the returned array. + def self.log_limited_array(array, sentinel: '...') return [] unless array.is_a?(Array) total_length = 0 @@ -18,7 +18,7 @@ module Gitlab total_length <= MAXIMUM_ARRAY_LENGTH end - limited_array.push('...') if total_length > MAXIMUM_ARRAY_LENGTH + limited_array.push(sentinel) if total_length > MAXIMUM_ARRAY_LENGTH limited_array end diff --git a/lib/tasks/gitlab/graphql.rake b/lib/tasks/gitlab/graphql.rake index c73691f3d45..568761edb33 100644 --- a/lib/tasks/gitlab/graphql.rake +++ b/lib/tasks/gitlab/graphql.rake @@ -8,13 +8,24 @@ namespace :gitlab do OUTPUT_DIR = Rails.root.join("doc/api/graphql/reference") 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: # - gitlab:graphql:schema:dump # - gitlab:graphql:schema:idl # - gitlab:graphql:schema:json GraphQL::RakeTask.new( schema_name: 'GitlabSchema', - dependencies: [:environment], + dependencies: [:environment, :disable_feature_flags], directory: OUTPUT_DIR, idl_outfile: "gitlab_schema.graphql", json_outfile: "gitlab_schema.json" |