Skip to content

Fix Pages Domain HAML rendering

Ben King requested to merge benjaminking-pages-haml-fix into master

What does this MR do and why?

When a user initiates the workflow to register a domain for use in GitLab Pages, if they provide an incorrect value such as http://test and don't use Lets Encrypt, it should return and display a validation error as we require only the FQDN. Due to how HAML is being rendered, we can enter into a state where a 500 error is generated because the HAML file is trying to generate a URL to clean_certificate_project_pages_domain_path without a valid ID, as no certificate has been provided.

To deflect this, I've also added placeholder text of example.com to encourage the proper use of a domain name.

Examples:

GitLab.com - HTTP

2024-11-29_13-45-38

GitLab.com - HTTPS

2024-11-29_13-46-09

GDK - With MR Implemented

2024-11-29_13-47-09

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

  1. In a Pages project on GitLab.com, attempt to add a domain name with http://<value>, with Lets Encrypt turned off.
  2. Confirm a 500 error appears.
  3. In GDK, apply this branch/MR and confirm proper validation is performed.

Merge request reports

Loading