-
Notifications
You must be signed in to change notification settings - Fork 33
Contributing
Contributions are very much appreciated, below you'll find some of the workflows.
The quickest way you can get involved with the B2SHARE project is if you report issues! Provide a logic and clear title
and comment
, and tag labels accordingly.
- Goto https://github.com/EUDAT-B2SHARE/b2share and click 'fork' (top right)
Pull-requests can only be made if you've can reference it to an issue issueno
. Discovered a bug? Create an issue/ ticket first! Your fix will be targeted at a specific version of B2SHARE only. The master
branch contains the latest and greatest features, whereas x.x
(currently 1.0) is the latest stable version. Bug fixes found on production, QA or test servers are only pushed to the x.x
branch.
- Make a fork of the
EUDAT-B2SHARE/b2share
project - Create a branch on your project
<targetbranch#issueno-some-desc>
- Goto page https://github.com/EUDAT-B2SHARE/b2share and click green button:
Compare, review, create a pull-requests
- Select base fork:
EUDAT-B2SHARE/b2share
base:<targetbranch>
... head fork:<username>/b2share
compare:<your_branch_name>
- Click
Create pull request
- Add a logic description in the title
- Add a description including issue #no (hrefs will resolve, so issues can be related to issues!)
B2SHARE runs Python, which creates intermediate .pyc
files. When switching branch uncommitted (ignored) files can remain. Before running the server, make sure to remove all .pyc
files first.
NOTE: don't forget to rsync your files to the VM, if you're running Vagrant
cd /path/to/b2share
find . -name "*.pyc" -exec rm -rf {} \;
git branch `<targetbranch#issueno-some-desc>`
Once you have your fork, and local branch, keeping your branches updated is important. After numerous merges your branches can become outdated, and pull-requests are no longer able to automatically-merge, so fetch upstream regularly!
NOTE: before merging upstream, make sure you're on the correct branch locally!
Add remote upstream
Allows git to communicate to the remote git repository.
cd /path/to/your/b2share
git remote add upstream [email protected]:EUDAT-B2SHARE/b2share.git
Update master branch
git checkout master
git fetch upstream
git merge upstream/master
NOTE: when you've got pending commits, an error will be thrown
Update other branches
In this case branch 1.0 is merged, however you can replace this with any branch you want.
git checkout 1.0
git fetch upstream
git merge upstream/1.0
Publishing a branch is meant by pushing a local branch to your remote public repository. Once public, you can make a pull-request from your branch.
git push -u origin `<targetbranch#issueno-some-desc>`
The backend system of B2SHARE (Invenio) has facilities for automated testing. The example below will run all tests.
cd /path/to/b2share
python setup.py test
Python files containing, the code snippet below, are runnable by the test suite.
TEST_SUITE = make_test_suite(...)
if __name__ == "__main__":
run_test_suite(TEST_SUITE)
Targeting a single module can be done with the -s
argument.
# replace `xyz` with module name like: `invenio.testsuite.test_bibauthority`
python setup.py test -s xzy
NOTE: you can only run this within an B2SHARE environment, workon b2share
.