Commit 663e7aed authored by Stan Hu's avatar Stan Hu

Merge branch...

Merge branch '225584-retrieve-security-dashboard-url-used-on-project-severity-status-report-from-backend-be' into 'master'

Add security_dashboard_path to GraphQL ProjectType

See merge request gitlab-org/gitlab!38171
parents 36c72085 11498b4c
...@@ -10178,6 +10178,11 @@ type Project { ...@@ -10178,6 +10178,11 @@ type Project {
""" """
sastCiConfiguration: SastCiConfiguration sastCiConfiguration: SastCiConfiguration
"""
Path to project's security dashboard
"""
securityDashboardPath: String
""" """
Information about security analyzers used in the project Information about security analyzers used in the project
""" """
......
...@@ -30035,6 +30035,20 @@ ...@@ -30035,6 +30035,20 @@
"isDeprecated": false, "isDeprecated": false,
"deprecationReason": null "deprecationReason": null
}, },
{
"name": "securityDashboardPath",
"description": "Path to project's security dashboard",
"args": [
],
"type": {
"kind": "SCALAR",
"name": "String",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
},
{ {
"name": "securityScanners", "name": "securityScanners",
"description": "Information about security analyzers used in the project", "description": "Information about security analyzers used in the project",
...@@ -1489,6 +1489,7 @@ Information about pagination in a connection. ...@@ -1489,6 +1489,7 @@ Information about pagination in a connection.
| `requirement` | Requirement | Find a single requirement. Available only when feature flag `requirements_management` is enabled. | | `requirement` | Requirement | Find a single requirement. Available only when feature flag `requirements_management` is enabled. |
| `requirementStatesCount` | RequirementStatesCount | Number of requirements for the project by their state | | `requirementStatesCount` | RequirementStatesCount | Number of requirements for the project by their state |
| `sastCiConfiguration` | SastCiConfiguration | SAST CI configuration for the project | | `sastCiConfiguration` | SastCiConfiguration | SAST CI configuration for the project |
| `securityDashboardPath` | String | Path to project's security dashboard |
| `securityScanners` | SecurityScanners | Information about security analyzers used in the project | | `securityScanners` | SecurityScanners | Information about security analyzers used in the project |
| `sentryDetailedError` | SentryDetailedError | Detailed version of a Sentry error on the project | | `sentryDetailedError` | SentryDetailedError | Detailed version of a Sentry error on the project |
| `sentryErrors` | SentryErrorCollection | Paginated collection of Sentry errors on the project | | `sentryErrors` | SentryErrorCollection | Paginated collection of Sentry errors on the project |
......
...@@ -53,6 +53,13 @@ module EE ...@@ -53,6 +53,13 @@ module EE
resolver: ::Resolvers::ComplianceFrameworksResolver, resolver: ::Resolvers::ComplianceFrameworksResolver,
null: true null: true
field :security_dashboard_path, GraphQL::STRING_TYPE,
description: "Path to project's security dashboard",
null: true,
resolve: -> (project, args, ctx) do
Rails.application.routes.url_helpers.project_security_dashboard_index_path(project)
end
def self.requirements_available?(project, user) def self.requirements_available?(project, user)
::Feature.enabled?(:requirements_management, project, default_enabled: true) && Ability.allowed?(user, :read_requirement, project) ::Feature.enabled?(:requirements_management, project, default_enabled: true) && Ability.allowed?(user, :read_requirement, project)
end end
......
...@@ -17,6 +17,7 @@ RSpec.describe GitlabSchema.types['Project'] do ...@@ -17,6 +17,7 @@ RSpec.describe GitlabSchema.types['Project'] do
expected_fields = %w[ expected_fields = %w[
vulnerabilities vulnerability_scanners requirement_states_count vulnerabilities vulnerability_scanners requirement_states_count
vulnerability_severities_count packages compliance_frameworks vulnerability_severities_count packages compliance_frameworks
security_dashboard_path
] ]
expect(described_class).to include_graphql_fields(*expected_fields) expect(described_class).to include_graphql_fields(*expected_fields)
......
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