Development Guide
Prerequisites
Section titled “Prerequisites”- Python 3.12+
- uv —
curl -LsSf https://astral.sh/uv/install.sh | sh - ffmpeg 6.1+ (for MA integration tests)
- macOS:
brew install ffmpeg - Ubuntu:
sudo apt-get install ffmpeg
- macOS:
- Fork of trudenboy/ma-server (for dev server)
./scripts/setup.shRe-run after git pull — MA models version may change.
Running Tests
Section titled “Running Tests”# Unit tests (fast, no MA server needed)pytest tests/ -m "not integration"
# Full test suitepytest tests/
# With coveragepytest --cov=provider --cov-report=html tests/Day-to-Day Workflow
Section titled “Day-to-Day Workflow”Branch naming
Section titled “Branch naming”feature/<description> # new functionalityfix/<description> # bugfixeschore/<description> # maintenance, dependency updates<description> — kebab-case, 2–4 words. Examples:
feature/radio-mode-supportfix/seek-position-resetchore/update-depsFeature branch lifecycle
Section titled “Feature branch lifecycle”# 1. Create branch from devgit checkout dev && git pullgit checkout -b feature/radio-mode-support
# 2. Development + testspytest tests/pre-commit run --all-files
# 3. PR: feature/* → devgit push origin feature/radio-mode-supportgh pr create --base dev --title "feat: add radio mode support"
# 4. CI passes → merge → delete branchgit push origin --delete feature/radio-mode-supportRunning Dev Server
Section titled “Running Dev Server”Starts Music Assistant with live provider code (no Docker, isolated from other work):
./scripts/dev-server.sh# UI: http://localhost:8095Requires fork of ma-server. Discovery order:
MA_SERVER_REPO=/path/to/ma-server ./scripts/dev-server.shecho "/path/to/ma-server" > ma-server.repo(gitignored)- Autodetect:
../ma-server,~/Projects/ma-server,~/src/ma-server,~/dev/ma-server
Code Quality
Section titled “Code Quality”pre-commit run --all-filesRuns: ruff (lint + format), mypy (type check), codespell.
Conventional Commits
Section titled “Conventional Commits”Used for automatic CHANGELOG generation:
feat: add radio mode supportfix: fix seek position resetchore: update zvuk dependenciestest: add streaming testRelease Process
Section titled “Release Process”- PR:
dev→main - Merge
main - Trigger Release workflow: Actions → Release → Run workflow → enter version (e.g.
1.1.0) - Workflow creates tag, GitHub Release (with auto-generated release notes)
- Sync PR auto-created in trudenboy/ma-server
Troubleshooting
Section titled “Troubleshooting”sync-to-fork.yml fails — FORK_SYNC_PAT expired
Renew the PAT (needs contents:write on trudenboy/ma-server) then update the secret:
gh secret set FORK_SYNC_PAT --body "$NEW_PAT" --repo trudenboy/ma-provider-zvuk-musicPort 8095 already in use
lsof -i :8095kill <PID>dev-server.sh can’t find the fork
# Option 1: env varMA_SERVER_REPO=~/work/ma-server ./scripts/dev-server.sh
# Option 2: local override file (gitignored)echo "~/work/ma-server" > ma-server.repoE2E Checklist
Section titled “E2E Checklist”Run before upstream PR or major release:
- Provider connects successfully
- Browse → Zvuk Music opens, library displayed
- Track/artist/album search returns results
- Track plays correctly, seek works
- Favourite tracks sync to library