diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-10-20 12:40:42 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-10-20 12:40:42 +0300 |
commit | ee664acb356f8123f4f6b00b73c1e1cf0866c7fb (patch) | |
tree | f8479f94a28f66654c6a4f6fb99bad6b4e86a40e /app/graphql/types/ci/job_type.rb | |
parent | 62f7d5c5b69180e82ae8196b7b429eeffc8e7b4f (diff) |
Add latest changes from gitlab-org/gitlab@15-5-stable-eev15.5.0-rc42
Diffstat (limited to 'app/graphql/types/ci/job_type.rb')
-rw-r--r-- | app/graphql/types/ci/job_type.rb | 18 |
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 |