|
1 | | -# Contributing |
| 1 | +# Contributing to Sonobarr |
2 | 2 |
|
3 | | -1. Clone the repository. |
4 | | -2. Checkout the `develop` branch: `git checkout develop`. |
5 | | -3. **Create** a `docker-compose.override.yml` with the following contents: |
| 3 | +Thank you for contributing to Sonobarr. This guide defines the required workflow for local development, testing, and pull requests. |
| 4 | + |
| 5 | +## Branch and Pull Request Policy |
| 6 | + |
| 7 | +- Base all work on the `develop` branch. |
| 8 | +- Open pull requests against `develop`. |
| 9 | +- Keep each pull request focused on one feature or one fix. |
| 10 | +- For substantial non-bugfix work, open an issue first to align on scope. |
| 11 | + |
| 12 | +## Local Development Setup |
| 13 | + |
| 14 | +1. Clone the repository and switch to `develop`: |
| 15 | + ```bash |
| 16 | + git clone https://github.com/Dodelidoo-Labs/sonobarr.git |
| 17 | + cd sonobarr |
| 18 | + git checkout develop |
| 19 | + ``` |
| 20 | +2. Create `docker-compose.override.yml` with a local source mount and your reverse proxy network: |
6 | 21 | ```yaml |
7 | 22 | services: |
8 | 23 | sonobarr: |
|
15 | 30 | - ./config:/sonobarr/config |
16 | 31 | - /etc/localtime:/etc/localtime:ro |
17 | 32 | - ./src:/sonobarr/src |
18 | | - #ports: |
19 | | - # - "5000:5000" |
| 33 | + # ports: |
| 34 | + # - "5000:5000" |
20 | 35 | networks: |
21 | 36 | npm_proxy: |
22 | | - ipv4_address: 192.168.97.23 #change as you need |
| 37 | + ipv4_address: 192.168.97.23 # update for your environment |
23 | 38 |
|
24 | 39 | networks: |
25 | 40 | npm_proxy: |
26 | 41 | external: true |
27 | 42 | ``` |
28 | | -4. Build the image with `sudo docker compose up -d` - later this will re-use the local image. |
29 | | -5. Make code changes in `src/` or other required files. |
30 | | -6. Test the changes by restarting the docker image `sudo docker compose down && sudo docker compose up -d` and clearing cache in browser. |
31 | | -7. Once ready to commit, make sure the build still works as well `sudo docker compose down -v --remove-orphans && sudo docker system prune -a --volumes -f && sudo docker compose up -d`. |
32 | | - |
33 | | -### Important |
34 | | -- We only accept PR's, thus, open a Pull Request on the origin with your code changes against `develop` branch. |
35 | | -- A maintainer will always review both code and functionality (User Testing), discuss/approve and finally merge the changes. |
36 | | -- All changes will be adequately credited in changelog. It is up to you to leave `by xxx` comments in the code. |
37 | | -- **Please only commit one feature per PR**. |
38 | | -- If making substantial changes other than bug fixes please first open a Issue to discuss it. |
39 | | - |
40 | | -**Always test your changes with at least two accounts - admin and a common user - in the app, in at least two distinct browser builds (such as safari and chrome, for example).** |
41 | | -**Remember that if you made changes affecting config (that is, database or configuration) you have to delete the `./config` folder before rebuilding or restarting the app.** |
| 43 | +3. Build and start the local stack: |
| 44 | + ```bash |
| 45 | + sudo docker compose up -d |
| 46 | + ``` |
| 47 | +4. Implement your changes in `src/`, `migrations/`, and related project files. |
| 48 | + |
| 49 | +## Validation Requirements |
| 50 | + |
| 51 | +Before opening a pull request, verify the change in a running container: |
| 52 | + |
| 53 | +1. Restart and validate normal startup: |
| 54 | + ```bash |
| 55 | + sudo docker compose down && sudo docker compose up -d --build |
| 56 | + ``` |
| 57 | +2. Confirm behavior in the UI and clear browser cache if needed. |
| 58 | +3. Run final clean start validation: |
| 59 | + ```bash |
| 60 | + sudo docker compose down -v --remove-orphans |
| 61 | + sudo docker system prune -a --volumes -f |
| 62 | + sudo docker compose up -d --build |
| 63 | + ``` |
| 64 | + |
| 65 | +### Manual Test Coverage |
| 66 | + |
| 67 | +- Test as both an admin and a regular user account. |
| 68 | +- Test in at least two different browsers, for example Safari and Chrome. |
| 69 | +- Validate both developer expectations and end-user behavior. |
| 70 | +- Preserve backward compatibility and verify upgrade and downgrade paths for schema changes. |
| 71 | + |
| 72 | +If your change affects configuration or database state, remove `./config` before rebuilding so migrations and initialization paths are tested from a clean state. |
| 73 | + |
| 74 | +## Pull Request Quality Bar |
| 75 | + |
| 76 | +- Include a clear summary of what changed and why. |
| 77 | +- Describe how you tested it, including user roles and browsers used. |
| 78 | +- Note any migration impact, compatibility concerns, or operational risks. |
| 79 | +- Expect maintainer review of both code quality and runtime behavior before merge. |
| 80 | + |
| 81 | +## Attribution and Changelog |
| 82 | + |
| 83 | +Maintainers curate release notes and changelog entries. If you want explicit credit text, include your preferred attribution in the pull request description. Contributors will always be attributed in changelog and release notes. |
| 84 | + |
| 85 | +## AI-Assisted Contributions |
| 86 | + |
| 87 | +AI-assisted contributions are allowed. You are responsible for the submitted code quality and correctness, including security and maintainability. |
| 88 | + |
| 89 | +Low-quality, unreviewed, or non-functional generated code will be rejected. Repeated low-quality submissions after maintainer feedback can result in loss of contribution privileges. |
0 commit comments