Auto-Deploy doesn't work with sub paths
Summary
(Summarize the bug encountered concisely)
When using Auto-DevOps, and especially Auto-Deploy, it seems impossible to use applications running on a subpath, like WebGoat. This app mounts only /WebGoat/ and / is therefore a 404, leading to pods never considered as ready, incorrect review apps links, etc.
Steps to reproduce
- Use WebGoat with Auto-DevOps
Example Project
(If possible, please create an example project here on GitLab.com that exhibits the problematic behavior, and link to it here in the bug report)
(If you are using an older version of GitLab, this will also determine whether the bug is fixed in a more recent version)
A good example is this MR: gitlab-org/security-products/tests/webgoat!15 (closed)
Yes, some auto-devops has been copied in .gitlab-ci.yml a long time ago (even before ADO was a template). It needs to be updated to use the template instead, but it will be a future iteration.
What is the current bug behavior?
Deploy fails because the "hostname" is invalid: https://gitlab.com/gitlab-org/security-products/tests/webgoat/-/jobs/345123513
We don't specify anywhere (as far as I know, I've checked Review Apps, environments, environment:url,...) that the URL can't have a subpath. It must be a HOSTNAME. It's even more confusing that environment:url has a scheme.
What is the expected correct behavior?
Auto-DevOps and Auto-Deploy work with applications only available through subpaths.
Relevant logs and/or screenshots
https://gitlab.com/gitlab-org/security-products/tests/webgoat/-/jobs/345123513
Possible fixes
Extract the hostname from service.url: https://gitlab.com/gitlab-org/cluster-integration/auto-deploy-image/blob/fc4d40d872ce27bc0a80bb359dc1119573e879d9/src/bin/auto-deploy#L158
Notes
We need to keep the subpath for the review button, and for DAST, since it's used as the TARGET_URL