Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/graphql/types/ci/job_type.rb')
-rw-r--r--app/graphql/types/ci/job_type.rb18
1 files changed, 7 insertions, 11 deletions
diff --git a/app/graphql/types/ci/job_type.rb b/app/graphql/types/ci/job_type.rb
index ab6103d9469..4447a10a74e 100644
--- a/app/graphql/types/ci/job_type.rb
+++ b/app/graphql/types/ci/job_type.rb
@@ -56,6 +56,8 @@ module Types
description: 'Indicates the job is active.'
field :artifacts, Types::Ci::JobArtifactType.connection_type, null: true,
description: 'Artifacts generated by the job.'
+ field :browse_artifacts_path, GraphQL::Types::String, null: true,
+ description: "URL for browsing the artifact's archive."
field :cancelable, GraphQL::Types::Boolean, null: false, method: :cancelable?,
description: 'Indicates the job can be canceled.'
field :commit_path, GraphQL::Types::String, null: true,
@@ -148,17 +150,7 @@ module Types
end
def stage
- ::Gitlab::Graphql::Lazy.with_value(pipeline) do |pl|
- BatchLoader::GraphQL.for([pl, object.stage]).batch do |ids, loader|
- by_pipeline = ids
- .group_by(&:first)
- .transform_values { |grp| grp.map(&:second) }
-
- by_pipeline.each do |p, names|
- p.stages.by_name(names).each { |s| loader.call([p, s.name], s) }
- end
- end
- end
+ ::Gitlab::Graphql::Loaders::BatchModelLoader.new(::Ci::Stage, object.stage_id).find
end
# This class is a secret union!
@@ -187,6 +179,10 @@ module Types
::Gitlab::Routing.url_helpers.project_job_path(object.project, object)
end
+ def browse_artifacts_path
+ ::Gitlab::Routing.url_helpers.browse_project_job_artifacts_path(object.project, object)
+ end
+
def coverage
object&.coverage
end