diff --git a/app/graphql/mutations/ci/base.rb b/app/graphql/mutations/ci/base.rb deleted file mode 100644 index 0ccee5661b7..00000000000 --- a/app/graphql/mutations/ci/base.rb +++ /dev/null @@ -1,22 +0,0 @@ -# frozen_string_literal: true - -module Mutations - module Ci - class Base < BaseMutation - PipelineID = ::Types::GlobalIDType[::Ci::Pipeline] - - argument :id, PipelineID, - required: true, - description: 'The ID of the pipeline to mutate' - - private - - def find_object(id:) - # TODO: remove this line when the compatibility layer is removed - # See: https://gitlab.com/gitlab-org/gitlab/-/issues/257883 - id = PipelineID.coerce_isolated_input(id) - GlobalID::Locator.locate(id) - end - end - end -end diff --git a/app/graphql/mutations/ci/pipeline/base.rb b/app/graphql/mutations/ci/pipeline/base.rb new file mode 100644 index 00000000000..ebfab56e743 --- /dev/null +++ b/app/graphql/mutations/ci/pipeline/base.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +module Mutations + module Ci + module Pipeline + class Base < BaseMutation + PipelineID = ::Types::GlobalIDType[::Ci::Pipeline] + + argument :id, PipelineID, + required: true, + description: 'The ID of the pipeline to mutate.' + + private + + def find_object(id:) + # TODO: remove this line when the compatibility layer is removed + # See: https://gitlab.com/gitlab-org/gitlab/-/issues/257883 + id = PipelineID.coerce_isolated_input(id) + GlobalID::Locator.locate(id) + end + end + end + end +end diff --git a/app/graphql/mutations/ci/pipeline/cancel.rb b/app/graphql/mutations/ci/pipeline/cancel.rb new file mode 100644 index 00000000000..3fb34a37cfc --- /dev/null +++ b/app/graphql/mutations/ci/pipeline/cancel.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +module Mutations + module Ci + module Pipeline + class Cancel < Base + graphql_name 'PipelineCancel' + + authorize :update_pipeline + + def resolve(id:) + pipeline = authorized_find!(id: id) + + if pipeline.cancelable? + pipeline.cancel_running + { success: true, errors: [] } + else + { success: false, errors: ['Pipeline is not cancelable'] } + end + end + end + end + end +end diff --git a/app/graphql/mutations/ci/pipeline/destroy.rb b/app/graphql/mutations/ci/pipeline/destroy.rb new file mode 100644 index 00000000000..3f933818ce1 --- /dev/null +++ b/app/graphql/mutations/ci/pipeline/destroy.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +module Mutations + module Ci + module Pipeline + class Destroy < Base + graphql_name 'PipelineDestroy' + + authorize :destroy_pipeline + + def resolve(id:) + pipeline = authorized_find!(id: id) + project = pipeline.project + + result = ::Ci::DestroyPipelineService.new(project, current_user).execute(pipeline) + { + success: result.success?, + errors: result.errors + } + end + end + end + end +end diff --git a/app/graphql/mutations/ci/pipeline/retry.rb b/app/graphql/mutations/ci/pipeline/retry.rb new file mode 100644 index 00000000000..a12330470f0 --- /dev/null +++ b/app/graphql/mutations/ci/pipeline/retry.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +module Mutations + module Ci + module Pipeline + class Retry < Base + graphql_name 'PipelineRetry' + + field :pipeline, + Types::Ci::PipelineType, + null: true, + description: 'The pipeline after mutation.' + + authorize :update_pipeline + + def resolve(id:) + pipeline = authorized_find!(id: id) + project = pipeline.project + + ::Ci::RetryPipelineService.new(project, current_user).execute(pipeline) + { + pipeline: pipeline, + errors: errors_on_object(pipeline) + } + end + end + end + end +end diff --git a/app/graphql/mutations/ci/pipeline_cancel.rb b/app/graphql/mutations/ci/pipeline_cancel.rb deleted file mode 100644 index bc881e2ac02..00000000000 --- a/app/graphql/mutations/ci/pipeline_cancel.rb +++ /dev/null @@ -1,22 +0,0 @@ -# frozen_string_literal: true - -module Mutations - module Ci - class PipelineCancel < Base - graphql_name 'PipelineCancel' - - authorize :update_pipeline - - def resolve(id:) - pipeline = authorized_find!(id: id) - - if pipeline.cancelable? - pipeline.cancel_running - { success: true, errors: [] } - else - { success: false, errors: ['Pipeline is not cancelable'] } - end - end - end - end -end diff --git a/app/graphql/mutations/ci/pipeline_destroy.rb b/app/graphql/mutations/ci/pipeline_destroy.rb deleted file mode 100644 index bb24d416583..00000000000 --- a/app/graphql/mutations/ci/pipeline_destroy.rb +++ /dev/null @@ -1,22 +0,0 @@ -# frozen_string_literal: true - -module Mutations - module Ci - class PipelineDestroy < Base - graphql_name 'PipelineDestroy' - - authorize :destroy_pipeline - - def resolve(id:) - pipeline = authorized_find!(id: id) - project = pipeline.project - - result = ::Ci::DestroyPipelineService.new(project, current_user).execute(pipeline) - { - success: result.success?, - errors: result.errors - } - end - end - end -end diff --git a/app/graphql/mutations/ci/pipeline_retry.rb b/app/graphql/mutations/ci/pipeline_retry.rb deleted file mode 100644 index 0669bfc449c..00000000000 --- a/app/graphql/mutations/ci/pipeline_retry.rb +++ /dev/null @@ -1,27 +0,0 @@ -# frozen_string_literal: true - -module Mutations - module Ci - class PipelineRetry < Base - graphql_name 'PipelineRetry' - - field :pipeline, - Types::Ci::PipelineType, - null: true, - description: 'The pipeline after mutation' - - authorize :update_pipeline - - def resolve(id:) - pipeline = authorized_find!(id: id) - project = pipeline.project - - ::Ci::RetryPipelineService.new(project, current_user).execute(pipeline) - { - pipeline: pipeline, - errors: errors_on_object(pipeline) - } - end - end - end -end diff --git a/app/graphql/types/mutation_type.rb b/app/graphql/types/mutation_type.rb index 9eea81c9d3e..b6213bdaf64 100644 --- a/app/graphql/types/mutation_type.rb +++ b/app/graphql/types/mutation_type.rb @@ -88,9 +88,9 @@ module Types mount_mutation Mutations::ContainerExpirationPolicies::Update mount_mutation Mutations::ContainerRepositories::Destroy mount_mutation Mutations::ContainerRepositories::DestroyTags - mount_mutation Mutations::Ci::PipelineCancel - mount_mutation Mutations::Ci::PipelineDestroy - mount_mutation Mutations::Ci::PipelineRetry + mount_mutation Mutations::Ci::Pipeline::Cancel + mount_mutation Mutations::Ci::Pipeline::Destroy + mount_mutation Mutations::Ci::Pipeline::Retry end end diff --git a/doc/api/graphql/reference/gitlab_schema.graphql b/doc/api/graphql/reference/gitlab_schema.graphql index e77136613fc..134681eaeb4 100644 --- a/doc/api/graphql/reference/gitlab_schema.graphql +++ b/doc/api/graphql/reference/gitlab_schema.graphql @@ -16732,7 +16732,7 @@ input PipelineCancelInput { clientMutationId: String """ - The ID of the pipeline to mutate + The ID of the pipeline to mutate. """ id: CiPipelineID! } @@ -16798,7 +16798,7 @@ input PipelineDestroyInput { clientMutationId: String """ - The ID of the pipeline to mutate + The ID of the pipeline to mutate. """ id: CiPipelineID! } @@ -16860,7 +16860,7 @@ input PipelineRetryInput { clientMutationId: String """ - The ID of the pipeline to mutate + The ID of the pipeline to mutate. """ id: CiPipelineID! } @@ -16880,7 +16880,7 @@ type PipelineRetryPayload { errors: [String!]! """ - The pipeline after mutation + The pipeline after mutation. """ pipeline: Pipeline } diff --git a/doc/api/graphql/reference/gitlab_schema.json b/doc/api/graphql/reference/gitlab_schema.json index cf66672d8d8..9b5f977875c 100644 --- a/doc/api/graphql/reference/gitlab_schema.json +++ b/doc/api/graphql/reference/gitlab_schema.json @@ -49465,7 +49465,7 @@ "inputFields": [ { "name": "id", - "description": "The ID of the pipeline to mutate", + "description": "The ID of the pipeline to mutate.", "type": { "kind": "NON_NULL", "name": null, @@ -49697,7 +49697,7 @@ "inputFields": [ { "name": "id", - "description": "The ID of the pipeline to mutate", + "description": "The ID of the pipeline to mutate.", "type": { "kind": "NON_NULL", "name": null, @@ -49897,7 +49897,7 @@ "inputFields": [ { "name": "id", - "description": "The ID of the pipeline to mutate", + "description": "The ID of the pipeline to mutate.", "type": { "kind": "NON_NULL", "name": null, @@ -49971,7 +49971,7 @@ }, { "name": "pipeline", - "description": "The pipeline after mutation", + "description": "The pipeline after mutation.", "args": [ ], diff --git a/doc/api/graphql/reference/index.md b/doc/api/graphql/reference/index.md index 8498e3d42ba..c141157f1ea 100644 --- a/doc/api/graphql/reference/index.md +++ b/doc/api/graphql/reference/index.md @@ -2565,7 +2565,7 @@ Autogenerated return type of PipelineRetry. | ----- | ---- | ----------- | | `clientMutationId` | String | A unique identifier for the client performing the mutation. | | `errors` | String! => Array | Errors encountered during execution of the mutation. | -| `pipeline` | Pipeline | The pipeline after mutation | +| `pipeline` | Pipeline | The pipeline after mutation. | ### Project diff --git a/doc/install/aws/index.md b/doc/install/aws/index.md index adc5496d638..8a8e3a053b6 100644 --- a/doc/install/aws/index.md +++ b/doc/install/aws/index.md @@ -44,22 +44,21 @@ Below is a diagram of the recommended architecture. ## AWS costs -Here's a list of the AWS services we will use, with links to pricing information: +GitLab uses the following AWS services, with links to pricing information: -- **EC2**: GitLab will deployed on shared hardware which means - [on-demand pricing](https://aws.amazon.com/ec2/pricing/on-demand/) - will apply. If you want to run it on a dedicated or reserved instance, - consult the [EC2 pricing page](https://aws.amazon.com/ec2/pricing/) for more - information on the cost. -- **S3**: We will use S3 to store backups, artifacts, LFS objects, etc. See the - [Amazon S3 pricing](https://aws.amazon.com/s3/pricing/). -- **ELB**: A Classic Load Balancer will be used to route requests to the - GitLab instances. See the [Amazon ELB pricing](https://aws.amazon.com/elasticloadbalancing/pricing/). -- **RDS**: An Amazon Relational Database Service using PostgreSQL will be used. See the - [Amazon RDS pricing](https://aws.amazon.com/rds/postgresql/pricing/). -- **ElastiCache**: An in-memory cache environment will be used to provide a - Redis configuration. See the - [Amazon ElastiCache pricing](https://aws.amazon.com/elasticache/pricing/). +- **EC2**: GitLab is deployed on shared hardware, for which + [on-demand pricing](https://aws.amazon.com/ec2/pricing/on-demand/) applies. + If you want to run GitLab on a dedicated or reserved instance, see the + [EC2 pricing page](https://aws.amazon.com/ec2/pricing/) for information about + its cost. +- **S3**: GitLab uses S3 ([pricing page](https://aws.amazon.com/s3/pricing/)) to + store backups, artifacts, and LFS objects. +- **ELB**: A Classic Load Balancer ([pricing page](https://aws.amazon.com/elasticloadbalancing/pricing/)), + used to route requests to the GitLab instances. +- **RDS**: An Amazon Relational Database Service using PostgreSQL + ([pricing page](https://aws.amazon.com/rds/postgresql/pricing/)). +- **ElastiCache**: An in-memory cache environment ([pricing page](https://aws.amazon.com/elasticache/pricing/)), + used to provide a Redis configuration. ## Create an IAM EC2 instance role and profile