WELLlabs / JaltolAPI

MIT License
0 stars 0 forks source link

Code cleanup for easier collaboration #5

Open bprashanth opened 1 month ago

bprashanth commented 1 month ago

Block upstream main from pushes

$ git remote set-url --push upstream blocked_for_push

Check your remotes

$ git remote -v


Rebasing and syncing 

$ git checkout main $ git fetch upstream && git rebase upstream/main $ git checkout -b feature_foobar

make your changes on the feature_foobar branch


Creating a pr 

$ git add your_file $ git commit $ git push -f feature_foobar


Visit your fork https://github.com/$user/JaltolAPI
Click the Compare & Pull Request button next to your feature_foobar branch.
This will create a pull request, assign it to someone for code review

The reason I prefer this flow to multiple branches in the main repo is because it gives you one single branch to focus on. Keep that branch green with ci/cd and force the PR author to debug failing tests pre-checkin. 

- Move to docker for easier deployment

This should be easy since you're already using venv. 
It will reduce the barrier to entry for contributors. 
I think you'd mentioned already using docker in your staging, just checkin the dockerfile.
That way contributors won't have to deal with versions of node/npm/react/python/django etc etc. 
You can also use the same dockerfile in ci/cd. 
bprashanth commented 1 month ago

Looks like you already have a dockerfile, maybe just update your installation instructions on how to run / access the api via that in addition to the existing venv setup

https://github.com/WELLlabs/JaltolAPI/blob/main/Dockerfile

I think just a docker run with -p to map ports should work right? Actually also map the host volume, so one can preserve data between runs. Configs are also a common thing to mount, so you can eg check in some dev keys/config files and mount those on local runs vs mount a prod file at deployment time.