Pushing Galaxy changes to the upstream repo
We should aim to push changes we did in Galaxy to the upstream repository. They have a Contribution Guide, so one should follow that. We copy some information in this document, adjusting it to our working practices.
Before we begin
Ideally, before creating a PR, we should create an issue in their repo to let them know about our intentions and discuss possible solutions (we might also get a hint that this is already implemented in some way or will be implemented soon).
How to create a PR
Create an issue and a branch to push changes
Create an issue in our Gitlab Galaxy project. Add some description of what it is about.
Create a branch for this issue (you can do it from GitLab: go to your issue -> click "Create Merge Request" -> Select Create branch -> use upstream as source)
The upstream is the original branch from the latest Galaxy release (release_22.05 as of now) we started our development from and with which we periodically sync.
Alternatively, you can use the git command (use the issue number in the branch name to link it to the issue)
git checkout -b 33-push-object-store-optimization upstream
Make changes to the new branch
Now we should add changes we want to push. One way is to use git cherry-pick
for specific commits and then
resolve possible conflicts.
git cherry-pick <commit id 1> <commit id 2> <...>
see git cherry-pick --help
for more options.
Once all changes are done, push the changes (add a commit if you had to modify the code manually)
git add -A <root folder>
git commit -m "your commit message relates to the implemented feature"
git push
and check Galaxy works as expected.
To make cherry-picking easier, create reasonable commits when working on code. Use meaningful commit messages and do not put changes related to different features in one commit.
Sync with the latest upstream Galaxy
Now we want to merge our branch with the most recent dev branch in the upstream Galaxy repo.
switch to upstream-dev branch
git checkout upstream-dev
update from the dev branch in upstream Galaxy (configure upstream origin if needed)
git remote add upstream https://github.com/galaxyproject/galaxy
git pull upstream devmerge your issue branch with the updated upstream-dev
git checkout - # to switch back to your branch
git merge upstream-devSome conflicts might need to be resolved. Now our issue branch is the same as dev Galaxy branch + changes we want to push.
Check Galaxy works as expected. Use run.sh script to update dependencies and start Galaxy.
Format files to make sure the linting tests will pass
make format
Prepare a branch in GitHub
Up to this step, we worked in GitLab. But to create a PR, we need a branch in GitHub.
- Create a new branch new_feature in your Github Galaxy repo
- Copy changed files from GitLab to GitHub (you can use
git diff --name-only upstream-dev
to get these files). - Push changes and create a PR in GitHub following Galaxy guide.