Polos is an open source project. We welcome contributions from everyone and strive to maintain a respectful, open, and friendly community. This guide will help you get started with contributing.
If you have questions or need help, feel free to open an issue or reach out to the maintainers. We're here to help!
We mark issues with the "good first issue" label to help new contributors find suitable tasks to start with. These are great entry points if you're new to the project.
- Claiming an issue: If you'd like to work on an issue, please leave a comment expressing your interest (e.g., "I'd like to work on this" or "Can I take this?"). This helps us assign the issue to you and prevents duplicate work.
- Large features: For significant features or changes, we recommend discussing the design and approach with maintainers first to ensure alignment before starting work.
- Rust (latest stable version recommended)
- PostgreSQL
-
Clone the repository:
git clone https://github.com/polos-dev/polos.git cd polos -
Install dependencies:
cd orchestrator cargo build -
Set up database:
- Install and start postgres
- Create a test database:
createdb polos - Set
DATABASE_URLin.envfile in the orchestrator directory:DATABASE_URL=postgres://postgres:postgres@localhost/polos
-
Set up git hooks:
./scripts/setup-git-hooks.sh
This installs pre-commit hooks that automatically run code quality checks before each commit.
We maintain high code quality standards. Please ensure your code is well-tested and follows our guidelines before submitting a pull request.
To submit your code:
-
Fork the repository on GitHub
-
Create a new branch on your fork:
git checkout -b feature/your-feature-name
-
Make your changes and ensure:
- Code is formatted (
cargo fmtin orchestrator directory) - No clippy warnings (
cargo clippy -- -D warningsin orchestrator directory) - All tests pass (
cargo testin orchestrator directory)
- Code is formatted (
-
Run pre-commit checks. These run automatically on
git commitafter installing the hooks (see Setup Development Environment).To run them manually:
cd orchestrator cargo fmt --check cargo clippy -- -D warnings -
Open a Pull Request when your work is ready for review
In your PR description, please include:
- A clear description of what changed
- The motivation behind the changes
- Whether this is a breaking change
- References to any related GitHub issues
A maintainer will review your PR and provide feedback. Once approved and all checks pass, your PR will be merged. We appreciate your contributions and will acknowledge them in our release notes!
We use rustfmt for code formatting and clippy for linting. These are automatically checked before each commit via git pre-commit hooks.
You can run these tools manually:
Format code:
cd orchestrator
cargo fmtCheck formatting:
cd orchestrator
cargo fmt --checkRun clippy:
cd orchestrator
cargo clippy -- -D warningsFix clippy suggestions automatically (when possible):
cd orchestrator
cargo clippy --fixTests use a PostgreSQL database specified by TEST_DATABASE_URL. The test setup automatically loads environment variables from a .env file if present.
Run all tests:
cd orchestrator
cargo test --test libRun specific test:
cd orchestrator
cargo test --test lib test_nameRun with output:
cd orchestrator
cargo test --test lib -- --nocaptureSee orchestrator/tests/README.md for more details on testing.
- Follow Rust naming conventions (snake_case for functions/variables, PascalCase for types)
- Keep functions focused and reasonably sized
- Add comments for complex logic
- Use meaningful variable and function names
- Prefer
anyhow::Resultfor error handling in application code - Use appropriate error types for library code
Write clear, descriptive commit messages:
- Use imperative mood ("Add feature" not "Added feature")
- Keep the first line under 72 characters
- Add more details in the body if needed
Example:
Add timeout support for workflow executions
- Add run_timeout_seconds field to Execution model
- Implement timeout monitoring background task
- Add cancellation logic for timed-out executions
If you need to bypass the pre-commit hook (not recommended), you can use:
git commit --no-verifyNote: This should only be used in exceptional circumstances. All code should pass formatting and linting checks before being merged.
If you have questions or need help, please open an issue or reach out to the maintainers.