Class: Resolvers::Ci::ConfigResolver

Inherits:
BaseResolver
  • Object
show all
Includes:
Gitlab::Graphql::Authorize::AuthorizeResource, ResolvesProject
Defined in:
app/graphql/resolvers/ci/config_resolver.rb

Constant Summary

Constants included from Gitlab::Graphql::Authorize::AuthorizeResource

Gitlab::Graphql::Authorize::AuthorizeResource::ConfigurationError, Gitlab::Graphql::Authorize::AuthorizeResource::RESOURCE_ACCESS_ERROR

Instance Method Summary collapse

Methods included from ResolvesProject

#resolve_project

Methods included from Gitlab::Graphql::Authorize::AuthorizeResource

#authorize!, #authorized_find!, #authorized_resource?, #raise_resource_not_available_error!

Methods inherited from BaseResolver

as_single, authorization, authorized?, before_connection_authorization, before_connection_authorization_block, calls_gitaly!, complexity, complexity_multiplier, #current_user, field_options, last, #object, #offset_pagination, requires_argument!, resolver_complexity, #select_result, single, #single?, single_definition_blocks, singular_type, when_single

Methods included from Gitlab::Utils::Override

#extended, extensions, #included, #method_added, #override, #prepended, #queue_verification, verify!

Methods included from Gitlab::Utils::StrongMemoize

#clear_memoization, #strong_memoize, #strong_memoized?

Instance Method Details

#resolve(project_path:, content:, sha: nil, dry_run: false) ⇒ Object


33
34
35
36
37
38
39
40
41
42
43
# File 'app/graphql/resolvers/ci/config_resolver.rb', line 33

def resolve(project_path:, content:, sha: nil, dry_run: false)
  project = authorized_find!(project_path: project_path)

  result = ::Gitlab::Ci::Lint
    .new(project: project, current_user: context[:current_user], sha: sha)
    .validate(content, dry_run: dry_run)

  response(result)
rescue GRPC::InvalidArgument => error
  Gitlab::ErrorTracking.track_and_raise_exception(error, sha: sha)
end