Thank you for your interest in contributing to Octez Manager! This document provides guidelines and instructions for contributing.
- Code of Conduct
- Getting Started
- Development Setup
- Making Changes
- Code Style
- Testing
- Submitting Changes
- License
We are committed to providing a welcoming and inclusive environment. Please be respectful and constructive in all interactions.
- Fork the repository and clone your fork locally
- Set up the development environment (see below)
- Create a branch for your changes
- Make your changes following our guidelines
- Submit a pull request
- OCaml 5.1 or later (5.3.x recommended)
- opam 2.x
- dune >= 3.15
- systemd (for service management features)
# Clone your fork
git clone https://github.com/YOUR_USERNAME/octez-manager.git
cd octez-manager
# Install dependencies
make deps
# Build the project
make build
# Run tests
make test| Command | Description |
|---|---|
make deps |
Install all dependencies |
make build |
Build the project |
make test |
Run the test suite |
make fmt |
Format code with ocamlformat |
make clean |
Clean build artifacts |
Use descriptive branch names with a prefix:
feat/- New featuresfix/- Bug fixesdocs/- Documentation changesrefactor/- Code refactoringtest/- Test additions or fixeschore/- Maintenance tasks
Example: feat/add-baker-monitoring
We follow Conventional Commits. Format:
type(scope): description
[optional body]
[optional footer]
Types:
feat- New featurefix- Bug fixdocs- Documentationstyle- Formatting (no code change)refactor- Code restructuringtest- Adding testschore- Maintenance
Examples:
feat(installer): add network selection wizard
fix(service): prevent duplicate service starts
docs(readme): add systemd requirements
We use ocamlformat. Run before committing:
make fmtThe configuration is in .ocamlformat.
All .ml and .mli files must include the license header:
(******************************************************************************)
(* *)
(* SPDX-License-Identifier: MIT *)
(* Copyright (c) 2025 Nomadic Labs <contact@nomadic-labs.com> *)
(* *)
(******************************************************************************)Public modules should have corresponding .mli interface files with:
- Type definitions
- Function signatures with documentation comments
- Module documentation at the top
# Run unit tests
make test
# Run specific test
dune exec -- test/unit_tests.exeUnit tests use Alcotest and live in test/unit_tests.ml.
Integration tests run in Docker containers with real systemd, testing actual service management.
# Run integration tests locally
cd test/integration
./run.sh
# Or use docker-compose directly
docker compose up --build --abort-on-container-exitIntegration tests are located in test/integration/cli-tester/tests/ organized by role:
| Directory | Description |
|---|---|
node/ |
Node installation, lifecycle, restart, cascading dependencies |
baker/ |
Baker installation, DAL config, remote endpoints, dependencies |
accuser/ |
Accuser installation and lifecycle |
dal/ |
DAL node installation and dependencies |
Test naming: XX-description.sh where XX is a number for ordering.
Writing integration tests:
- Source
/tests/lib.shfor helper functions - Use
cleanup_instancefor setup/teardown - Use
wait_for_service_active,wait_for_node_readyfor async operations - Tests run with real systemd as PID 1 in Docker
- Ensure all tests pass:
make test - Format your code:
make fmt - Update documentation if needed
- Create a pull request with a clear description
Fast Tests on PRs:
- PRs always run fast, non-instrumented integration tests (~10-12 min total)
- This ensures quick feedback during development
Coverage on Main Branch:
- Coverage collection runs only when changes are pushed to
main - This maintains the coverage baseline without slowing down PR iterations
- Coverage badge and reports are updated after merge
Manual Coverage (if needed):
- Use the "Actions" tab → "Coverage Report" → "Run workflow" to manually trigger coverage collection
- Useful for debugging coverage issues before merging
Your PR description should include:
- Summary: What does this PR do?
- Motivation: Why is this change needed?
- Testing: How was this tested?
- Breaking Changes: Any breaking changes?
- All PRs require at least one review
- CI must pass (build, tests, formatting)
- Address review feedback promptly
- Issues: Open an issue for bugs or feature requests
- Discussions: Use GitHub Discussions for questions
By contributing, you agree that your contributions will be licensed under the MIT License. All contributions must include the appropriate license headers.
Thank you for contributing to Octez Manager!