Skip to content

Add export_path in order to make export api

Zamir Martins requested to merge add_export_path_for_flexibility_on_export into master

What does this MR do and why?

Add export_path to this endpoint in order to make export api to consider relative_url.

Related issue: #384884 (closed)

How to set up and validate locally

  1. Host Gitlab application on a relative url. https://docs.gitlab.com/ee/install/relative_url.html
  2. Go to a project's vulnerability report with a few vulnerabilities.
  3. Click on export to csv button.

Alternatively:

  1. Setup GDK by following these steps. It might require gdk reconfigure.
  2. Go to a project's vulnerability report with a few vulnerabilities.
  3. Click on export to csv button.

Another option of validation is through rails console:

Currently the vulnerabilitiesExportEndpoint used by CsvExportButton does not include the relative aspect of the host url.

pry(main)> app.api_v4_security_projects_vulnerability_exports_path(id: 46)
=> "/api/v4/security/projects/46/vulnerability_exports"

Therefore calling expose_path when setting vulnerabilities_export_endpoint ensures that the relative aspect of the host url is considered.

pry(main)> expose_path(app.api_v4_security_projects_vulnerability_exports_path(id: 46))
=> "/gitlab/api/v4/security/projects/46/vulnerability_exports"

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Zamir Martins

Merge request reports

Loading