Skip to content

Latest commit

 

History

History
78 lines (71 loc) · 4.07 KB

CONTRIBUTING.md

File metadata and controls

78 lines (71 loc) · 4.07 KB

Contributing to PIXL.

👍🎉 First off, thanks for taking the time to contribute! 🎉👍

When contributing to this repository, please first discuss the change you wish to make via issue, instant message in clara-agx chatbox, or any other method with the owners of this repository before making a change. Please note we have a code of conduct, please follow it in all your interactions with the project.

:octocat: Setting up project locally.

  1. Generate your SSH keys as suggested here
  2. Clone the repository by typing (or copying) the following lines in a terminal
git clone [email protected]:SAFEHR-data/PIXL.git

New issues

  flowchart TD;
      Z[Bug Reported] -->A[...];  
      A[Bug resolution] -->B(Testing OK?);
      B--Yes-->C[Prepare commit];
      B--No-->D[Reopen issue];
      D----> A[Bug resolution];
      C ----> E[Request Review];
      E ----> F[Commit changes];
      F --> H[Merge PR and close issue]
Loading

Committing and pushing changes

The following commands are typed or copied via command line. Altenatively, you can use the features of your integrated development environment (pycharm, code, vim, etc).

  1. Clone this repo
git clone [email protected]:SAFEHR-data/PIXL.git
  1. Create new branch {FEATURE_BRANCH_NAME} using issue number {ISSUE_NUMBER}
git checkout -b ISSUE_NUMBER-FEATURE_BRANCH_NAME #(e.g. `git checkout -b 422-my-feature-branch`)
  1. Commit changes and push to your branch
git add .
git commit -m 'short message #ISSUE_NUMBER' #(e.g. git commit -m 'adding a message to my feature branch #422' 
git push origin ISSUENUMBER-branch-name
  1. Submit a Pull Request against the main branch.

Pull Request (PR) and merge to main branch

  1. Select branch that contain your commits.
  2. Click Compare and pull request and create PR for the associated branch.
  3. Type a title and description of your PR and create PR
  4. Please keep your PR in sync with the base branch. It is recommended that you use Squashing and merging a long-running branch. Otherwise, you have the option to rebase your {ISSUE_NUMBER-FEATURE_BRANCH_NAME} branch with the base branch (e.g. main).
git checkout main
git pull origin main
git checkout ISSUE_NUMBER-FEATURE_BRANCH #(e.g. git checkout 422-my-feature-branch)
git fetch
git merge main
git push --force origin FEATURE_BRANCH
  1. Run pre-commit run -a to tidy up code and documentation (this is also tested in CI).
  2. If you are developing in your local host, please check that your code is properly tested with pytest (this is also tested in CI).
  3. Request a PR review. See collaborating-with-pull-requests for further details.
  4. Once your PRs has been approved, procced to merge it to main. See Merging a pull request
  5. Delete and remove your merged branch
    9.1 You can navigate branches in https://github.com/SAFEHR-data/PIXL/branches and removed merged branches by clickling 🗑️ icon.
    9.2 Alternatively, you can delete your local and merged branches using the following commands:
#Local git clear
git branch --merged | grep -v '\*\|master\|main\|develop' | xargs -n 1 git branch -d
#Remote git clear
git branch -r --merged | grep -v '\*\|master\|main\|develop' | sed 's/origin\///' | xargs -n 1 git push --delete origin