Thank you for your interest in contributing to Hardn! This document outlines the process for contributing to the project and provides guidance on development workflow, code standards, and the release process.
- Development Setup
- Development Workflow
- Code Style
- Pull Request Process
- Release Process
- Issue Reporting
-
Fork and clone the repository
git clone https://github.com/abbott/hardn.git cd hardn -
Install dependencies
go mod download
-
Verify the setup
make test make build -
Ensure you're in development mode
make restore-dev
This adds a
replacedirective to your go.mod file that points to your local version of the code for development.
-
Create a new branch for your feature or bugfix
git checkout -b feature/your-feature-name # or git checkout -b fix/your-bugfix-name -
Make your changes and write tests
-
Run tests to ensure everything works
make test -
Build the project
make build
-
Commit your changes with clear commit messages
git add . git commit -m "type: description of your change"
Commit message types:
feat,fix,docs,style,refactor,test,chore,build
- Follow standard Go code style guidelines and idiomatic Go
- Use
gofmtorgoimportsto format your code - Write comprehensive comments and documentation
- Aim for clear, readable, and maintainable code
- Include tests for new functionality
-
Update your fork with the latest changes from the main repository
git remote add upstream https://github.com/abbott/hardn.git git fetch upstream git merge upstream/main
-
Push your branch to your fork
git push origin your-branch-name
-
Create a pull request
- Go to the Hardn repository
- Click "New Pull Request"
- Choose your fork and the branch you created
- Fill in the PR template with details about your changes
-
Address review feedback
- Make additional commits to address feedback
- Keep the PR focused on a single change
-
Your PR will be merged once approved
Hardn follows semantic versioning (MAJOR.MINOR.PATCH) and uses a specific workflow to manage releases.
During development, we use a replace directive in go.mod to point to the local code:
replace github.com/abbott/hardn => ./
For releases, this directive must be removed to ensure users get the correct version from the Go module proxy.
-
Bump the version (choose one based on the changes):
make bump-patch # For bug fixes and minor changes make bump-minor # For new features make bump-major # For breaking changes
-
Prepare for release (removes the replace directive):
make prepare-release
-
Create a release:
make release
This will:
- Run tests
- Build for all target platforms
- Create archives
- Generate checksums
- Tag the release
- Push the tag
-
Return to development mode:
make restore-dev
When a new tag is pushed, GitHub Actions will automatically:
- Remove the replace directive
- Build release artifacts
- Create a GitHub release
- Publish packages
To create distribution packages:
# Create a Debian package
make deb
# Create an RPM package
make rpmNote: This requires the fpm tool to be installed.
- Use the GitHub issue tracker to report bugs
- Provide detailed reproduction steps
- Include your environment details (OS, Go version, etc.)
- For security vulnerabilities, please email
641138+abbott@users.noreply.github.cominstead of creating a public issue.
Thank you for contributing to Hardn! Your efforts help make this tool better for everyone.