Commit b93a9734 authored by Savas Vedova's avatar Savas Vedova Committed by Mayra Cabrera

Add confirmedBy field to vulnerability object in GraphQL

- Update documentation
- Update schema
- Add changelog
parent e970bf06
...@@ -25046,6 +25046,11 @@ type Vulnerability implements Noteable { ...@@ -25046,6 +25046,11 @@ type Vulnerability implements Noteable {
""" """
confirmedAt: Time confirmedAt: Time
"""
The user that confirmed the vulnerability.
"""
confirmedBy: User
""" """
Description of the vulnerability Description of the vulnerability
""" """
......
...@@ -72961,6 +72961,20 @@ ...@@ -72961,6 +72961,20 @@
"isDeprecated": false, "isDeprecated": false,
"deprecationReason": null "deprecationReason": null
}, },
{
"name": "confirmedBy",
"description": "The user that confirmed the vulnerability.",
"args": [
],
"type": {
"kind": "OBJECT",
"name": "User",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
},
{ {
"name": "description", "name": "description",
"description": "Description of the vulnerability", "description": "Description of the vulnerability",
...@@ -3776,6 +3776,7 @@ Represents a vulnerability. ...@@ -3776,6 +3776,7 @@ Represents a vulnerability.
| Field | Type | Description | | Field | Type | Description |
| ----- | ---- | ----------- | | ----- | ---- | ----------- |
| `confirmedAt` | Time | Timestamp of when the vulnerability state was changed to confirmed | | `confirmedAt` | Time | Timestamp of when the vulnerability state was changed to confirmed |
| `confirmedBy` | User | The user that confirmed the vulnerability. |
| `description` | String | Description of the vulnerability | | `description` | String | Description of the 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 |
......
...@@ -81,6 +81,13 @@ module Types ...@@ -81,6 +81,13 @@ module Types
field :merge_request, ::Types::MergeRequestType, null: true, field :merge_request, ::Types::MergeRequestType, null: true,
description: 'Merge request that fixes the vulnerability.' description: 'Merge request that fixes the vulnerability.'
field :confirmed_by, ::Types::UserType, null: true,
description: 'The user that confirmed the vulnerability.'
def confirmed_by
::Gitlab::Graphql::Loaders::BatchModelLoader.new(::User, object.confirmed_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 confirmedBy field to vulnerability object in GraphQL
merge_request: 50144
author:
type: changed
...@@ -30,8 +30,9 @@ RSpec.describe GitlabSchema.types['Vulnerability'] do ...@@ -30,8 +30,9 @@ RSpec.describe GitlabSchema.types['Vulnerability'] do
notes notes
external_issue_links external_issue_links
has_solutions has_solutions
discussions
merge_request merge_request
discussions] confirmed_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