Skip to content

GitLab Next

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • GitLab GitLab
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 39,512
    • Issues 39,512
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 1,222
    • Merge requests 1,222
  • Requirements
    • Requirements
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Metrics
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
    • Value stream
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GitLab.org
  • GitLabGitLab
  • Merge requests
  • !34119

Merged
Created Jun 09, 2020 by James Fargher@proglottis🌴Maintainer5 of 5 tasks completed5/5 tasks

Add API to schedule project repository storage moves

  • Overview 20
  • Commits 1
  • Pipelines 9
  • Changes 4

What does this MR do?

#217878 (closed)

Add a new API to initiate project repository storage moves. The goal here is to give a higher visibility endpoint than the current one which is kicked off by updating projects.

Manual Testing

Assuming we have gitaly setup with a second storage called second stored in ~/Downloads/second/.

Check where the project is currently stored:

$ curl -H "PRIVATE_TOKEN: XXXX" http://localhost:3000/api/v4/projects/23
{"id":23, ... "repository_storage":"default", ...}

Initiate the move:

$ curl -X POST -H "PRIVATE_TOKEN: XXXX" -H "Content-Type: application/json" -d '{"destination_storage_name":"second"}' http://localhost:3000/api/v4/projects/23/repository_storage_moves
{"id":10,"created_at":"2020-06-09T03:25:59.474Z","state":"scheduled","source_storage_name":"default","destination_storage_name":"second","project":{"id":23,"description":"","name":"gpgme","name_with_namespace":"Administrator / gpgme","path":"gpgme","path_with_namespace":"root/gpgme","created_at":"2020-04-03T01:15:42.486Z"}}

Check the status of the move:

$ curl -H "PRIVATE_TOKEN: XXXX" http://localhost:3000/api/v4/projects/23/repository_storage_moves/10
{"id":10,"created_at":"2020-06-09T03:25:59.474Z","state":"finished","source_storage_name":"default","destination_storage_name":"second","project":{"id":23,"description":"","name":"gpgme","name_with_namespace":"Administrator / gpgme","path":"gpgme","path_with_namespace":"root/gpgme","created_at":"2020-04-03T01:15:42.486Z"}}

Double check the project has moved:

$ curl -H "PRIVATE_TOKEN: XXXX" http://localhost:3000/api/v4/projects/23
{"id":23, ... "repository_storage":"second", ...}

Screenshots

Does this MR meet the acceptance criteria?

Conformity

  • [-] Changelog entry
  • Documentation (if required)
  • Code review guidelines
  • Merge request performance guidelines
  • Style guides
  • [-] Database guides
  • [-] Separation of EE specific content

Availability and Testing

  • Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process.
  • [-] Tested in all supported browsers
  • [-] Informed Infrastructure department of a default or new setting change, if applicable per definition of done

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • [-] Label as security and @ mention @gitlab-com/gl-security/appsec
  • [-] The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • [-] Security reports checked/validated by a reviewer from the AppSec team
Edited Jun 15, 2020 by Mayra Cabrera
Assignee
Assign to
Reviewer
Request review from
Time tracking
Source branch: schedule_storage_move_api

Enable Gitpod?

To use Gitpod you must first enable the feature in the integrations section of your user preferences.

Cancel Enable Gitpod