Welcome to the ProxOrchestrator project. This guide explains how we work together as a team using Git and GitHub. Read this before you start writing any code.
We use a workflow called Gitflow. Think of it like this:
main ← what the public downloads and uses
↑
dev ← where we test finished features together
↑
feature/your-feature ← where you do your work
hotfix/your-fix ← for urgent fixes only - cloned off main then pulled into main then pushed into dev and bellow
bugfix/your-fix ← for bug fixes that don't impact the working functionality - cloned off of dev, pulled into dev then pushed into main at next release cycle, merge bellow for existing branches
cleanup - After a feature, hotfix, bugfix is validated and approved the branch should be deleted and any new features or bugfixes are cloned off of dev. Do not allow branches to go stale
The key rule is simple:
Nobody writes code directly in
devormain. Ever.
All work happens in a branch you create. When you are done, you ask for it to be reviewed before it gets merged in.
- This is the public release branch. Users clone and pull from here.
- Only receives merges from
devafter testing is complete. - You cannot push directly to
main. A pull request is required.
- This is the testing branch. After a feature is reviewed and approved, it lands here first.
- We test on the test server after each merge into
dev. - When
devis stable and ready for release, it gets merged intomain. - You cannot push directly to
dev. A pull request is required.
- This is where all new features are built.
- Always created from
dev. - When done, a pull request is opened targeting
dev. - Naming examples:
feature/lxc-supportfeature/password-resetfeature/job-cancellation
- Used only when there is a bug in
mainthat needs fixing right now. - Always created from
main(notdev) because the bug is in production. - When done, a pull request is opened targeting
main. - After it merges to
main, it must also be merged back intodevso the fix is not lost. - Naming examples:
hotfix/cpu-type-defaulthotfix/login-redirect-loop
You only need to do this once.
git clone git@github.com:ForgedIO/ProxOrchestrator.git
cd ProxOrchestratorgit remote -vYou should see origin pointing to github.com:ForgedIO/ProxOrchestrator.git. If not, add it:
git remote add origin git@github.com:ForgedIO/ProxOrchestrator.gitgit config --global user.name "Your Name"
git config --global user.email "you@example.com"Before you create a new branch, always pull the latest dev first. This way your new branch starts from the most current code.
git checkout dev
git fetch origin
git pull origin devgit fetch checks what has changed on GitHub without touching your local files. git pull then downloads and applies those changes.
git checkout -b feature/your-feature-nameThis creates a new branch and switches you to it. You are now working in your own space and cannot affect dev or main.
Work normally. Save files, test your work, repeat.
A commit is a save point. Do this often — at least once a day, and any time you finish a piece of work.
git add apps/yourapp/views.py templates/yourapp/page.html
git commit -m "Add container detail view with CPU and memory stats"Tips for good commit messages:
- Write what the change does, not what you did. "Add cancel button to dashboard" not "I added a cancel button."
- Keep it short — one line under 72 characters.
- If you need to explain more, leave a blank line and add detail below.
git push origin feature/your-feature-nameDo this at the end of each day. It backs up your work and lets the team see your progress.
If you are working on a feature for more than a day or two, changes will land in dev that you do not have yet. You need to pull those in regularly to avoid a big messy merge at the end.
Do this at least every couple of days:
# Save your current work first
git add .
git commit -m "WIP: work in progress"
# Pull dev into your branch
git fetch origin
git merge origin/devIf Git reports a conflict (two people edited the exact same lines), see the Resolving Conflicts section below.
Push your branch again after:
git push origin feature/your-feature-nameWhen your feature is finished and tested locally, open a pull request on GitHub.
git push origin feature/your-feature-nameOpen https://github.com/ForgedIO/ProxOrchestrator in your browser.
GitHub will usually show a yellow banner saying your branch was recently pushed with a "Compare & pull request" button. Click it.
If you do not see the banner:
- Click the "Pull requests" tab
- Click "New pull request"
- Set base to
devand compare to your feature branch
- Title — short description of what this does. Example:
Add job cancellation for import pipeline - Description — explain what you built and why. List any important decisions you made. Mention if there are any known issues or things the reviewer should look at closely.
- Check the target branch is
dev(notmain)
The reviewer (currently Chris) will read through your code on GitHub and either:
- Approve it — you can merge
- Request changes — make the changes, push again, the PR updates automatically
Once approved, the reviewer will merge it into dev. You do not need to do anything.
After the merge, update your local dev:
git checkout dev
git pull origin devYour feature branch is no longer needed. You can delete it:
# Delete it locally
git branch -d feature/your-feature-name
# Delete it on GitHub
git push origin --delete feature/your-feature-nameA hotfix is only for bugs that are broken in main right now and cannot wait for the normal feature process.
git checkout main
git pull origin main
git checkout -b hotfix/description-of-buggit add apps/affected/file.py
git commit -m "Fix CPU type default causing VM boot failure"
git push origin hotfix/description-of-bug- One targeting
main— for the immediate fix - One targeting
dev— so the fix does not get lost when dev eventually merges to main
git checkout dev
git pull origin dev
git checkout main
git pull origin mainA conflict happens when you and someone else edited the exact same lines of the same file. Git cannot decide which version to keep so it asks you to choose.
You will see this message:
CONFLICT (content): Merge conflict in apps/importer/views.py
Automatic merge failed; fix conflicts and then commit the result.
Look for the conflict markers Git added:
<<<<<<< HEAD
cpu_type = vm_config.get("cpu_type", "host")
=======
cpu_type = vm_config.get("cpu_type", "x86-64-v2-AES")
>>>>>>> origin/devEverything between <<<<<<< HEAD and ======= is your version.
Everything between ======= and >>>>>>> is the other version.
Delete the conflict markers and keep what is correct. In this example we want host:
cpu_type = vm_config.get("cpu_type", "host")git add apps/importer/views.py
git commit -m "Merge origin/dev — resolve cpu_type conflict"Stop. Message Chris before you guess. A wrong resolution is worse than a delay.
These commands help you understand the state of your work at any time.
# What branch am I on? What files have I changed?
git status
# What exactly did I change in each file?
git diff
# History of commits on this branch
git log --oneline
# See all branches (local and remote)
git branch -a
# See what is on GitHub without changing anything local
git fetch origin
git status- Never commit directly to
devormain. - Always pull the latest
devbefore starting a new branch. - Pull
devinto your feature branch every couple of days. - Push your branch to GitHub at the end of every working day.
- One feature per branch. Do not mix two unrelated features in one branch.
- Tell Chris before you merge. A quick message — "merging now" — prevents both of you touching the same thing at the same time.
- If something feels wrong, ask before you push.
# Start a new feature
git checkout dev && git pull origin dev
git checkout -b feature/my-feature
# Save your work
git add path/to/file.py
git commit -m "What this change does"
git push origin feature/my-feature
# Keep your branch current
git fetch origin
git merge origin/dev
git push origin feature/my-feature
# After your PR is merged
git checkout dev && git pull origin dev
git branch -d feature/my-feature
git push origin --delete feature/my-feature
# Emergency hotfix
git checkout main && git pull origin main
git checkout -b hotfix/the-problem
# fix, commit, push, open PR to main AND devIf you are not sure about something, ask before you act. A wrong push to main or a bad merge is much harder to fix than a question is to ask.