Contributing to Kleinkram
Thank you for your interest in contributing to Kleinkram!
Branching Strategy
Kleinkram uses a two-branch strategy with main and dev as protected branches.
| Branch | Purpose |
|---|---|
main | Production-ready code. All releases are made from this branch. |
dev | Main development branch. This is built and hosted as a staging environment for testing production builds before release. |
Feature Branches
When developing a new feature or fix, create a branch from dev with one of the following prefixes:
| Prefix | Purpose | Example |
|---|---|---|
feat/ | New features | feat/add-mcap-visualization |
fix/ | Bug fixes | fix/upload-timeout |
Pull Request Workflow
- Create a feature branch from
dev. - Implement your changes and ensure all tests pass locally.
- Open a Pull Request targeting the upstream
devbranch. - Wait for CI checks to pass. All PRs must pass the automated checks.
- Address review comments and get your PR approved.
- Merge your PR into
dev.
TIP
Every Pull Request must pass automated CI/CD checks. For details on what checks run and how to run tests locally see Testing documentation.
Release Workflow
When the dev branch is stable and ready for a new release, a Pull Request is opened from dev to main. After approval, this is merged to create a new release.
Bump the version on
dev. All packages and the CLI share one version number. Run one ofbashpnpm bump # 0.63.4 -> 0.63.5 pnpm bump:minor # 0.63.4 -> 0.64.0 pnpm bump:major # 0.63.4 -> 1.0.0This sets the version in every
package.jsonand incli/setup.cfg.pnpm validateVersionschecks that they all match.Bumping the version does not block older clients by itself. Two separate checks exist:
- The
kleinCLI compares its own version with the server's when a command starts. It refuses to run if the major versions differ and prints a warning if the minor versions differ. This check is part of the CLI commands only; the Python SDK and direct API calls skip it. Bump the minor version when the API changes in a way older CLIs should notice. - The API server rejects requests with
426 Upgrade Requiredif thekleinkram-client-versionheader is missing or not a valid version, or if the version is inFORBIDDEN_RANGESinbackend/src/routing/middlewares/version-checker-middleware.service.ts(currently<0.58.0). To stop older CLIs and SDKs from talking to the new API, extend that list in the release.
- The
Open a Pull Request from
devtomain. Thecheck-version-numberworkflow fails if the versions do not match or the version was not bumped. Some required checks only run ondev, so the head commit of the Pull Request must also be ondev.Merge. Pushing to
mainthen:- creates a GitHub release with the tag
v<version>(create-release). Its description is the merge commit message, so add the changelog to the release afterwards. - builds the Docker images from
docker-compose.prod.ymland pushes them as the*-latestimages (production-build). - publishes the CLI to PyPI if anything in
cli/changed (update-pypi).
- creates a GitHub release with the tag
Run the database migrations on the production database if the release contains any. See Migrations.
Every push to dev does the same for the staging environment: it pushes the *-dev images, and, if cli/ changed, publishes a pre-release of the CLI with the version <version>-dev<timestamp>.
Reporting Issues
If you encounter a bug or have a feature request, please open an issue on GitHub.
Seeking Support
For help and support:
- Check the official documentation.
- If you can't find an answer, open an issue on GitHub.
Next Steps
Ready to write code? Go to Start Development to set up your environment.