| slug | /contributing/git-and-pr-workflow |
|---|---|
| title | Git & Pull Request Workflow |
| description | SoroScan Git workflow, branch management, commit rules, and PR review standards. |
| sidebar_label | Git & PR Workflow |
| hide_title | false |
We use a collaborative workflow to maintain the stability and history of the SoroScan codebase. This guide explains our branch conventions, commit formatting, and code review procedures.
SoroScan maintains a simple and robust branching strategy.
gitGraph
commit id: "v1.0.0" tag: "v1.0.0"
branch develop
checkout develop
commit id: "chore: init develop"
branch feat/add-websocket
checkout feat/add-websocket
commit id: "feat: setup ws structure"
commit id: "feat: connect client"
checkout develop
merge feat/add-websocket
checkout main
merge develop id: "v1.1.0" tag: "v1.1.0"
main: Represents production-ready code. Commits here must be stable and tested. Releases are tagged from this branch.develop: The primary integration branch. All feature branches are merged here first before being promoted tomain.- Feature Branches (
feat/*,fix/*,docs/*,refactor/*): Created by developers to work on isolated features or fixes. Always create feature branches fromdevelop(ormainfor critical hotfixes).
We enforce the Conventional Commits specification. This allows automated changelog generation and semantic versioning.
<type>(<scope>): <description>
[optional body]
[optional footer(s)]
feat: A new feature for the user or system (maps to a MINOR version bump).fix: A bug fix (maps to a PATCH version bump).docs: Changes to documentation only.style: Formatting changes, missing semi-colons, etc.; no code logic changes.refactor: Code changes that neither fix a bug nor add a feature.perf: A code change that improves performance.test: Adding missing tests or correcting existing tests.chore: Maintenance, package dependencies, tool configurations.
If a commit introduces a breaking change, append a ! to the type or add BREAKING CHANGE: in the footer.
feat(api)!: remove deprecated REST endpoint for events
feat(ingest): support parallel streaming of event logs
fix(sdk-python): retry on 503 Service Unavailable errors
docs: update deployment credentials setup guide
Do not use merge commits to pull changes from develop into your feature branch. Instead, use git rebase to keep a linear history.
git fetch upstream
git checkout feat/your-feature
git rebase upstream/developIf you encounter conflicts during rebase, resolve them, then run git rebase --continue.
- Prohibited: You must never force push (
git push -f) to shared public branches likemainordevelop. - Permitted: You may force push to your own personal fork's feature branch (
git push --force-with-lease) to clean up commits during a rebase.
When merging a Pull Request into develop or main, we use Squash and Merge. This squashes all your feature commits into a single commit with a clean Conventional Commit title.
Only cherry-pick when backporting a bug fix from develop to a release branch for an emergency patch.
git checkout release-v1.1
git cherry-pick <commit-hash-from-develop>Before opening a PR, ensure:
- All local unit tests pass.
- Code style checks (lint/fmt) pass.
- Your branch is rebased on the latest
develop.
When opening a PR, fill out the template carefully:
- Title: Must follow Conventional Commits (e.g.
feat(graphql): add sorting arguments to events query). - Description: Add summary of changes, motivation, test steps, and links to issues (
Closes #123).
- Automated CI Checks: All PRs trigger a GitHub Actions workflow. The tests, lints, and build steps must pass (green status) before merging.
- Reviews: At least one review approval from a core maintainer is required.
- Address Comments: Reply to each thread. If you make a code change, push it to your feature branch; the PR will automatically update.
- Do Not Resolve Threads: Only the reviewer who asked the question should mark the conversation as resolved once they are satisfied.
If you are reviewing another contributor's PR, use these guidelines:
- Approve: If the code is functionally correct, matches the style guide, is covered by tests, and has no performance regressions. (Minor style comments can be left as non-blocking suggestions).
- Request Changes: If there are syntax errors, missing test coverage, performance bottlenecks (like N+1 queries), security concerns, or architectural misalignment.
SoroScan uses Squash and Merge on GitHub.
- Ensure the commit message is formatted correctly before completing the merge.
- Delete the feature branch after a successful merge to keep the repository clean.