aboutsummaryrefslogtreecommitdiffstats
path: root/CONTRIBUTING.md
blob: c8dd36c81eee2ef8233e660444e3d3cbf6c919bc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
# Contributing to Bolt

Thank you for your interest in contributing to Bolt! This document provides guidelines and instructions for contributing to the project.

## Getting Started

Bolt is hosted on [SourceHut](https://sr.ht/~eugenetriguba/Bolt/). If you're new
to SourceHut, here are some helpful resources:
- [git.sr.ht quickstart](https://man.sr.ht/git.sr.ht/)
- [email-based workflow guide](https://man.sr.ht/hg.sr.ht/email.md)

You do not need an account on SourceHut to contribute.

## Ways to Contribute

There are many ways to contribute to Bolt:

- **Bug Reports**: Submit bug reports to the [issue
  tracker](https://todo.sr.ht/~eugenetriguba/bolt-issues)
- **Feature Requests**: Propose new features via the issue tracker
- **Code Contributions**: Submit patches via email
- **Documentation**: Improve documentation, fix typos, or add examples
- **Testing**: Test Bolt with different databases and report issues

## Development Setup

### Prerequisites

- Go 1.23.0 or later
- Docker (for running database integration tests)
- git

### Initial Setup

1. Clone the repository:
```bash
git clone https://git.sr.ht/~eugenetriguba/bolt
cd bolt
```

2. Install dependencies:
```bash
go mod download
```

3. Build the project:
```bash
go build -o bolt ./cmd/bolt
```

### Running Tests

Bolt has integration tests for all supported databases. The test suite uses docker containers to run database instances.

Run all tests:
```bash
./scripts/test.sh
```

Run tests for a specific database:
```bash
./scripts/test.sh postgres
./scripts/test.sh mysql
./scripts/test.sh mssql
./scripts/test.sh sqlite3
```

## Submitting Patches

Bolt uses an [email-based workflow]((https://git-send-email.io/)) for
accepting contributions.
- Patches are submitted via email to the [bolt-devel mailing
list](https://lists.sr.ht/~eugenetriguba/bolt-devel).
- Discussions of new features can be proposed in [bolt-discuss
mailing list](https://lists.sr.ht/~eugenetriguba/bolt-devel)

### Step 1: Configure Git

Set up git send-email if you haven't already:

```bash
git config --global sendemail.smtpserver smtp.example.com
git config --global sendemail.smtpuser your-email@example.com
git config --global sendemail.smtpencryption tls
git config --global sendemail.smtpserverport 587
```

For detailed email configuration, see the [git send-email tutorial].

### Step 2: Create Your Changes

1. Create a new branch for your changes:
```bash
git checkout -b your-feature-name
```

2. Make your changes and commit them:
```bash
git add .
git commit
```

3. Write a clear commit message following this format:
```
Short (50 chars or less) summary

More detailed explanatory text, if necessary. Wrap it to about 72
characters. The blank line separating the summary from the body is
critical.

Explain the problem that this commit is solving. Focus on why you
are making this change as opposed to how. The code explains how.

Signed-off-by: Your Name <your-email@example.com>
```

### Step 3: Send Your Patch

Send your patch to the mailing list:

```bash
git send-email --to=~eugenetriguba/bolt-devel@lists.sr.ht HEAD^
```

To send multiple commits:
```bash
git send-email --to=~eugenetriguba/bolt-devel@lists.sr.ht origin/main..HEAD
```

## Code Guidelines

### Style

- Run `go fmt` on your code before committing

### Testing

- New features must include tests
- Bug fixes should include a test that would have caught the bug
- Integration tests should cover all supported databases when applicable
- Ensure all tests pass before submitting your patch

### Documentation

- Update the README.md if you're adding new features or changing behavior
- Include code comments for complex logic
- Update CHANGELOG.md with your changes (Add an "Unreleased" section if it
  doesn't exist)

## Questions?

If you have questions about contributing, you can:

- Ask on the [bolt-discuss mailing list](https://lists.sr.ht/~eugenetriguba/bolt-discuss)
- Open a ticket on the [bolt-issues issue
  tracker](https://todo.sr.ht/~eugenetriguba/bolt-issues)
- Check the [project page](https://sr.ht/~eugenetriguba/Bolt/) for additional resources