Add shallow cloning option for workspaces
Issue: Make project cloning faster in workspaces (#543982 - closed)
FF Rollout Issue: Workspaces shallow clone project FF rollout (#550330 - closed)
What does this MR do and why?
What it does
This MR introduces a new feature flag workspaces_agents_availability_admin which is used during the project cloning process for workspaces.
It enables the shallow cloning option for large repositories which will significantly reduce workspace startup times. After the initial shallow clone, a background process is started which unshallows the project and downloads the remaining git history. During this time some git operations are not available/have unexpected behavior.
Why this is needed
This is needed to enable gdk in workspaces for MR reviews. Since the gitlab monolith is a very large repo with an extended git history. A full clone takes ~10-15 minutes. We want to streamline this proccess, so that a workspace with GDK is up and running with the latest code changes from an MR and developers can begin reviewing without having to wait for an extended period of time which would be the case in a full project clone which downloads the complete git history.
References
Screenshots or screen recordings
This MR does introduce any UI changes.
| (FF:enabled) Shallow Clone - unshallow complete | (FF:enabled) Shallow Clone - unshallow skipped | (FF:disabled) Full clone |
|---|---|---|
| shallow-clone | skip-unshallow | ff-disabled |
| Smoke Test |
|---|
![]() |
How to set up and validate locally
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
-
Add new feature flag of type betascoped to the project of the workspace -
Feature flag should be disabled by default -
Shallow clone with depth 10 (last 10 commits) if feature flag is enabled -
Unshallow the project in the background after initial project clone is complete -
MR must have the ~“feature flag” label assigend
