Commit 475719cd authored by Savas Vedova's avatar Savas Vedova

Add resolvedById field to vulnerability object in GraphQL

- Update documentation
- Update schema
- Add changelog
parent 04f0ec2a
...@@ -25218,6 +25218,11 @@ type Vulnerability implements Noteable { ...@@ -25218,6 +25218,11 @@ type Vulnerability implements Noteable {
""" """
resolvedAt: Time resolvedAt: Time
"""
The user that resolved the vulnerability.
"""
resolvedBy: User
""" """
Indicates whether the vulnerability is fixed on the default branch or not Indicates whether the vulnerability is fixed on the default branch or not
""" """
......
...@@ -73401,6 +73401,20 @@ ...@@ -73401,6 +73401,20 @@
"isDeprecated": false, "isDeprecated": false,
"deprecationReason": null "deprecationReason": null
}, },
{
"name": "resolvedBy",
"description": "The user that resolved the vulnerability.",
"args": [
],
"type": {
"kind": "OBJECT",
"name": "User",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
},
{ {
"name": "resolvedOnDefaultBranch", "name": "resolvedOnDefaultBranch",
"description": "Indicates whether the vulnerability is fixed on the default branch or not", "description": "Indicates whether the vulnerability is fixed on the default branch or not",
...@@ -3793,6 +3793,7 @@ Represents a vulnerability. ...@@ -3793,6 +3793,7 @@ Represents a vulnerability.
| `project` | Project | The project on which the vulnerability was found | | `project` | Project | The project on which the vulnerability was found |
| `reportType` | VulnerabilityReportType | Type of the security report that found the vulnerability (SAST, DEPENDENCY_SCANNING, CONTAINER_SCANNING, DAST, SECRET_DETECTION, COVERAGE_FUZZING, API_FUZZING) | | `reportType` | VulnerabilityReportType | Type of the security report that found the vulnerability (SAST, DEPENDENCY_SCANNING, CONTAINER_SCANNING, DAST, SECRET_DETECTION, COVERAGE_FUZZING, API_FUZZING) |
| `resolvedAt` | Time | Timestamp of when the vulnerability state was changed to resolved | | `resolvedAt` | Time | Timestamp of when the vulnerability state was changed to resolved |
| `resolvedBy` | User | The user that resolved the vulnerability. |
| `resolvedOnDefaultBranch` | Boolean! | Indicates whether the vulnerability is fixed on the default branch or not | | `resolvedOnDefaultBranch` | Boolean! | Indicates whether the vulnerability is fixed on the default branch or not |
| `scanner` | VulnerabilityScanner | Scanner metadata for the vulnerability. | | `scanner` | VulnerabilityScanner | Scanner metadata for the vulnerability. |
| `severity` | VulnerabilitySeverity | Severity of the vulnerability (INFO, UNKNOWN, LOW, MEDIUM, HIGH, CRITICAL) | | `severity` | VulnerabilitySeverity | Severity of the vulnerability (INFO, UNKNOWN, LOW, MEDIUM, HIGH, CRITICAL) |
......
...@@ -84,10 +84,17 @@ module Types ...@@ -84,10 +84,17 @@ module Types
field :confirmed_by, ::Types::UserType, null: true, field :confirmed_by, ::Types::UserType, null: true,
description: 'The user that confirmed the vulnerability.' description: 'The user that confirmed the vulnerability.'
field :resolved_by, ::Types::UserType, null: true,
description: 'The user that resolved 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
def resolved_by
::Gitlab::Graphql::Loaders::BatchModelLoader.new(::User, object.resolved_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 resolvedBy field to vulnerability object in GraphQL
merge_request: 50145
author:
type: changed
...@@ -30,9 +30,10 @@ RSpec.describe GitlabSchema.types['Vulnerability'] do ...@@ -30,9 +30,10 @@ RSpec.describe GitlabSchema.types['Vulnerability'] do
notes notes
external_issue_links external_issue_links
has_solutions has_solutions
discussions
merge_request merge_request
confirmed_by] discussions
confirmed_by
resolved_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