The Dataverse Project uses git for version control and GitHub for hosting. On this page we’ll explain where to find the code, our branching strategey, advice on how to make a pull request, and other git tips.
Contents:
The main Dataverse code at https://github.com/IQSS/dataverse but as explained in the Introduction section under “Related Projects”, there are many other code bases you can hack on if you wish!
The goals of the Dataverse branching strategy are:
We follow a simplified “git flow” model described at http://nvie.com/posts/a-successful-git-branching-model/ involving a “master” branch, a “develop” branch, and feature branches such as “1234-bug-fix”.
The “master” branch represents released versions of Dataverse. As mentioned in the Making Releases section, at release time we update the master branch to include all the code for that release. Commits are never made directly to master. Rather, master is updated only when we merge code into it from the “develop” branch.
The “develop” branch represents code that was stable enough to merge from a “feature” branch (described below) and that will make it into the next release. Like master, commits are never made to the develop branch. The develop branch is where integration occurs. Your goal is have your code merged into the develop branch after it has been reviewed.
Feature branches are used for both developing features and fixing bugs. They are named after the GitHub issue they are meant to address, so create a GitHub issue if you need to.
“3728-doc-apipolicy-fix” is an example of a fine name for your feature branch. It tells us that you are addressing https://github.com/IQSS/dataverse/issues/3728 and the “slug” is short, descriptive, and starts with the issue number.
Pull requests take all shapes and sizes, from a one-character typo fix to hundreds of files changing at once. Generally speaking, smaller pull requests are better so that they are easier to code review. That said, don’t hold back on writing enough code or documentation to address the issue to the best of your ability.
If you are writing code (rather than documentation), please see Testing for guidance on writing tests.
The example of creating a pull request below has to do with fixing an important issue with the Documentation but applies to fixing code as well.
For guidance on which issue to work on, please ask! Also, see https://github.com/IQSS/dataverse/blob/develop/CONTRIBUTING.md
Let’s say you want to tackle https://github.com/IQSS/dataverse/issues/3728 which points out a typo in a page of Dataverse’s documentation.
If you tell us your GitHub username we are happy to add you to the “read only” team at https://github.com/orgs/IQSS/teams/dataverse-readonly/members so that we can assign the issue to you while you’re working on it. You can also tell us if you’d like to be added to the Dataverse Community Contributors spreadsheet and the Dev Efforts by the Dataverse Community spreadsheet.
Always create your feature branch from the latest code in develop, pulling the latest code if necessary. As mentioned above, your branch should have a name like “3728-doc-apipolicy-fix” that starts with the issue number you are addressing, and ends with a short, descriptive name. Dashes (“-”) and underscores (“_”) in your branch name are ok, but please try to avoid other special characters such as ampersands (“&”) than have special meaning in Unix shells.
Making a commit (or several commits) to that branch. Ideally the first line of your commit message includes the number of the issue you are addressing, such as Fixed BlockedApiPolicy #3728
.
Push your feature branch to your fork of Dataverse. Your git command may look something like git push origin 3728-doc-apipolicy-fix
.
Make a pull request to get approval to merge your changes into the develop branch. Feedback on the pull request template we use is welcome! The “connects to #3728” syntax is important because it’s used at https://waffle.io/IQSS/dataverse to associate pull requests with issues.
Here’s an example of a pull request for issue #3728: https://github.com/IQSS/dataverse/pull/3827
Now that you’ve made your pull request, your goal is to make sure it appears in the “Code Review” column at https://waffle.io/IQSS/dataverse
Look at https://github.com/IQSS/dataverse/blob/master/CONTRIBUTING.md for various ways to reach out to developers who have enough access to the GitHub repo to move your issue and pull request to the “Code Review” column.
Unfortunately, pull requests can quickly become “stale” and unmergable as other pull requests are merged into the develop branch ahead of you. This is completely normal, and often occurs because other developers made their pull requests before you did.
The Dataverse team may ping you to ask you to merge the latest from the develop branch into your branch and resolve merge conflicts. If this sounds daunting, please just say so and we will assist you.
If you’d like to resolve the merge conflicts yourself, here are some steps to do so that make use of GitHub Desktop and Netbeans.
In GitHub Desktop:
In Netbeans:
In GitHub Desktop:
In GitHub Issues:
Previous: Troubleshooting | Next: Testing