Skip to content

Add ability to set test rails hostname from config

Doug Stull requested to merge enable-test-to-have-configured-hostname into main

What does this merge request do and why?

Add ability to set test rails hostname from config

  • enable use of gdk.test when desired for test environment
  • enable proper setting of csp for that configured name
  • currently base allows this, but not test...which then leads to a potential mismatch of localhost vs a custom name like gdk.test
  • docs and such not updated as I feel this functionality is something I would have assumed to have worked this way before and did not based off the current documentation.

If successful allows the current setup in config/gitlab.yml

test:
  gitlab:
    host: gdk.test
    port: 80

    content_security_policy:
      directives:
        connect_src: "'self' http://localhost:* http://gdk.test:* ws://localhost:* wss://localhost:* ws://gdk.test:* wss://gdk.test:*"

How to set up and validate locally

  1. Ensure GitLab Pages is enabled by adding the below configuration in gdk.yml:
---
gitlab:
  rails:
    hostname: gdk.test
  1. Check out to this merge request's branch.
  2. Run gdk reconfigure to check if regenerating all configuration is successful in gitlab.yml in the GitLab project.

Impacted categories

The following categories relate to this merge request:

Merge request checklist

  • This change is backward compatible. If not, please include steps to communicate to our users.
  • Tests added for new functionality. If not, please raise an issue to follow-up.
  • Documentation added/updated, if needed.
  • Announcement added, if change is notable.
  • gdk doctor test added, if needed.
  • Add the ~highlight label if this MR should be included in the CHANGELOG.md.

Related to gitlab#428203 (closed)

Edited by Doug Stull

Merge request reports