Thank you for your interest in contributing to CipherSwarm! We appreciate your efforts and value your time. This guide will help you understand how to contribute effectively to the project.
To get started with contributing to CipherSwarm, you'll need to:
- Fork the repository from CipherSwarm.
- Clone your fork to your local machine:
git clone https://github.com/your-username/CipherSwarm.git
- Set up the project dependencies:
bundle install
We use the Gitflow workflow to manage our development process. Here’s a brief overview:
-
Main Branches:
main
: This is the production branch. All releases are made from this branch.develop
: This is the main development branch where the latest development changes are merged.
-
Supporting Branches:
feature/*
: Feature branches are used to develop new features. They branch off fromdevelop
and are merged back intodevelop
when complete.release/*
: Release branches support the preparation of a new production release. They branch off fromdevelop
and are merged into bothdevelop
andmain
.hotfix/*
: Hotfix branches are used to patch production releases quickly. They branch off frommain
and are merged back into bothdevelop
andmain
.
To simplify the Gitflow workflow, you can use the git-flow
tools. First, ensure you have git-flow
installed:
-
macOS: Install via Homebrew
brew install git-flow
-
Windows: Install via chocolatey
choco install gitflow-avh
-
Linux: Install via your package manager
sudo apt-get install git-flow
-
Feature Branches:
- Start a new feature:
git flow feature start your-feature-name
- Finish the feature (this will merge it into
develop
and delete the feature branch):git flow feature finish your-feature-name
- Start a new feature:
-
Release Branches:
- Start a new release:
git flow release start your-release-name
- Finish the release (this will merge it into both
main
anddevelop
, tag the release, and delete the release branch):git flow release finish your-release-name
- Start a new release:
-
Hotfix Branches:
- Start a new hotfix:
git flow hotfix start your-hotfix-name
- Finish the hotfix (this will merge it into both
main
anddevelop
, tag the hotfix, and delete the hotfix branch):git flow hotfix finish your-hotfix-name
- Start a new hotfix:
If you prefer to manage branches manually, you can follow these steps:
-
Feature Branches (
feature/*
):- Rebase: Before merging a feature branch into
develop
, rebase it to ensure a clean, linear commit history.git checkout feature/your-feature-name git rebase develop
- Merge: Once rebased, merge the feature branch into
develop
using a regular merge to capture all commits.git checkout develop git merge feature/your-feature-name
- Rebase: Before merging a feature branch into
-
Release Branches (
release/*
):- Merge: Use a regular merge to integrate changes from the release branch into both
develop
andmain
.git checkout main git merge release/your-release-name git checkout develop git merge release/your-release-name
- Merge: Use a regular merge to integrate changes from the release branch into both
-
Hotfix Branches (
hotfix/*
):-
Merge: Use a regular merge to quickly apply the hotfix to both
main
anddevelop
.git checkout main git merge hotfix/your-hotfix-name git checkout develop git merge hotfix/your-hotfix-name
-
Following these merge strategies ensures that all commits are correctly captured and our commit history remains straightforward.
We use the Conventional Commits specification to streamline our commit messages. This ensures clarity in commit history and helps with automated versioning.
Here are the title maps we use for conventional commits, along with their meanings:
feat
: Features - A new feature for the user.fix
: Bug Fixes - A bug fix for the user.perf
: Performance Improvements - Changes that improve performance.refactor
: Code Refactoring - A code change that neither fixes a bug nor adds a feature.ci
: CI Changes - Changes to our CI configuration files and scripts.docs
: Documentation - Documentation only changes.style
: Style Changes - Changes that do not affect the meaning of the code (white space, formatting, missing semi-colons, etc.).test
: Test Changes - Adding missing tests or correcting existing tests.chore
: Chores - Other changes that don't modify src or test files.Bump
: Dependency Bumps - Updating dependencies.Merge
: Merge Commits - Merging branches.Added
: Added Features - Adding new features.
All contributions must pass the rspec tests before they can be merged. You can run the tests using the rake
command:
- Run the tests:
rake
Make sure all tests pass before submitting your contribution.
When you are ready to submit your changes, follow these steps:
- Push your branch to your forked repository:
git push origin feature/your-feature-name
- Open a pull request (PR) from your branch to the
develop
branch of the main repository.
Please provide a clear and detailed description of your changes in the PR and reference any relevant issues or discussions.
Please note that we have a Code of Conduct. By participating, you are expected to uphold this code.
Thank you for contributing to CipherSwarm! We look forward to your pull requests.