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')
-rw-r--r--app/graphql/types/ci/ci_cd_setting_type.rb11
-rw-r--r--app/graphql/types/ci/config_variable_type.rb4
-rw-r--r--app/graphql/types/ci/job_type.rb18
-rw-r--r--app/graphql/types/ci/pipeline_schedule_status_enum.rb12
-rw-r--r--app/graphql/types/ci/pipeline_schedule_type.rb45
-rw-r--r--app/graphql/types/ci/runner_membership_filter_enum.rb7
6 files changed, 85 insertions, 12 deletions
diff --git a/app/graphql/types/ci/ci_cd_setting_type.rb b/app/graphql/types/ci/ci_cd_setting_type.rb
index bec8c72e783..574791b79e6 100644
--- a/app/graphql/types/ci/ci_cd_setting_type.rb
+++ b/app/graphql/types/ci/ci_cd_setting_type.rb
@@ -10,8 +10,17 @@ module Types
field :job_token_scope_enabled,
GraphQL::Types::Boolean,
null: true,
- description: 'Indicates CI job tokens generated in this project have restricted access to resources.',
+ description: 'Indicates CI/CD job tokens generated in this project ' \
+ 'have restricted access to other projects.',
method: :job_token_scope_enabled?
+
+ field :inbound_job_token_scope_enabled,
+ GraphQL::Types::Boolean,
+ null: true,
+ description: 'Indicates CI/CD job tokens generated in other projects ' \
+ 'have restricted access to this project.',
+ method: :inbound_job_token_scope_enabled?
+
field :keep_latest_artifact, GraphQL::Types::Boolean, null: true,
description: 'Whether to keep the latest builds artifacts.',
method: :keep_latest_artifacts_available?
diff --git a/app/graphql/types/ci/config_variable_type.rb b/app/graphql/types/ci/config_variable_type.rb
index 87ae026c2c1..5b5890fd5a5 100644
--- a/app/graphql/types/ci/config_variable_type.rb
+++ b/app/graphql/types/ci/config_variable_type.rb
@@ -17,6 +17,10 @@ module Types
field :value, GraphQL::Types::String,
null: true,
description: 'Value of the variable.'
+
+ field :value_options, [GraphQL::Types::String],
+ null: true,
+ description: 'Value options for the variable.'
end
end
end
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
diff --git a/app/graphql/types/ci/pipeline_schedule_status_enum.rb b/app/graphql/types/ci/pipeline_schedule_status_enum.rb
new file mode 100644
index 00000000000..61bae7daff8
--- /dev/null
+++ b/app/graphql/types/ci/pipeline_schedule_status_enum.rb
@@ -0,0 +1,12 @@
+# frozen_string_literal: true
+
+module Types
+ module Ci
+ class PipelineScheduleStatusEnum < BaseEnum
+ graphql_name 'PipelineScheduleStatus'
+
+ value 'ACTIVE', value: "active", description: 'Active pipeline schedules.'
+ value 'INACTIVE', value: "inactive", description: 'Inactive pipeline schedules.'
+ end
+ end
+end
diff --git a/app/graphql/types/ci/pipeline_schedule_type.rb b/app/graphql/types/ci/pipeline_schedule_type.rb
new file mode 100644
index 00000000000..04f9fc78a92
--- /dev/null
+++ b/app/graphql/types/ci/pipeline_schedule_type.rb
@@ -0,0 +1,45 @@
+# frozen_string_literal: true
+
+module Types
+ module Ci
+ class PipelineScheduleType < BaseObject
+ graphql_name 'PipelineSchedule'
+
+ connection_type_class(Types::CountableConnectionType)
+
+ expose_permissions Types::PermissionTypes::Ci::PipelineSchedules
+
+ authorize :read_pipeline_schedule
+
+ field :id, GraphQL::Types::ID, null: false, description: 'ID of the pipeline schedule.'
+
+ field :description, GraphQL::Types::String, null: true, description: 'Description of the pipeline schedule.'
+
+ field :owner, ::Types::UserType, null: false, description: 'Owner of the pipeline schedule.'
+
+ field :active, GraphQL::Types::Boolean, null: false, description: 'Indicates if a pipeline schedule is active.'
+
+ field :next_run_at, Types::TimeType, null: false, description: 'Time when the next pipeline will run.'
+
+ field :real_next_run, Types::TimeType, null: false, description: 'Time when the next pipeline will run.'
+
+ field :last_pipeline, PipelineType, null: true, description: 'Last pipeline object.'
+
+ field :ref_for_display, GraphQL::Types::String,
+ null: true, description: 'Git ref for the pipeline schedule.', method: :ref_for_display
+
+ field :ref_path, GraphQL::Types::String, null: true, description: 'Path to the ref that triggered the pipeline.'
+
+ field :for_tag, GraphQL::Types::Boolean,
+ null: false, description: 'Indicates if a pipelines schedule belongs to a tag.', method: :for_tag?
+
+ field :cron, GraphQL::Types::String, null: false, description: 'Cron notation for the schedule.'
+
+ field :cron_timezone, GraphQL::Types::String, null: false, description: 'Timezone for the pipeline schedule.'
+
+ def ref_path
+ ::Gitlab::Routing.url_helpers.project_commits_path(object.project, object.ref_for_display)
+ end
+ end
+ end
+end
diff --git a/app/graphql/types/ci/runner_membership_filter_enum.rb b/app/graphql/types/ci/runner_membership_filter_enum.rb
index 4fd7e0749b0..d59a68b427b 100644
--- a/app/graphql/types/ci/runner_membership_filter_enum.rb
+++ b/app/graphql/types/ci/runner_membership_filter_enum.rb
@@ -15,6 +15,13 @@ module Types
description: "Include runners that have either a direct or inherited relationship. " \
"These runners can be specific to a project or a group.",
value: :descendants
+
+ value 'ALL_AVAILABLE',
+ description:
+ "Include all runners. This list includes runners for all projects in the group " \
+ "and subgroups, as well as for the parent groups and instance.",
+ value: :all_available,
+ deprecated: { milestone: '15.5', reason: :alpha }
end
end
end