feat(api/gitlab/v1): add project lease procurement to rename api
Related to #960 (closed)
🌱
Context We need to be able to lock a project space (in the registry this translates to all repositories under a project path) when a rename request is made against a project's base-repository (existing or not) by GitLab rails (see #924 (moved)) .
What does this MR do?
This MR introduces the procurement of "project leases" from a rename request. The leases are only procured for 60 seconds or the duration of the rename operation (whichever one comes first).
What are the changes
- changes to
repository.go
rename endpoint to procure project lease - update to tests (and new tests) to propagate auth token to rename endpoint
How will this feature be used in the future?
- When a repository rename operation is initiated all ensuing write operations to existing repositories in the
project_path
extracted from the JWT will be blocked until the rename operation completes. - The plan is to slowly rollout the checks for active "project leases" with a feature toggle #1035 (closed) together with #925 (closed)
Edited by Suleimi Ahmed