Skip to content

09. Contributing to the main DSpace project

alawvt edited this page Jun 25, 2019 · 2 revisions

Request a DuraSpace account

Write sysadmin @ duraspace.org to request a DuraSpace account. Once created, your account will allow you to report issues in the DSpace Jira issue tracker and make changes on the DSpace wiki.

Submit an issue

Create a ticket in the DSpace Issue Tracker.

Contribute to the DSpace Wiki

Simple contribution

You can add a comment on the relevant page of the wiki.

Larger contribution

Follow the Documentation Editing Guidelines. Add changes to wikis for both DSpace 5 and 6.

Contribute code changes

If you make a code change that you would like to contribute back to the main project, create or reopen an issue and label it (or ask for it to be labeled) "dspacecore." Issues in the VTechWorks GitHub repository labeled "dspacecore" have been earmarked for contribution to the main DSpace project.

Be sure to follow the Code Contribution Guidelines. The DSpace project prefers that you submit the code change as a pull request in the GitHub DSpace project. Read Development with Git.

Note: To match the instructions in DSpace Development with Git, I have renamed the remotes and matched the step numbering in that guide!

If you need to rename your remotes, use the command,

git remote rename oldname newname
  1. Fork the GitHub DSpace project in your own GitHub account. For instance, mine is at https://github.com/alawvt/DSpace.

  2. Clone your GitHub DSpace fork to your local machine.

git clone [email protected]:[your-username]/DSpace.git dspace-src
cd dspace-src
  1. To keep your fork up-to-date with DSpace main, create another remote called upstream.
git remote add upstream https://github.com/DSpace/DSpace.git

Check:

-bash-3.2 ~/GitHub/vtlibans_dspace/dspace > git remote -v
dspace-src	https://github.com/alawvt/DSpace.git (fetch)
dspace-src	https://github.com/alawvt/DSpace.git (push)
origin	[email protected]:VTUL/vtechworks.git (fetch)
origin	[email protected]:VTUL/vtechworks.git (push)
upstream	https://github.com/DSpace/DSpace.git (fetch)
upstream	https://github.com/DSpace/DSpace.git (push)

Fetch changes from DSpace main

git fetch upstream

To keep your local master branch up-to-date with the main DSpace repository, fetch and merge changes from DSpace main

git fetch upstream
git checkout master
git merge upstream/master

To keep your GItHub fork up-to-date with the main DSpace repository, next push master to your fork

git push dspace-src master
# If the 'fetch' above pulled down new tags/branches, you also may wish to run the following to push those to your own repo.
git push dspace-src --all

We have been making our changes to the 5_x branch. The main DSpace project prefers pull requests off the master branch.

For VTechWorks, we often make changes in the dspace/modules/ directory to overlay standard DSpace files. To contribute to the main DSpace project, make the corresponding change directly to the overlaid files.

Example: For VTechWorks, a change was made to dspace/modules/xmlui/src/main/resources/aspects/Discovery/i18n/messages.xml. To contribute this to main DSpace, instead change dspace-xmlui/src/main/resources/aspects/Discovery/i18n/messages.xml.

If a change was made in a theme for VTechWorks, then, for main DSpace, the corresponding change will need to be made in the file that was overlaid.

Example: For VTechWorks, a change was made to dspace/modules/xmlui-mirage2/src/main/webapp/themes/vtmirage2/xsl/aspect/artifactbrowser/item-list.xsl. To contribute this to main DSpace, instead change dspace-xmlui-mirage2/src/main/webapp/xsl/aspect/artifactbrowser/item-list.xsl.

The following procedure assumes that you will create a feature branch, submit to the VT project, then submit it to the DSpace project. If you are working on an existing DSpace issue and not contributing to VT, skip to step 4.

Create a feature branch locally off the vt_5_x_dev branch, develop and commit changes. Don't merge the branch.

git checkout vt_5_x_dev  
git checkout -b great_change
(develop code)

Create a pull request in the VTUL/vtechworks vt_5_x_dev branch for this branch to contribute it to our local project.

git push --set-upstream origin great_change 

Go to the VT project on GitHub and follow the instructions to create a pull request to add the feature branch to vt_5_x_dev.

Create an issue in the main [DSpace issue tracker](Code Contribution Guidelines). For this example, let the issue be DS-123.

  1. Check out the 'master' branch, then pull the latest code from the DSpace main project, then create a new branch off the master branch that uses the DSpace Jira issue number as its name, as specified in the DSpace Code Contribution Guidelines.
git checkout master
git pull upstream master
git checkout -b DS-123

Recreate the changes you made on your great_change branch on your DS-123 branch.

Alternatively, you can move commits from great_change branch to DS-123 branch with the "cherry-pick" command. First, use "git log" to find the commit number(s). Write them down! Then, check out the new branch and "cherry-pick" the commits you want to move to the new branch.

git checkout great_change
git log
git checkout DS-123
git cherry-pick d1c4b9

Commit feature changes with a good message

  1. Push changes to your GitHub fork of the DSpace repository
git push --set-upstream dspace-src DS-123
  1. Submit a pull request in the main DSpace project master branch for this branch.

seem optional additional steps in https://wiki.duraspace.org/display/DSPACE/Development+with+Git

Go to the DSpace project on GitHub and follow the instructions to create a pull request to add the feature branch from your GitHub fork to the master branch of the DSpace project.

Related

DSpace Technical Support Google Group
DSpace Stack Overflow