diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-08-24 15:12:19 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-08-24 15:12:19 +0000 |
commit | 53ab147992c8e791582f625c80811fdda5ba4d5a (patch) | |
tree | a36867b0d6c6e0bb8fc8f474082b3a3710433bc3 /app | |
parent | 263baf70a1f64bb773bfb57d74516a008c2bc7e4 (diff) | |
download | gitlab-ce-53ab147992c8e791582f625c80811fdda5ba4d5a.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app')
-rw-r--r-- | app/assets/javascripts/blob/3d_viewer/index.js | 7 | ||||
-rw-r--r-- | app/assets/javascripts/blob/3d_viewer/mesh_object.js | 2 | ||||
-rw-r--r-- | app/assets/javascripts/vue_merge_request_widget/components/widget/widget.vue | 5 | ||||
-rw-r--r-- | app/controllers/projects/pipelines/tests_controller.rb | 3 | ||||
-rw-r--r-- | app/graphql/resolvers/ci/test_suite_resolver.rb | 3 | ||||
-rw-r--r-- | app/graphql/resolvers/concerns/issue_resolver_arguments.rb | 3 | ||||
-rw-r--r-- | app/graphql/types/base_field.rb | 31 | ||||
-rw-r--r-- | app/graphql/types/ci/config_variable_type.rb | 22 | ||||
-rw-r--r-- | app/graphql/types/ci/group_variable_type.rb | 16 | ||||
-rw-r--r-- | app/graphql/types/ci/instance_variable_type.rb | 28 | ||||
-rw-r--r-- | app/graphql/types/ci/manual_variable_type.rb | 12 | ||||
-rw-r--r-- | app/graphql/types/ci/project_variable_type.rb | 12 | ||||
-rw-r--r-- | app/graphql/types/ci/variable_interface.rb | 24 | ||||
-rw-r--r-- | app/graphql/types/project_type.rb | 21 | ||||
-rw-r--r-- | app/models/ci/build.rb | 28 | ||||
-rw-r--r-- | app/services/ci/build_report_result_service.rb | 3 | ||||
-rw-r--r-- | app/services/ci/test_failure_history_service.rb | 4 |
17 files changed, 123 insertions, 101 deletions
diff --git a/app/assets/javascripts/blob/3d_viewer/index.js b/app/assets/javascripts/blob/3d_viewer/index.js index d4efe409fef..2831c37838b 100644 --- a/app/assets/javascripts/blob/3d_viewer/index.js +++ b/app/assets/javascripts/blob/3d_viewer/index.js @@ -1,11 +1,8 @@ -import OrbitControlsClass from 'three-orbit-controls'; -import STLLoaderClass from 'three-stl-loader'; +import { OrbitControls } from 'three/examples/jsm/controls/OrbitControls'; +import { STLLoader } from 'three/examples/jsm/loaders/STLLoader'; import * as THREE from 'three/build/three.module'; import MeshObject from './mesh_object'; -const STLLoader = STLLoaderClass(THREE); -const OrbitControls = OrbitControlsClass(THREE); - export default class Renderer { constructor(container) { this.renderWrapper = this.render.bind(this); diff --git a/app/assets/javascripts/blob/3d_viewer/mesh_object.js b/app/assets/javascripts/blob/3d_viewer/mesh_object.js index c55a9ca8926..5322dc00e86 100644 --- a/app/assets/javascripts/blob/3d_viewer/mesh_object.js +++ b/app/assets/javascripts/blob/3d_viewer/mesh_object.js @@ -22,7 +22,7 @@ export default class MeshObject extends Mesh { if (this.geometry.boundingSphere.radius > 4) { const scale = 4 / this.geometry.boundingSphere.radius; - this.geometry.applyMatrix(new Matrix4().makeScale(scale, scale, scale)); + this.geometry.applyMatrix4(new Matrix4().makeScale(scale, scale, scale)); this.geometry.computeBoundingSphere(); this.position.x = -this.geometry.boundingSphere.center.x; diff --git a/app/assets/javascripts/vue_merge_request_widget/components/widget/widget.vue b/app/assets/javascripts/vue_merge_request_widget/components/widget/widget.vue index 4e580c88ef3..5581863591c 100644 --- a/app/assets/javascripts/vue_merge_request_widget/components/widget/widget.vue +++ b/app/assets/javascripts/vue_merge_request_widget/components/widget/widget.vue @@ -130,11 +130,16 @@ export default { }, async fetchExpandedContent() { this.isLoadingExpandedContent = true; + this.error = null; try { await this.fetch(this.fetchExpandedData, FETCH_TYPE_EXPANDED); } catch { this.error = this.errorText; + + // Reset these values so that we allow refetching + this.isExpandedForTheFirstTime = true; + this.isCollapsed = true; } this.isLoadingExpandedContent = false; diff --git a/app/controllers/projects/pipelines/tests_controller.rb b/app/controllers/projects/pipelines/tests_controller.rb index 8ac370b1bd4..d77cf095a4f 100644 --- a/app/controllers/projects/pipelines/tests_controller.rb +++ b/app/controllers/projects/pipelines/tests_controller.rb @@ -51,7 +51,8 @@ module Projects def test_suite suite = builds.sum do |build| - build.collect_test_reports!(Gitlab::Ci::Reports::TestReport.new) + test_report = build.collect_test_reports!(Gitlab::Ci::Reports::TestReport.new) + test_report.get_suite(build.test_suite_name) end Gitlab::Ci::Reports::TestFailureHistory.new(suite.failed.values, project).load! diff --git a/app/graphql/resolvers/ci/test_suite_resolver.rb b/app/graphql/resolvers/ci/test_suite_resolver.rb index f758e217b47..a2d3af9c664 100644 --- a/app/graphql/resolvers/ci/test_suite_resolver.rb +++ b/app/graphql/resolvers/ci/test_suite_resolver.rb @@ -28,7 +28,8 @@ module Resolvers def load_test_suite_data(builds) suite = builds.sum do |build| - build.collect_test_reports!(Gitlab::Ci::Reports::TestReport.new) + test_report = build.collect_test_reports!(Gitlab::Ci::Reports::TestReport.new) + test_report.get_suite(build.test_suite_name) end Gitlab::Ci::Reports::TestFailureHistory.new(suite.failed.values, pipeline.project).load! diff --git a/app/graphql/resolvers/concerns/issue_resolver_arguments.rb b/app/graphql/resolvers/concerns/issue_resolver_arguments.rb index 15ab4435204..8295bd58388 100644 --- a/app/graphql/resolvers/concerns/issue_resolver_arguments.rb +++ b/app/graphql/resolvers/concerns/issue_resolver_arguments.rb @@ -84,6 +84,8 @@ module IssueResolverArguments end def ready?(**args) + args[:not] = args[:not].to_h if args[:not].present? + params_not_mutually_exclusive(args, mutually_exclusive_assignee_username_args) params_not_mutually_exclusive(args, mutually_exclusive_milestone_args) params_not_mutually_exclusive(args.fetch(:not, {}), mutually_exclusive_milestone_args) @@ -114,7 +116,6 @@ module IssueResolverArguments def prepare_finder_params(args) params = super(args) - params[:not] = params[:not].to_h if params[:not].present? params[:iids] ||= [params.delete(:iid)].compact if params[:iid] params[:attempt_project_search_optimizations] = true if params[:search].present? diff --git a/app/graphql/types/base_field.rb b/app/graphql/types/base_field.rb index 1c43432594a..6f64e5b5053 100644 --- a/app/graphql/types/base_field.rb +++ b/app/graphql/types/base_field.rb @@ -17,8 +17,6 @@ module Types @requires_argument = !!kwargs.delete(:requires_argument) @authorize = Array.wrap(kwargs.delete(:authorize)) kwargs[:complexity] = field_complexity(kwargs[:resolver_class], kwargs[:complexity]) - @feature_flag = kwargs[:_deprecated_feature_flag] - kwargs = check_feature_flag(kwargs) @deprecation = gitlab_deprecation(kwargs) after_connection_extensions = kwargs.delete(:late_extensions) || [] @@ -91,16 +89,8 @@ module Types @constant_complexity end - def visible?(context) - return false if feature_flag.present? && !Feature.enabled?(feature_flag) - - super - end - private - attr_reader :feature_flag - def field_authorized?(object, ctx) object = object.node if object.is_a?(GraphQL::Pagination::Connection::Edge) @@ -123,27 +113,6 @@ module Types @authorization ||= ::Gitlab::Graphql::Authorize::ObjectAuthorization.new(@authorize) end - def feature_documentation_message(key, description) - message_parts = ["#{description} Available only when feature flag `#{key}` is enabled."] - - message_parts << if Feature::Definition.has_definition?(key) && Feature::Definition.default_enabled?(key) - "This flag is enabled by default." - else - "This flag is disabled by default, because the feature is experimental and is subject to change without notice." - end - - message_parts.join(' ') - end - - def check_feature_flag(args) - ff = args.delete(:_deprecated_feature_flag) - return args unless ff.present? - - args[:description] = feature_documentation_message(ff, args[:description]) - - args - end - def field_complexity(resolver_class, current) return current if current.present? && current > 0 diff --git a/app/graphql/types/ci/config_variable_type.rb b/app/graphql/types/ci/config_variable_type.rb new file mode 100644 index 00000000000..87ae026c2c1 --- /dev/null +++ b/app/graphql/types/ci/config_variable_type.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +module Types + module Ci + class ConfigVariableType < BaseObject # rubocop:disable Graphql/AuthorizeTypes + graphql_name 'CiConfigVariable' + description 'CI/CD config variables.' + + field :key, GraphQL::Types::String, + null: true, + description: 'Name of the variable.' + + field :description, GraphQL::Types::String, + null: true, + description: 'Description for the CI/CD config variable.' + + field :value, GraphQL::Types::String, + null: true, + description: 'Value of the variable.' + end + end +end diff --git a/app/graphql/types/ci/group_variable_type.rb b/app/graphql/types/ci/group_variable_type.rb index 3322f741342..8821fdd8eb4 100644 --- a/app/graphql/types/ci/group_variable_type.rb +++ b/app/graphql/types/ci/group_variable_type.rb @@ -10,16 +10,16 @@ module Types implements(VariableInterface) field :environment_scope, GraphQL::Types::String, - null: true, - description: 'Scope defining the environments that can use the variable.' - - field :protected, GraphQL::Types::Boolean, - null: true, - description: 'Indicates whether the variable is protected.' + null: true, + description: 'Scope defining the environments that can use the variable.' field :masked, GraphQL::Types::Boolean, - null: true, - description: 'Indicates whether the variable is masked.' + null: true, + description: 'Indicates whether the variable is masked.' + + field :protected, GraphQL::Types::Boolean, + null: true, + description: 'Indicates whether the variable is protected.' end end end diff --git a/app/graphql/types/ci/instance_variable_type.rb b/app/graphql/types/ci/instance_variable_type.rb index f564a2f59a0..7ffc52deb73 100644 --- a/app/graphql/types/ci/instance_variable_type.rb +++ b/app/graphql/types/ci/instance_variable_type.rb @@ -9,21 +9,29 @@ module Types implements(VariableInterface) + field :id, GraphQL::Types::ID, + null: false, + description: 'ID of the variable.' + field :environment_scope, GraphQL::Types::String, - null: true, - deprecated: { - reason: 'No longer used, only available for GroupVariableType and ProjectVariableType', - milestone: '15.3' - }, - description: 'Scope defining the environments that can use the variable.' + null: true, + deprecated: { + reason: 'No longer used, only available for GroupVariableType and ProjectVariableType', + milestone: '15.3' + }, + description: 'Scope defining the environments that can use the variable.' field :protected, GraphQL::Types::Boolean, - null: true, - description: 'Indicates whether the variable is protected.' + null: true, + description: 'Indicates whether the variable is protected.' field :masked, GraphQL::Types::Boolean, - null: true, - description: 'Indicates whether the variable is masked.' + null: true, + description: 'Indicates whether the variable is masked.' + + field :raw, GraphQL::Types::Boolean, + null: true, + description: 'Indicates whether the variable is raw.' def environment_scope nil diff --git a/app/graphql/types/ci/manual_variable_type.rb b/app/graphql/types/ci/manual_variable_type.rb index d6f59c1d249..ed92a6645b4 100644 --- a/app/graphql/types/ci/manual_variable_type.rb +++ b/app/graphql/types/ci/manual_variable_type.rb @@ -10,12 +10,12 @@ module Types implements(VariableInterface) field :environment_scope, GraphQL::Types::String, - null: true, - deprecated: { - reason: 'No longer used, only available for GroupVariableType and ProjectVariableType', - milestone: '15.3' - }, - description: 'Scope defining the environments that can use the variable.' + null: true, + deprecated: { + reason: 'No longer used, only available for GroupVariableType and ProjectVariableType', + milestone: '15.3' + }, + description: 'Scope defining the environments that can use the variable.' def environment_scope nil diff --git a/app/graphql/types/ci/project_variable_type.rb b/app/graphql/types/ci/project_variable_type.rb index 625bb7fd4b1..02e3cdc1a11 100644 --- a/app/graphql/types/ci/project_variable_type.rb +++ b/app/graphql/types/ci/project_variable_type.rb @@ -10,16 +10,16 @@ module Types implements(VariableInterface) field :environment_scope, GraphQL::Types::String, - null: true, - description: 'Scope defining the environments that can use the variable.' + null: true, + description: 'Scope defining the environments that can use the variable.' field :protected, GraphQL::Types::Boolean, - null: true, - description: 'Indicates whether the variable is protected.' + null: true, + description: 'Indicates whether the variable is protected.' field :masked, GraphQL::Types::Boolean, - null: true, - description: 'Indicates whether the variable is masked.' + null: true, + description: 'Indicates whether the variable is masked.' end end end diff --git a/app/graphql/types/ci/variable_interface.rb b/app/graphql/types/ci/variable_interface.rb index 82c9ba7121c..ec68d3c987c 100644 --- a/app/graphql/types/ci/variable_interface.rb +++ b/app/graphql/types/ci/variable_interface.rb @@ -8,24 +8,24 @@ module Types graphql_name 'CiVariable' field :id, GraphQL::Types::ID, - null: false, - description: 'ID of the variable.' + null: false, + description: 'ID of the variable.' field :key, GraphQL::Types::String, - null: true, - description: 'Name of the variable.' + null: true, + description: 'Name of the variable.' + + field :raw, GraphQL::Types::Boolean, + null: true, + description: 'Indicates whether the variable is raw.' field :value, GraphQL::Types::String, - null: true, - description: 'Value of the variable.' + null: true, + description: 'Value of the variable.' field :variable_type, ::Types::Ci::VariableTypeEnum, - null: true, - description: 'Type of the variable.' - - field :raw, GraphQL::Types::Boolean, - null: true, - description: 'Indicates whether the variable is raw.' + null: true, + description: 'Type of the variable.' end end end diff --git a/app/graphql/types/project_type.rb b/app/graphql/types/project_type.rb index 2ad4e8848d1..53336a2affa 100644 --- a/app/graphql/types/project_type.rb +++ b/app/graphql/types/project_type.rb @@ -18,6 +18,17 @@ module Types null: false, description: 'Path of the CI configuration file.' + field :ci_config_variables, [Types::Ci::ConfigVariableType], + null: true, + calls_gitaly: true, + authorize: :create_pipeline, + alpha: { milestone: '15.3' }, + description: 'CI/CD config variable.' do + argument :sha, GraphQL::Types::String, + required: true, + description: 'Sha.' + end + field :full_path, GraphQL::Types::ID, null: false, description: 'Full path of the project.' @@ -549,6 +560,16 @@ module Types project.container_repositories.size end + def ci_config_variables(sha) + result = ::Ci::ListConfigVariablesService.new(object, context[:current_user]).execute(sha) + + return if result.nil? + + result.map do |var_key, var_config| + { key: var_key, **var_config } + end + end + def sast_ci_configuration return unless Ability.allowed?(current_user, :download_code, object) diff --git a/app/models/ci/build.rb b/app/models/ci/build.rb index d9e8873ffc1..1228dfd87d6 100644 --- a/app/models/ci/build.rb +++ b/app/models/ci/build.rb @@ -996,15 +996,11 @@ module Ci end def collect_test_reports!(test_reports) - test_reports.get_suite(test_suite_name).tap do |test_suite| - each_report(Ci::JobArtifact.file_types_for_report(:test)) do |file_type, blob| - Gitlab::Ci::Parsers.fabricate!(file_type).parse!( - blob, - test_suite, - job: self - ) - end + each_report(Ci::JobArtifact.file_types_for_report(:test)) do |file_type, blob| + Gitlab::Ci::Parsers.fabricate!(file_type).parse!(blob, test_reports, job: self) end + + test_reports end def collect_accessibility_reports!(accessibility_report) @@ -1181,6 +1177,14 @@ module Ci job_artifacts.map(&:file_type) end + def test_suite_name + if matrix_build? + name + else + group_name + end + end + protected def run_status_commit_hooks! @@ -1191,14 +1195,6 @@ module Ci private - def test_suite_name - if matrix_build? - name - else - group_name - end - end - def matrix_build? options.dig(:parallel, :matrix).present? end diff --git a/app/services/ci/build_report_result_service.rb b/app/services/ci/build_report_result_service.rb index f9146b3677a..20a31322919 100644 --- a/app/services/ci/build_report_result_service.rb +++ b/app/services/ci/build_report_result_service.rb @@ -22,7 +22,8 @@ module Ci private def generate_test_suite_report(build) - build.collect_test_reports!(Gitlab::Ci::Reports::TestReport.new) + test_report = build.collect_test_reports!(Gitlab::Ci::Reports::TestReport.new) + test_report.get_suite(build.test_suite_name) end def tests_params(test_suite) diff --git a/app/services/ci/test_failure_history_service.rb b/app/services/ci/test_failure_history_service.rb index 2214a6a2729..5a8072b2a0d 100644 --- a/app/services/ci/test_failure_history_service.rb +++ b/app/services/ci/test_failure_history_service.rb @@ -80,8 +80,8 @@ module Ci end def generate_test_suite!(build) - # Returns an instance of Gitlab::Ci::Reports::TestSuite - build.collect_test_reports!(Gitlab::Ci::Reports::TestReport.new) + test_report = build.collect_test_reports!(Gitlab::Ci::Reports::TestReport.new) + test_report.get_suite(build.test_suite_name) end def ci_unit_test_attrs(batch) |