Skip to content

OFI Cray libfabric recommended workflow and policies

Sung-Eun Choi edited this page Mar 20, 2015 · 12 revisions

OFI Cray libfabric recommended workflow and policies

This wiki page documents the recommended workflow and policies we will be using in the libfabric-cray repository.

The first thing to note is that we have renamed the repository after forking ofiwg/libfabric to be libfabric-cray. We did this primarily to aid developers with keeping their repositories straight, since only GNI-specific work will be merged to this fork. The other reason is that the subject line for the github notification emails are prefixed with the repository name only, which makes things confusing if you get notifications from ofiwg/libfabric also. There is currently no way to configure the subject line (though the nice people at github have put in a feature request).

General policies

As mentioned above, for the most part only changes in the prov/gni directory should be merged to master. Notable exceptions are the changes needed to build the GNI provider, which need to be made in the top level makefile template and a couple of provider-independent source files. All other work should should go directly to ofiwg/libfabric.

All merges will be done via github reviewed pull requests. More on that below.

Workflow

This section documents the suggested workflow. There are probably a few different ways to do the same thing, but this should give you an idea.

Getting set up

See https://help.github.com/articles/fork-a-repo/ for more detailed directions on how to fork, clone and set up a remote.

If you have not already forked ofiwg/libfabric, use the github interface to fork the repository under your account (Fork link near the top left of the repository pages). You can fork either ofiwg/libfabric or ofi-cray/libfabric-cray (you cannot fork both). You will need to manage your remotes when changing between the two.

Next, make a local clone of the repository. You can either do this from github from the side bar of your forked repository or via the command line.

Finally, set up your remotes, i.e.,the remote repositories you'll be interacting with. You can set up any number of distinct upstream remotes, for example ofiwg and ofi-cray.

    % git remote add ofi-cray https://github.com/ofi-cray/libfabric-cray
    % git remote add ofiwg https://github.com/ofiwg/libfabric

If you don't think you'll contribute to or merge from ofiwg, you can skip that one.

General development

In general, you should do work in branches off of your fork. One notable exception is when merging changes from the upstream ofiwg repository, but this is done nightly by a jenkins job so most people shouldn't have to worry about it. There's a lot out there about working with branches, so no need to repeat it here, but here's a typical workflow:

    % git checkout master
    % git fetch ofi-cray              # fetch the latest from ofi-cray
    % git checkout ofi-cray/master    # check out this (remote) branch (this gives you a "detached HEAD")
    % git merge ofi-cray/master       # merge latest from ofi-cray (fast-forward, i.e., without local commits)
    % git checkout -b my-new-branch   # create and checkout a new branch

There is a lot of info out there on fetching, merging, committing, etc. so no need to repeat it here.

Pull requests

Pull requests are a github-specific feature to share your changes with others for discussion. As policy, we will require a pull request for every merge, reviewed by at least one other person.

These articles on pull request cover most of what you need to know:

The only slightly tricky part is the destination repository. Make sure it's pointing at the correct master (ofiwg/libfabric or ofi-cray/libfabric-cray) depending on where you want to merge your commits.

Use an @mention in the pull request text to ask for a review from a particular person (setting the Assignee doesn't send a notification to that person).

We've decided to take a loose stance on squashing and rebasing. Having multiple commits per pull request is reasonable when it makes sense, but things like commits that fix type-os or small changes to logic should be squashed. We may revisit this policy later.

Issue tracking

Any fix or feature should have an associated github issue opened for it. This will enable us to better track tasks, as well as making tasks available to all developers. When you pick up a task, make yourself the Assignee. When a pull requests closes an issue, mention it in the merge message and the issue will automatically be closed.

Other Policies

OFI WG has decided to adopt the Linux coding standard. You can perform an automatic check of your patch using a pre-commit hook available here. You will need to download the Linux patch checker. See the comments at the top of the script for details. If you do not already have a pre-commit hook, put the contents of this script into a file called pre-commit in the directory libfabric-cray/.git/hooks. Otherwise, just call this script from your existing pre-commit script.

OFI WG requests that all commits contain a Signed-Off-By line. You can check for this by using the sample commit message hook in libfabric-cray/.git/hook/commit-msg.sample. Just copy that to a file called commit-msg in the same directory and it will check that every commit message contains a Signed-Off-By line.

If either of these checks fail, your commit will fail.

Copyrights

As per your organization's policies, your organization's copyright can be added at the top of any source file that you touch. Using a pre-commit script to check for that is also useful.

Recommended Reading