Thank you for your interest in contributing to Kellnr! This document provides guidelines and instructions to help make the contribution process smooth and effective.
- Main branch: Contains the current stable release with a tagged version. Features and fixes that should be in the next release must be merged into this branch.
- Feature branches: Created from
mainfor new features or bug fixes that are intended for the next release.
- Fork the repository
- Create a branch from
main - Fix the bug
- Ensure your code is formatted with
cargo fmt(default settings) - Submit a pull request to the
mainbranch
- Open an issue first describing the feature:
- What is its use case?
- Why should it be in Kellnr?
- Any relevant technical details
- Wait for discussion and approval
- Fork the repository
- Create a branch from
main - Implement the feature
- Ensure your code is formatted with
cargo fmt(default settings) - Submit a pull request to the
mainbranch - Reference the original issue in your pull request
The following tools are needed to build Kellnr:
- Rust
- NPM / Node.js
- Docker
- just (task runner)
For an easy development environment, you can use the provided flake.nix:
# Start a development shell
nix develop
# Build the project
nix buildThe project uses just as a task runner. Common tasks:
# List all available tasks
just -l
# Build the project (debug)
just build
# Build the project (release)
just build-release
# Build the frontend (result is placed in ./static)
just npm-build
# Test the project (without Docker integration tests, requires cargo-nextest)
just test
# Test the project (with Docker integration tests, requires cargo-nextest)
just test-all
# Run the project
just runWhen updating any Node.js dependencies, make sure to run:
just node2nixThis will update the Node dependencies for Nix as well.
When making changes that require database migrations:
- Create a new migration in the 'crates/db/migration' directory.
- Add the migration to the crates/db/migration/src/lib.rs file.
- Run the migrations against the PostgreSQL database backend. The Sqlite backend does not work in some edge cases with migrations.
- Generate the entities using the Sea ORM CLI.
- Put the generated entities in the
crates/db/migration/src/YOUR_MIGRATION_ENTITIESdirectory. - Update the entities used by kellnr in the
crates/db/src/entitydirectory. - Rename the
mod.rsfile tolib.rsin thecrates/db/src/entitydirectory.
If you're using Sea ORM and need to generate entities from the database:
# Set up a local PostgreSQL container
docker run -it --rm -p 5432:5432 -e POSTGRES_PASSWORD=admin -e POSTGRES_USER=admin postgres
# Generate entities (where "postgres" (default) is the database name)
cd <folder for entities in migrations>
sea-orm-cli generate entity -u postgresql://admin:admin@127.0.0.1/postgresThe following environment variables can be set at compile time:
KELLNR_VERSION: The version of kellnr currently being compiled (default:0.0.0-unknown).KELLNR_CONFIG_DIR: The configuration directory (default:./config,../config, or../../config).KELLNR_DATA_DIR: The directory where kellnr stores its data. (d)efault:/opt/kdata).
If your feature adds or modifies functionality, please update the documentation accordingly. The documentation is in a separate repository. You can find the kellnr documentation here and the correponding repository here: kellnr website repository.
If your feature is configurable with settings, please update the kellnr helm chart, too. The settings should be reflected in the helm chart, such that they can be set by the values.yaml file.
- All code must be formatted with
cargo fmtusing the default settings - Follow the existing coding patterns and naming conventions
- Write meaningful commit messages
- Add tests for new functionality
- Update documentation when necessary
If you have any questions about contributing, please open an issue for discussion.
Thank you for contributing to Kellnr!
As kellnr is a multi-repo project, creating a new release involves several steps across different repositories. Please follow the steps below to ensure a smooth release process.
- Create a new release in the
kellnrrepository from themainbranch here.- The version should be in the format
vX.Y.Z, e.g.,v1.2.3. - This builds
kellnrand creates the release artifacts, e.g. binary files and Docker images.
- The version should be in the format
- On a successfull release, a PR for the
helmchart forkellnris automatically created.- Navigate to the kellnr helm chart repository
- Review the
Chart.yamlfile with the new version number and any other relevant changes. - If settings have changed, update the
values.yamlfile and templates accordingly. - Commit the changes and push them to the
mainbranch. - Every push to the
mainbranch will automatically create a new release in the helm chart repository.
- On a successful release of kellnr, a PR for the changelog and rss feed is automatically created.:
- Navigate to the kellnr documentation repository
- If needed, update the documentation pages to reflect any new features or changes in the release.
- Commit the changes and push them to the
mainbranch. This will automatically deploy the updated documentation.
By following these steps, you will ensure that the new release of kellnr is properly documented and available for users to deploy via the helm chart. Thank you for your contributions!