Commit a5953474 authored by lauraMon's avatar lauraMon

Adds docs and schema

* Also refactors a spec
* Adds a changelog
parent e17ac92c
---
title: 'GraphQL: Pipeline mutations for retry, cancel, and destroy'
merge_request: 39780
author:
type: added
...@@ -9760,6 +9760,9 @@ type Mutation { ...@@ -9760,6 +9760,9 @@ type Mutation {
""" """
mergeRequestUpdate(input: MergeRequestUpdateInput!): MergeRequestUpdatePayload mergeRequestUpdate(input: MergeRequestUpdateInput!): MergeRequestUpdatePayload
namespaceIncreaseStorageTemporarily(input: NamespaceIncreaseStorageTemporarilyInput!): NamespaceIncreaseStorageTemporarilyPayload namespaceIncreaseStorageTemporarily(input: NamespaceIncreaseStorageTemporarilyInput!): NamespaceIncreaseStorageTemporarilyPayload
pipelineCancel(input: PipelineCancelInput!): PipelineCancelPayload
pipelineDestroy(input: PipelineDestroyInput!): PipelineDestroyPayload
pipelineRetry(input: PipelineRetryInput!): PipelineRetryPayload
removeAwardEmoji(input: RemoveAwardEmojiInput!): RemoveAwardEmojiPayload @deprecated(reason: "Use awardEmojiRemove. Deprecated in 13.2") removeAwardEmoji(input: RemoveAwardEmojiInput!): RemoveAwardEmojiPayload @deprecated(reason: "Use awardEmojiRemove. Deprecated in 13.2")
removeProjectFromSecurityDashboard(input: RemoveProjectFromSecurityDashboardInput!): RemoveProjectFromSecurityDashboardPayload removeProjectFromSecurityDashboard(input: RemoveProjectFromSecurityDashboardInput!): RemoveProjectFromSecurityDashboardPayload
runDastScan(input: RunDASTScanInput!): RunDASTScanPayload runDastScan(input: RunDASTScanInput!): RunDASTScanPayload
...@@ -10554,6 +10557,31 @@ type Pipeline { ...@@ -10554,6 +10557,31 @@ type Pipeline {
userPermissions: PipelinePermissions! userPermissions: PipelinePermissions!
} }
"""
Autogenerated input type of PipelineCancel
"""
input PipelineCancelInput {
"""
A unique identifier for the client performing the mutation.
"""
clientMutationId: String
}
"""
Autogenerated return type of PipelineCancel
"""
type PipelineCancelPayload {
"""
A unique identifier for the client performing the mutation.
"""
clientMutationId: String
"""
Errors encountered during execution of the mutation.
"""
errors: [String!]!
}
enum PipelineConfigSourceEnum { enum PipelineConfigSourceEnum {
AUTO_DEVOPS_SOURCE AUTO_DEVOPS_SOURCE
BRIDGE_SOURCE BRIDGE_SOURCE
...@@ -10590,6 +10618,41 @@ type PipelineConnection { ...@@ -10590,6 +10618,41 @@ type PipelineConnection {
pageInfo: PageInfo! pageInfo: PageInfo!
} }
"""
Autogenerated input type of PipelineDestroy
"""
input PipelineDestroyInput {
"""
A unique identifier for the client performing the mutation.
"""
clientMutationId: String
"""
The id of the pipeline to mutate
"""
id: ID!
}
"""
Autogenerated return type of PipelineDestroy
"""
type PipelineDestroyPayload {
"""
A unique identifier for the client performing the mutation.
"""
clientMutationId: String
"""
Errors encountered during execution of the mutation.
"""
errors: [String!]!
"""
The pipeline after mutation
"""
pipeline: Pipeline
}
""" """
An edge in a connection. An edge in a connection.
""" """
...@@ -10622,6 +10685,41 @@ type PipelinePermissions { ...@@ -10622,6 +10685,41 @@ type PipelinePermissions {
updatePipeline: Boolean! updatePipeline: Boolean!
} }
"""
Autogenerated input type of PipelineRetry
"""
input PipelineRetryInput {
"""
A unique identifier for the client performing the mutation.
"""
clientMutationId: String
"""
The id of the pipeline to mutate
"""
id: ID!
}
"""
Autogenerated return type of PipelineRetry
"""
type PipelineRetryPayload {
"""
A unique identifier for the client performing the mutation.
"""
clientMutationId: String
"""
Errors encountered during execution of the mutation.
"""
errors: [String!]!
"""
The pipeline after mutation
"""
pipeline: Pipeline
}
enum PipelineStatusEnum { enum PipelineStatusEnum {
CANCELED CANCELED
CREATED CREATED
......
...@@ -1622,6 +1622,25 @@ Information about pagination in a connection. ...@@ -1622,6 +1622,25 @@ Information about pagination in a connection.
| `user` | User | Pipeline user | | `user` | User | Pipeline user |
| `userPermissions` | PipelinePermissions! | Permissions for the current user on the resource | | `userPermissions` | PipelinePermissions! | Permissions for the current user on the resource |
## PipelineCancelPayload
Autogenerated return type of PipelineCancel
| Name | Type | Description |
| --- | ---- | ---------- |
| `clientMutationId` | String | A unique identifier for the client performing the mutation. |
| `errors` | String! => Array | Errors encountered during execution of the mutation. |
## PipelineDestroyPayload
Autogenerated return type of PipelineDestroy
| Name | Type | Description |
| --- | ---- | ---------- |
| `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 |
## PipelinePermissions ## PipelinePermissions
| Name | Type | Description | | Name | Type | Description |
...@@ -1630,6 +1649,16 @@ Information about pagination in a connection. ...@@ -1630,6 +1649,16 @@ Information about pagination in a connection.
| `destroyPipeline` | Boolean! | Indicates the user can perform `destroy_pipeline` on this resource | | `destroyPipeline` | Boolean! | Indicates the user can perform `destroy_pipeline` on this resource |
| `updatePipeline` | Boolean! | Indicates the user can perform `update_pipeline` on this resource | | `updatePipeline` | Boolean! | Indicates the user can perform `update_pipeline` on this resource |
## PipelineRetryPayload
Autogenerated return type of PipelineRetry
| Name | Type | Description |
| --- | ---- | ---------- |
| `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 |
## Project ## Project
| Name | Type | Description | | Name | Type | Description |
......
...@@ -5,8 +5,8 @@ require 'spec_helper' ...@@ -5,8 +5,8 @@ require 'spec_helper'
RSpec.describe 'PipelineDestroy' do RSpec.describe 'PipelineDestroy' do
include GraphqlHelpers include GraphqlHelpers
let_it_be(:user) { create(:user) }
let_it_be(:project) { create(:project) } let_it_be(:project) { create(:project) }
let_it_be(:user) { project.owner }
let(:pipeline) { create(:ci_pipeline, :success, project: project, user: user) } let(:pipeline) { create(:ci_pipeline, :success, project: project, user: user) }
let(:mutation) do let(:mutation) do
...@@ -20,12 +20,6 @@ RSpec.describe 'PipelineDestroy' do ...@@ -20,12 +20,6 @@ RSpec.describe 'PipelineDestroy' do
) )
end end
let(:mutation_response) { graphql_mutation_response(:pipeline_destroy) }
before do
project.add_maintainer(user)
end
it 'returns an error if the user is not allowed to destroy the pipeline' do it 'returns an error if the user is not allowed to destroy the pipeline' do
post_graphql_mutation(mutation, current_user: create(:user)) post_graphql_mutation(mutation, current_user: create(:user))
...@@ -36,5 +30,6 @@ RSpec.describe 'PipelineDestroy' do ...@@ -36,5 +30,6 @@ RSpec.describe 'PipelineDestroy' do
post_graphql_mutation(mutation, current_user: user) post_graphql_mutation(mutation, current_user: user)
expect(response).to have_gitlab_http_status(:success) expect(response).to have_gitlab_http_status(:success)
expect { pipeline.reload }.to raise_error(ActiveRecord::RecordNotFound)
end end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment