Commit cc99141a authored by Dmytro Zaporozhets (DZ)'s avatar Dmytro Zaporozhets (DZ)

Merge branch '228740-add-resolvedById-field' into 'master'

Add resolvedById field to vulnerability object in GraphQL

See merge request gitlab-org/gitlab!50145
parents f2bc2e89 475719cd
......@@ -25248,6 +25248,11 @@ type Vulnerability implements Noteable {
"""
resolvedAt: Time
"""
The user that resolved the vulnerability.
"""
resolvedBy: User
"""
Indicates whether the vulnerability is fixed on the default branch or not
"""
......
......@@ -73468,6 +73468,20 @@
"isDeprecated": false,
"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",
"description": "Indicates whether the vulnerability is fixed on the default branch or not",
......@@ -3795,6 +3795,7 @@ Represents a vulnerability.
| `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) |
| `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 |
| `scanner` | VulnerabilityScanner | Scanner metadata for the vulnerability. |
| `severity` | VulnerabilitySeverity | Severity of the vulnerability (INFO, UNKNOWN, LOW, MEDIUM, HIGH, CRITICAL) |
......
......@@ -84,10 +84,17 @@ module Types
field :confirmed_by, ::Types::UserType, null: true,
description: 'The user that confirmed the vulnerability.'
field :resolved_by, ::Types::UserType, null: true,
description: 'The user that resolved the vulnerability.'
def confirmed_by
::Gitlab::Graphql::Loaders::BatchModelLoader.new(::User, object.confirmed_by_id).find
end
def resolved_by
::Gitlab::Graphql::Loaders::BatchModelLoader.new(::User, object.resolved_by_id).find
end
def user_notes_count
::Gitlab::Graphql::Aggregations::Vulnerabilities::LazyUserNotesCountAggregate.new(context, object)
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
notes
external_issue_links
has_solutions
discussions
merge_request
confirmed_by]
discussions
confirmed_by
resolved_by]
end
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