Commit 154fc086 authored by Alan (Maciej) Paruszewski's avatar Alan (Maciej) Paruszewski Committed by Dylan Griffith

Rename mutation to Dismiss Vulnerability to follow convention

This change renames GraphQL mutation dismissVulnerability to
vulnerabilityDismiss and deprecates the old name.
parent eb8418a8
...@@ -71,4 +71,5 @@ module Types ...@@ -71,4 +71,5 @@ module Types
end end
::Types::MutationType.prepend(::Types::DeprecatedMutations) ::Types::MutationType.prepend(::Types::DeprecatedMutations)
::Types::MutationType.prepend_if_ee('EE::Types::DeprecatedMutations')
::Types::MutationType.prepend_if_ee('::EE::Types::MutationType') ::Types::MutationType.prepend_if_ee('::EE::Types::MutationType')
...@@ -10812,7 +10812,7 @@ type Mutation { ...@@ -10812,7 +10812,7 @@ type Mutation {
Toggles the resolved state of a discussion Toggles the resolved state of a discussion
""" """
discussionToggleResolve(input: DiscussionToggleResolveInput!): DiscussionToggleResolvePayload discussionToggleResolve(input: DiscussionToggleResolveInput!): DiscussionToggleResolvePayload
dismissVulnerability(input: DismissVulnerabilityInput!): DismissVulnerabilityPayload dismissVulnerability(input: DismissVulnerabilityInput!): DismissVulnerabilityPayload @deprecated(reason: "Use vulnerabilityDismiss. Deprecated in 13.5")
epicAddIssue(input: EpicAddIssueInput!): EpicAddIssuePayload epicAddIssue(input: EpicAddIssueInput!): EpicAddIssuePayload
epicSetSubscription(input: EpicSetSubscriptionInput!): EpicSetSubscriptionPayload epicSetSubscription(input: EpicSetSubscriptionInput!): EpicSetSubscriptionPayload
epicTreeReorder(input: EpicTreeReorderInput!): EpicTreeReorderPayload epicTreeReorder(input: EpicTreeReorderInput!): EpicTreeReorderPayload
...@@ -10876,6 +10876,7 @@ type Mutation { ...@@ -10876,6 +10876,7 @@ type Mutation {
updateRequirement(input: UpdateRequirementInput!): UpdateRequirementPayload updateRequirement(input: UpdateRequirementInput!): UpdateRequirementPayload
updateSnippet(input: UpdateSnippetInput!): UpdateSnippetPayload updateSnippet(input: UpdateSnippetInput!): UpdateSnippetPayload
vulnerabilityConfirm(input: VulnerabilityConfirmInput!): VulnerabilityConfirmPayload vulnerabilityConfirm(input: VulnerabilityConfirmInput!): VulnerabilityConfirmPayload
vulnerabilityDismiss(input: VulnerabilityDismissInput!): VulnerabilityDismissPayload
vulnerabilityResolve(input: VulnerabilityResolveInput!): VulnerabilityResolvePayload vulnerabilityResolve(input: VulnerabilityResolveInput!): VulnerabilityResolvePayload
} }
...@@ -18836,6 +18837,46 @@ type VulnerabilityConnection { ...@@ -18836,6 +18837,46 @@ type VulnerabilityConnection {
pageInfo: PageInfo! pageInfo: PageInfo!
} }
"""
Autogenerated input type of VulnerabilityDismiss
"""
input VulnerabilityDismissInput {
"""
A unique identifier for the client performing the mutation.
"""
clientMutationId: String
"""
Reason why vulnerability should be dismissed
"""
comment: String
"""
ID of the vulnerability to be dismissed
"""
id: ID!
}
"""
Autogenerated return type of VulnerabilityDismiss
"""
type VulnerabilityDismissPayload {
"""
A unique identifier for the client performing the mutation.
"""
clientMutationId: String
"""
Errors encountered during execution of the mutation.
"""
errors: [String!]!
"""
The vulnerability after dismissal
"""
vulnerability: Vulnerability
}
""" """
An edge in a connection. An edge in a connection.
""" """
......
...@@ -31135,8 +31135,8 @@ ...@@ -31135,8 +31135,8 @@
"name": "DismissVulnerabilityPayload", "name": "DismissVulnerabilityPayload",
"ofType": null "ofType": null
}, },
"isDeprecated": false, "isDeprecated": true,
"deprecationReason": null "deprecationReason": "Use vulnerabilityDismiss. Deprecated in 13.5"
}, },
{ {
"name": "epicAddIssue", "name": "epicAddIssue",
...@@ -32434,6 +32434,33 @@ ...@@ -32434,6 +32434,33 @@
"isDeprecated": false, "isDeprecated": false,
"deprecationReason": null "deprecationReason": null
}, },
{
"name": "vulnerabilityDismiss",
"description": null,
"args": [
{
"name": "input",
"description": null,
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "INPUT_OBJECT",
"name": "VulnerabilityDismissInput",
"ofType": null
}
},
"defaultValue": null
}
],
"type": {
"kind": "OBJECT",
"name": "VulnerabilityDismissPayload",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
},
{ {
"name": "vulnerabilityResolve", "name": "vulnerabilityResolve",
"description": null, "description": null,
...@@ -55100,6 +55127,118 @@ ...@@ -55100,6 +55127,118 @@
"enumValues": null, "enumValues": null,
"possibleTypes": null "possibleTypes": null
}, },
{
"kind": "INPUT_OBJECT",
"name": "VulnerabilityDismissInput",
"description": "Autogenerated input type of VulnerabilityDismiss",
"fields": null,
"inputFields": [
{
"name": "id",
"description": "ID of the vulnerability to be dismissed",
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "ID",
"ofType": null
}
},
"defaultValue": null
},
{
"name": "comment",
"description": "Reason why vulnerability should be dismissed",
"type": {
"kind": "SCALAR",
"name": "String",
"ofType": null
},
"defaultValue": null
},
{
"name": "clientMutationId",
"description": "A unique identifier for the client performing the mutation.",
"type": {
"kind": "SCALAR",
"name": "String",
"ofType": null
},
"defaultValue": null
}
],
"interfaces": null,
"enumValues": null,
"possibleTypes": null
},
{
"kind": "OBJECT",
"name": "VulnerabilityDismissPayload",
"description": "Autogenerated return type of VulnerabilityDismiss",
"fields": [
{
"name": "clientMutationId",
"description": "A unique identifier for the client performing the mutation.",
"args": [
],
"type": {
"kind": "SCALAR",
"name": "String",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "errors",
"description": "Errors encountered during execution of the mutation.",
"args": [
],
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "LIST",
"name": null,
"ofType": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "String",
"ofType": null
}
}
}
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "vulnerability",
"description": "The vulnerability after dismissal",
"args": [
],
"type": {
"kind": "OBJECT",
"name": "Vulnerability",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
}
],
"inputFields": null,
"interfaces": [
],
"enumValues": null,
"possibleTypes": null
},
{ {
"kind": "OBJECT", "kind": "OBJECT",
"name": "VulnerabilityEdge", "name": "VulnerabilityEdge",
...@@ -2710,6 +2710,16 @@ Autogenerated return type of VulnerabilityConfirm. ...@@ -2710,6 +2710,16 @@ Autogenerated return type of VulnerabilityConfirm.
| `errors` | String! => Array | Errors encountered during execution of the mutation. | | `errors` | String! => Array | Errors encountered during execution of the mutation. |
| `vulnerability` | Vulnerability | The vulnerability after state change | | `vulnerability` | Vulnerability | The vulnerability after state change |
### VulnerabilityDismissPayload
Autogenerated return type of VulnerabilityDismiss.
| Field | Type | Description |
| ----- | ---- | ----------- |
| `clientMutationId` | String | A unique identifier for the client performing the mutation. |
| `errors` | String! => Array | Errors encountered during execution of the mutation. |
| `vulnerability` | Vulnerability | The vulnerability after dismissal |
### VulnerabilityIdentifier ### VulnerabilityIdentifier
Represents a vulnerability identifier. Represents a vulnerability identifier.
......
...@@ -7,6 +7,9 @@ module EE ...@@ -7,6 +7,9 @@ module EE
prepended do prepended do
mount_mutation ::Mutations::Pipelines::RunDastScan, deprecated: { reason: 'Use DastOnDemandScanCreate', milestone: '13.4' } mount_mutation ::Mutations::Pipelines::RunDastScan, deprecated: { reason: 'Use DastOnDemandScanCreate', milestone: '13.4' }
mount_aliased_mutation 'DismissVulnerability',
::Mutations::Vulnerabilities::Dismiss,
deprecated: { reason: 'Use vulnerabilityDismiss', milestone: '13.5' }
end end
end end
end end
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
module Mutations module Mutations
module Vulnerabilities module Vulnerabilities
class Dismiss < BaseMutation class Dismiss < BaseMutation
graphql_name 'DismissVulnerability' graphql_name 'VulnerabilityDismiss'
authorize :admin_vulnerability authorize :admin_vulnerability
......
...@@ -19,6 +19,26 @@ RSpec.describe GitlabSchema.types['Mutation'] do ...@@ -19,6 +19,26 @@ RSpec.describe GitlabSchema.types['Mutation'] do
end end
end end
describe 'aliased deprecated mutations' do
using RSpec::Parameterized::TableSyntax
where(:alias_name, :canonical_name) do
'DismissVulnerability' | 'VulnerabilityDismiss'
end
with_them do
let(:alias_field) { get_field(alias_name) }
let(:canonical_field) { get_field(canonical_name) }
it { expect(alias_field).to be_present }
it { expect(canonical_field).to be_present }
it { expect(alias_field.deprecation_reason).to be_present }
it { expect(canonical_field.deprecation_reason).not_to be_present }
it { expect(alias_field.resolver.fields).to eq(canonical_field.resolver.fields) }
it { expect(alias_field.resolver.arguments).to eq(canonical_field.resolver.arguments) }
end
end
def get_field(name) def get_field(name)
described_class.fields[GraphqlHelpers.fieldnamerize(name.camelize)] described_class.fields[GraphqlHelpers.fieldnamerize(name.camelize)]
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