refactor: Remove bundle generation logic from the Sink
This MR is a refactor of the bundleuri
package.
While trying to be as limited as possible in scope, it aims at removing the need to keep a reference to the underlying Sink
of the GenerationManager
. In other words, having a reference to the GenerationManager
should suffice to manage a bundle, and we should not have to pass around references to its underlying implementation to manage a bundle.
Here is a recap of how things currently works.
In some current use cases, the Sink
is used to manage a bundle:
- For the
GenerateBundleURI
RPC: https://gitlab.com/gitlab-org/gitaly/-/blob/master/internal/gitaly/service/repository/bundle_uri.go?ref_type=heads#L23 - To get the SignedURL of the bundle to advertize: https://gitlab.com/gitlab-org/gitaly/-/blob/master/internal/gitaly/service/smarthttp/upload_pack.go?ref_type=heads#L119
This state of affairs will cause some confusion when we enable the bundleuri
feature. The GenerationManager
has a strategy to determine if a bundle should be generated or not: https://gitlab.com/gitlab-org/gitaly/-/blob/master/internal/bundleuri/manager.go?ref_type=heads#L121
If we keep the current implementation, it means that for some use cases, the Sink
will be used to generate a bundle, and in some use cases, the GenerationManager
will be used.
This refactor stems from this concern. It aims at centralizing all bundle management into the manager.
Closes #6558