Thank you for contributing to Sonobarr. This guide defines the required workflow for local development, testing, and pull requests.
- Base all work on the
developbranch. - Open pull requests against
develop. - Keep each pull request focused on one feature or one fix.
- For substantial non-bugfix work, open an issue first to align on scope.
- Clone the repository and switch to
develop:git clone https://github.com/Dodelidoo-Labs/sonobarr.git cd sonobarr git checkout develop - Create
docker-compose.override.ymlwith a local source mount and your reverse proxy network:services: sonobarr: build: context: . dockerfile: Dockerfile network: host image: sonobarr-local volumes: - ./config:/sonobarr/config - /etc/localtime:/etc/localtime:ro - ./src:/sonobarr/src # ports: # - "5000:5000" networks: npm_proxy: ipv4_address: 192.168.97.23 # update for your environment networks: npm_proxy: external: true
- Build and start the local stack:
sudo docker compose up -d
- Implement your changes in
src/,migrations/, and related project files.
Before opening a pull request, verify the change in a running container:
- Restart and validate normal startup:
sudo docker compose down && sudo docker compose up -d --build - Confirm behavior in the UI and clear browser cache if needed.
- Run final clean start validation:
sudo docker compose down -v --remove-orphans sudo docker system prune -a --volumes -f sudo docker compose up -d --build
- Test as both an admin and a regular user account.
- Test in at least two different browsers, for example Safari and Chrome.
- Validate both developer expectations and end-user behavior.
- Preserve backward compatibility and verify upgrade and downgrade paths for schema changes.
If your change affects configuration or database state, remove ./config before rebuilding so migrations and initialization paths are tested from a clean state.
Run automated tests for any change that touches Python code (src/), request handling, or settings logic.
- Install dependencies in the required environment:
path/to/python-venv/bin/pip install -r requirements.txt path/to/python-venv/bin/pip install pytest pytest-cov
- Run the test suite:
PYTHONPATH=src path/to/python-venv -m pytest
- Generate coverage output for SonarQube:
PYTHONPATH=src path/to/python-venv -m pytest \ --cov=src/sonobarr_app \ --cov-report=term-missing \ --cov-report=xml
Coverage workflow details, report artifacts, and SonarQube notes are documented in:
- Include a clear summary of what changed and why.
- Describe how you tested it, including user roles and browsers used.
- Note any migration impact, compatibility concerns, or operational risks.
- Expect maintainer review of both code quality and runtime behavior before merge.
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.
AI-assisted contributions are allowed. You are responsible for the submitted code quality and correctness, including security and maintainability.
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.