Decouple internal/domain/ from internal/request/ package
The internal/request/
package has caused some trouble with circular dependencies, for example !603 (comment 707615505). I also encountered some issues before, but opted for copying code instead for simplicity.
In the example above, I believe the top problem is the internal/request/
package imports the domain
package, which ends up importing itself again. From the output
package gitlab.com/gitlab-org/gitlab-pages/internal/domain (test)
imports gitlab.com/gitlab-org/gitlab-pages/internal/serving/disk/local
imports gitlab.com/gitlab-org/gitlab-pages/internal/serving/disk
imports gitlab.com/gitlab-org/gitlab-pages/internal/redirects
imports gitlab.com/gitlab-org/gitlab-pages/internal/acme
imports gitlab.com/gitlab-org/gitlab-pages/internal/logging
imports gitlab.com/gitlab-org/gitlab-pages/internal/request
The output above means domain -> local -> disk -> redirects -> acme -> logging -> request -> domain
So I think ideally we should decouple domain
and request
first, I'd suggest moving the domain
related stuff to the internal/domain/
package
Also break dependency with the internal/acme/
package.
Related to !603 (comment 707615505)
Edited by Jaime Martinez