Skip to content

Migrate to Public Repository

Wesley Bland edited this page Feb 18, 2020 · 7 revisions

What is Happening?

The MPI Standard repository is moving from a private repository to a public repository. This is to make three things easier:

  1. Automated building of the MPI Standard source
  2. Contributing to the MPI Standard by both active and casual members of the MPI Forum
  3. Alleviating concerns about future billing costs

View a high level slide deck from the February 2020 meeting here.

What Does This Mean to Me?

Do you have a forked copy of the MPI Standard on GitHub? You'll need to go through a few easy steps to remake that fork against the now-public MPI Standard repository. When moving a repository from private to public, GitHub breaks all of the internal links between the repository to avoid exposing private information unintentionally. While this is a good policy, it does make things a little more tricky for our use case.

What Do I Need to Do?

I'm going to describe this with respect to your private fork, but this also applies to any forks managed by a working group. The current plan is for Wesley to take care of this for each working group, but if a working group would like to take care of it themselves, they're welcome to do so.

  1. Note any open pull requests based on branches in your repository.
  2. Download a copy of all your branches from your private fork.
  3. Rename your current fork.
  4. Create a new fork from your GitHub account.
  5. Push all your branches back to your new fork.
  6. Re-create any pull requests.
  7. Delete your current fork from your GitHub account (not your laptop).

How Do I Do This?

I'll go through this step-by-step:

Note Open Pull Requests

Unfortunately there's not a one stop shop for this one. You'll need to look at each group to which you contribute to get a list of all of your pull requests. Luckily, you can at least easily list all of the pull requests where you're the author:

https://github.com/mpi-forum/mpi-standard/pulls/<your_username_here>

If you have any pull requests open in working group repositories (these would typically be things that you and the working group are working on together but aren't done yet).

When you do that, you'll see a list of all of your open pull requests that looks like this:

Open Pull Requests

Go to each pull request on your list and note the source and target branch name. That is shown at the top of the page on each pull request:

Pull Request Branch Name

You should also note the pull request number because you will probably want to point back to the old pull request when you've opened the new one. Similarly, an issues that point to this pull request should be updated to point to the new pull request when you've created it.

Download All Your Branches

This can easily be done on the command line. I'd recommend cloning a new, temporary version of your repository locally onto your laptop for this instead of reusing another one to make sure that you end up with the exact same repository on the other end (and don't get extra branches). Here's how to do that:

$ cd /place/to/checkout/
$ git clone https://github.com/<your_username_here>/mpi-standard.git

That will make a copy of all of your branches locally on your laptop in a way that's easy to send back up to GitHub when you're done. Just so you have an idea of which branches you're backing up, you can view your current branches in GitHub on the website here:

https://github.com/<your_username_here>/mpi-standard/branches

You'll see something that looks like this:

Repository Branch List

Rename Current GitHub Fork

Here we'll rename the current fork just to be sure that the old data still exists in case there's a problem later. Go to your repository's setting page:

https://github.com/<your_username_here>/mpi-standard/settings

Repository Setting Page

Edit the name of your repository in the name box. Change it to something that is an obvious backup name so you remember which one to delete later (e.g. mpi-standard-bak).

Repository Rename

Create New GitHub Fork

At this point, the mpi-forum/mpi-standard repository will be public so you can fork a new version of the repository and put everything back. Click the "Fork" button in the top right corner:

Repository Fork Button

You will probably get a pop up box asking where you want to fork the repository. You probably want to click on your username. It's possible that you won't see a pop up box at all (if you're not part of any other organizations).

Once that's done and you can see the new copy of the repository with your username in the top right corner again, you're ready to put your data back.

Push Branches Back to GitHub

Pushing the branches back to GitHub is a few simple steps. Go back to the place on your laptop that you cloned the repository and add a new Git remote:

$ cd /path/to/mpi-standard
$ git remote -v

You should have two things that show up in that list:

origin	https://github.com/<your_username_here>/mpi-standard.git (fetch)
origin	https://github.com/<your_username_here>/mpi-standard.git (push)

That should be the same address as your new GitHub repository (unless you changed the name manually). So now you should be able to push all of the data you used to make a local copy back up to the GitHub servers:

$ git push --mirror origin

To confirm that your branches are all present, you can go back to your branch list:

https://github.com/<your_username_here>/mpi-standard/branches

It should look just like it did before.

Re-create Pull Requests

Now all you have to do is recreate your pull requests. You can do this on the same page that you view all of your branches:

https://github.com/<your_username_here>/mpi-standard/branches

For each branch that you need to need to turn into a pull request (refer to your notes from earlier), click the "New pull request" button next to it:

New Pull Request Button

You should see the familiar web page to create a pull request from the branch you chose. You'll need to make sure that the "base repository", "base", and "head repository" fields at the top of the page matches your notes from before. Specifically, make sure you have the right bases as there could be lots of options there and you want to use the correct branch for your pull request:

Pull Request Bases

If you created the pull request against the main MPI Forum repository, the "base repository" field" should say "mpi-forum/mpi-standard". If you were using a working group for internal discussion, you'll need to change it to point to the correct working group (e.g. "mpiwg-ft/mpi-standard").

Now you'll need to update the links for any issues to point to the new pull request. Start by putting a link in your new pull request description to say where the original pull request was located so people can find old discussions there if necessary. Then go to any issues that are linking to this pull request. You can find those by scrolling down through the page and looking for links that look like this:

Open Issue Links

Click on those links and find the reference to the PR number. I recommend editing any descriptions or comments (that you're allowed to edit) to change references to the old PR to point to the new PR, but you're welcome to just add a comment in the description at the top to point to the new place (if you think people will see that). To edit a description or comment, click the three dots in the top right corner of each box of text and go to "Edit".

Text Edit Button

If there is no button that says Edit, you don't have permission to do that and you'll just need to change the description or add a comment at the bottom of the issue to point people to the new location. If you ask me (Wes) to help, I can help edit these things since I have permission to do so.

Once you've done this for each of your pull requests, you should be all done. It's not necessary to do this for closed pull requests since those branches could have been deleted anyway. Just worry about the open ones.

Delete Current GitHub Fork

This is the scary part, but if you did both things above, you'll have all of your data in it's new location so nothing will be lost. Also, I've made a backup of everyone's repository who appears on this page as of 2020-02-18, so in the worst case, I (Wes) have your data.

If you had anything else in your GitHub repository that I haven't covered above (e.g. wiki pages, issues, etc.), you'll need to preserve those yourself since I don't think anyone actually does use those on their private forks. If you don't know what do to for that, ask me and I can help you.

Go to your repository's setting page:

https://github.com/<your_username_here>/mpi-standard/settings

Repository Setting Page

Scroll all the way down to the red box labeled "Danger Zone" and click on "Delete this repository".

Repository Delete Button

Type in the name of your repository (bold text in the pop up window) and click the button. Your GitHub repository is now gone, but fear not! All of your repository data is on your laptop and your pull request list is in your notebook. Now we'll put them all back in GitHub.

If you have any questions, ask me (Wes Bland) and I can help out. Good luck!