Difference between revisions of "Reforking the GitLab Project"

From Eigen
Jump to: navigation, search
m (Cantonios moved page Reforking to Reforking the GitLab Repo)
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
Due to a technical issue that occurred on October 2, 2021, all GitLab fork relationships to the main [https://gitlab.com/libeigen/eigen Eigen project] created before that date have been severed.  This will prevent users from creating new MRs from these severed forks, and from reopening old ones.
+
Due to an incident that occurred on October 2, 2021, all GitLab fork relationships to the main [https://gitlab.com/libeigen/eigen Eigen project] created before that date have been severed.  This will prevent users from creating new MRs from these severed forks, and from reopening old ones.
  
 
Fortunately, there is a way via the GitLab API to re-establish the fork connection.
 
Fortunately, there is a way via the GitLab API to re-establish the fork connection.
Line 5: Line 5:
 
# Create a personal access token ([https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html#create-a-personal-access-token documentation])
 
# Create a personal access token ([https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html#create-a-personal-access-token documentation])
 
#* Navigate to https://gitlab.com/-/profile/personal_access_tokens?name=refork&scopes=api
 
#* Navigate to https://gitlab.com/-/profile/personal_access_tokens?name=refork&scopes=api
#* Click the button: 'Create personal access token'
+
#* Click the button: ''Create personal access token''
 
#* Copy the token at the top of the screen.
 
#* Copy the token at the top of the screen.
 
# Determine your local project's ID.
 
# Determine your local project's ID.

Latest revision as of 16:44, 15 October 2021

Due to an incident that occurred on October 2, 2021, all GitLab fork relationships to the main Eigen project created before that date have been severed. This will prevent users from creating new MRs from these severed forks, and from reopening old ones.

Fortunately, there is a way via the GitLab API to re-establish the fork connection.

  1. Create a personal access token (documentation)
  2. Determine your local project's ID.
  3. Use the GitLab REST API to delete the existing broken fork relationship, and re-add it.

Bash:

export PRIVATE_TOKEN=Jk6S1gE8ryA8fy3zgtsj  # <-- Replace with your token.
export PROJECT_ID=17989470                 # <-- Replace with your Project ID.
export EIGEN_PROJECT_ID=15462818
 
# Delete existing fork.
curl -H "PRIVATE-TOKEN: $PRIVATE_TOKEN" -X DELETE \ 
    https://gitlab.com/api/v4/projects/$PROJECT_ID/fork
 
# Re-establish fork.
curl -H "PRIVATE-TOKEN: $PRIVATE_TOKEN" -X POST \
    https://gitlab.com/api/v4/projects/$PROJECT_ID/fork/$EIGEN_PROJECT_ID

Windows Command Prompt:

:: # Replace PRIVATE_TOKEN and PROJECT_ID with your values.
set PRIVATE_TOKEN=Jk6S1gE8ryA8fy3zgtsj
set PROJECT_ID=17989470
set EIGEN_PROJECT_ID=15462818
 
:: # Delete existing fork.
curl -H "PRIVATE-TOKEN: %PRIVATE_TOKEN%" -X DELETE ^
    https://gitlab.com/api/v4/projects/%PROJECT_ID%/fork
 
:: # Re-establish fork.
curl -H "PRIVATE-TOKEN: %PRIVATE_TOKEN%" -X POST ^
    https://gitlab.com/api/v4/projects/%PROJECT_ID%/fork/%EIGEN_PROJECT_ID%

Windows Powershell

$PRIVATE_TOKEN="Jk6S1gE8ryA8fy3zgtsj"  # <-- Replace with your token (in quotes).
$PROJECT_ID=17989470                   # <-- Replace with your Project ID.
$EIGEN_PROJECT_ID=15462818
 
# Delete existing fork.
curl -H "PRIVATE-TOKEN: $PRIVATE_TOKEN" -X DELETE `
    https://gitlab.com/api/v4/projects/$PROJECT_ID/fork
 
# Re-establish fork.
curl -H "PRIVATE-TOKEN: $PRIVATE_TOKEN" -X POST `
    https://gitlab.com/api/v4/projects/$PROJECT_ID/fork/$EIGEN_PROJECT_ID