Skip to content

Latest commit

 

History

History
128 lines (85 loc) · 2.54 KB

File metadata and controls

128 lines (85 loc) · 2.54 KB

Contributing to Blnk

Thanks for contributing to Blnk. This guide explains how to get changes merged quickly and safely.

Code of Conduct

By participating in this project, you agree to follow the Code of Conduct.

Ways to Contribute

  • Report bugs and request features through GitHub issues.
  • Improve documentation and examples.
  • Fix bugs, add tests, and ship new features.

Development Prerequisites

  • Go 1.25.0 or newer (this repo requires Go 1.25.0 in go.mod)
  • Docker and Docker Compose
  • PostgreSQL and Redis (you can run both via Docker Compose)

Local Setup

  1. Clone the repository:
git clone https://github.com/blnkfinance/blnk.git
cd blnk
  1. Install dependencies:
go mod tidy
  1. Build the binary:
go build -o blnk ./cmd/*.go
  1. Start required services:
docker compose up -d postgres redis
  1. Run migrations:
./blnk migrate up

Running Tests

  • Fast local test run:
go test -short ./...
  • Full test run:
go test ./...

You can also use:

make test

Coding Guidelines

  • Keep changes focused and minimal.
  • Write or update tests for behavior changes.
  • Run gofmt on changed Go files.
  • Avoid unrelated refactors in feature or bug-fix PRs.
  • Keep public API changes backward-compatible unless clearly intentional.

Database Changes

When your change affects schema or persistence behavior:

  • Add a migration in sql/.
  • Follow the existing migration naming pattern.
  • Include tests that validate the new behavior.

Running CI Locally with act

You can run the GitHub Actions CI pipeline locally using act before pushing:

  1. Install act:
brew install act    # macOS
  1. Make sure Docker is running, then execute the test workflow:
act -W .github/workflows/go.yml

Pull Request Checklist

Before opening a PR, ensure:

  • The branch is rebased on the latest main.
  • go test ./... passes locally.
  • New behavior is covered by tests.
  • API changes are reflected in docs/examples when relevant.
  • PR description explains:
    • What changed
    • Why it changed
    • How it was tested

Submitting a PR

  1. Fork the repository and create a feature branch.
  2. Commit your changes with clear commit messages.
  3. Push your branch and open a PR against main.
  4. Respond to review comments and update the PR until it is approved.

Reporting Security Issues

Please do not open public issues for security vulnerabilities. Contact the Blnk team privately first.