Commit 9528d470 authored by Savas Vedova's avatar Savas Vedova

Add dismissedBy field to vulnerability object in GraphQL

- Update documentation
- Update schema
- Add changelog
parent 12f8692c
...@@ -25747,6 +25747,11 @@ type Vulnerability implements Noteable { ...@@ -25747,6 +25747,11 @@ type Vulnerability implements Noteable {
""" """
dismissedAt: Time dismissedAt: Time
"""
The user that dismissed the vulnerability
"""
dismissedBy: User
""" """
List of external issue links related to the vulnerability List of external issue links related to the vulnerability
""" """
......
...@@ -74716,6 +74716,20 @@ ...@@ -74716,6 +74716,20 @@
"isDeprecated": false, "isDeprecated": false,
"deprecationReason": null "deprecationReason": null
}, },
{
"name": "dismissedBy",
"description": "The user that dismissed the vulnerability",
"args": [
],
"type": {
"kind": "OBJECT",
"name": "User",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
},
{ {
"name": "externalIssueLinks", "name": "externalIssueLinks",
"description": "List of external issue links related to the vulnerability", "description": "List of external issue links related to the vulnerability",
...@@ -3818,6 +3818,7 @@ Represents a vulnerability. ...@@ -3818,6 +3818,7 @@ Represents a vulnerability.
| `detectedAt` | Time! | Timestamp of when the vulnerability was first detected | | `detectedAt` | Time! | Timestamp of when the vulnerability was first detected |
| `discussions` | DiscussionConnection! | All discussions on this noteable | | `discussions` | DiscussionConnection! | All discussions on this noteable |
| `dismissedAt` | Time | Timestamp of when the vulnerability state was changed to dismissed | | `dismissedAt` | Time | Timestamp of when the vulnerability state was changed to dismissed |
| `dismissedBy` | User | The user that dismissed the vulnerability |
| `externalIssueLinks` | VulnerabilityExternalIssueLinkConnection! | List of external issue links related to the vulnerability | | `externalIssueLinks` | VulnerabilityExternalIssueLinkConnection! | List of external issue links related to the vulnerability |
| `hasSolutions` | Boolean | Indicates whether there is a solution available for this vulnerability. | | `hasSolutions` | Boolean | Indicates whether there is a solution available for this vulnerability. |
| `id` | ID! | GraphQL ID of the vulnerability | | `id` | ID! | GraphQL ID of the vulnerability |
......
...@@ -87,6 +87,9 @@ module Types ...@@ -87,6 +87,9 @@ module Types
field :resolved_by, ::Types::UserType, null: true, field :resolved_by, ::Types::UserType, null: true,
description: 'The user that resolved the vulnerability.' description: 'The user that resolved the vulnerability.'
field :dismissed_by, ::Types::UserType, null: true,
description: 'The user that dismissed the vulnerability.'
def confirmed_by def confirmed_by
::Gitlab::Graphql::Loaders::BatchModelLoader.new(::User, object.confirmed_by_id).find ::Gitlab::Graphql::Loaders::BatchModelLoader.new(::User, object.confirmed_by_id).find
end end
...@@ -95,6 +98,10 @@ module Types ...@@ -95,6 +98,10 @@ module Types
::Gitlab::Graphql::Loaders::BatchModelLoader.new(::User, object.resolved_by_id).find ::Gitlab::Graphql::Loaders::BatchModelLoader.new(::User, object.resolved_by_id).find
end end
def dismissed_by
::Gitlab::Graphql::Loaders::BatchModelLoader.new(::User, object.dismissed_by_id).find
end
def user_notes_count def user_notes_count
::Gitlab::Graphql::Aggregations::Vulnerabilities::LazyUserNotesCountAggregate.new(context, object) ::Gitlab::Graphql::Aggregations::Vulnerabilities::LazyUserNotesCountAggregate.new(context, object)
end end
......
---
title: Add dismissedBy field to vulnerability object in GraphQL
merge_request: 50285
author:
type: changed
...@@ -33,7 +33,8 @@ RSpec.describe GitlabSchema.types['Vulnerability'] do ...@@ -33,7 +33,8 @@ RSpec.describe GitlabSchema.types['Vulnerability'] do
merge_request merge_request
discussions discussions
confirmed_by confirmed_by
resolved_by] resolved_by
dismissed_by]
end end
before do before do
......
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