I refactored the TLS certificate lookup code in GitLab Pages. I moved the code that fetches a domain's certificate out of app.go and into its own internal/tls package.
The goal was to keep the main application code simpler, and to make the certificate logic easier to test and extend.
What shipped:
- moved
GetCertificateForDomaininto the new package, - updated the TLS config to use the new package,
- added tests and fixed type and import issues during review.
Maintainers asked for several rounds of improvements to function signatures, error handling, and test coverage before merge. This made the final patch better.
In a follow-up, !1140, I added acceptance tests for slowlogs.Recorder.
Links: MR !1139 • Issue #708 • MR !1140