Thank you for contributing to OpenFrame OSS Tenant! This guide covers code style, branch naming, the pull request process, commit message format, and the review checklist.
Important: OpenFrame OSS Tenant does not use GitHub Issues or GitHub Discussions. All development discussions, bug reports, and feature requests are handled in the OpenMSP Slack community.
- Join OpenMSP Slack: https://www.openmsp.ai/
- Direct invite: Join Slack
The codebase follows standard Java conventions with Lombok for boilerplate reduction.
Key conventions:
- Use
@Slf4jfor logging (via Lombok) - Use
@Builder,@Data,@Valueannotations appropriately - Prefer constructor injection over field injection (for testability)
- Use record types for immutable DTOs where appropriate (Java 21)
- Follow Spring naming conventions:
*Service,*Repository,*Controller,*DataFetcher
Package structure:
com.openframe.<service>.
├── config/ # Spring configuration classes
├── controller/ # REST controllers
├── datafetcher/ # GraphQL DGS data fetchers
├── dataloader/ # GraphQL DGS data loaders
├── dto/ # Data transfer objects
├── exception/ # Custom exceptions and handlers
├── mapper/ # MapStruct or manual mappers
└── service/ # Business logic services
Formatting: The Java codebase follows the default IntelliJ IDEA Java formatting. No external formatter is enforced via CI currently; use IntelliJ's built-in formatter.
Follow standard Rust conventions as enforced by rustfmt and clippy.
# Format
cargo fmt
# Lint
OPENFRAME_VERSION=0.0.0-dev cargo clippy -- -D warnings
# Both before committing
cargo fmt && OPENFRAME_VERSION=0.0.0-dev cargo clippy -- -D warningsNaming conventions:
- Functions and variables:
snake_case - Types and traits:
PascalCase - Constants:
SCREAMING_SNAKE_CASE - Modules:
snake_case
Use descriptive branch names that reflect the purpose of the change:
# Feature branches
feat/add-script-scheduling-api
# Bug fixes
fix/agent-token-refresh-race-condition
fix/tenant-isolation-in-device-query
# Refactoring
refactor/extract-nats-publisher-interface
# Documentation
docs/update-architecture-diagram
# Chores / maintenance
chore/upgrade-spring-boot-3.3.1
chore/update-openframe-libs-5.65.0
Format: <type>/<short-description-in-kebab-case>
| Type | When to Use |
|---|---|
feat |
New feature or capability |
fix |
Bug fix |
refactor |
Code restructuring without behavior change |
docs |
Documentation updates |
chore |
Dependency updates, CI, tooling |
test |
Adding or fixing tests |
perf |
Performance improvements |
OpenFrame OSS Tenant uses Conventional Commits format:
<type>(<scope>): <short summary>
[optional body]
[optional footer(s)]
Examples:
feat(api): add script schedule assignment endpoint
Adds GraphQL mutation for assigning scripts to device groups with
configurable cron triggers. Validates against existing schedule conflicts.
Closes #123
fix(openframe-client): prevent token refresh during shutdown
The token refresh run manager now checks the shutdown flag before
scheduling the next refresh to avoid errors during graceful shutdown.
chore(deps): upgrade openframe-libs to 5.65.0
Types:
| Type | Description |
|---|---|
feat |
New feature |
fix |
Bug fix |
refactor |
Code refactoring |
docs |
Documentation only |
test |
Tests only |
chore |
Build, CI, dependencies |
perf |
Performance improvement |
style |
Formatting only (no logic change) |
Scope examples: api, gateway, auth, openframe-client, stream, management
- Build successfully:
mvn clean install -DskipTests(for Java) orOPENFRAME_VERSION=0.0.0-dev cargo build(for Rust) - Run tests:
mvn testorOPENFRAME_VERSION=0.0.0-dev cargo test - Lint/format:
cargo fmt && OPENFRAME_VERSION=0.0.0-dev cargo clippy(Rust) - Test your changes manually against a running instance if possible
A good PR description includes:
- What was changed and why
- How to test the change
- Any breaking changes or migration notes
- Links to related Slack discussions
Template:
## Summary
Brief description of what this PR changes and why.
## Changes
- List of specific changes made
## Testing
How to verify this change works correctly.
## Breaking Changes
Any breaking changes and migration path (if applicable).- Prefer small, focused PRs — one logical change per PR
- Large refactors should be broken into a series of smaller PRs when possible
- Data migrations (Mongock change units) should be in separate PRs
Use this checklist when reviewing PRs:
- Logic is correct and handles edge cases
- Error handling is appropriate (exceptions caught, logged, propagated correctly)
- No unintended side effects or race conditions
- No secrets or credentials committed to the repository
- New API endpoints have proper tenant isolation
- User input is validated with
@Validor equivalent - MongoDB queries go through tenant-scoped templates
- New code has appropriate unit/integration tests
- Tests cover happy path and key error scenarios
- Tests are deterministic (no time-dependent or order-dependent tests)
- Code follows existing conventions (naming, package structure)
- No unnecessary complexity introduced
- Lombok / Rust idioms used appropriately
- No dead code or unused imports
- New services or significant features have code-level documentation
- Breaking changes are clearly documented in the PR description
- New environment variables are documented
- New configurations are defined in
application.yml, not hardcoded - Async operations use
@Asyncor reactive patterns consistently - New Mongock migrations (
@ChangeUnit) follow the naming convention
-
OPENFRAME_VERSION=0.0.0-dev cargo clippy -- -D warningspasses with no warnings - Error handling uses
anyhow::Resultorthiserrorappropriately -
Arc/Mutexusage is minimal and necessary
When updating the shared openframe-libs version (openframe.libs.version in pom.xml):
- Update the version in the root
pom.xml - Build all services:
mvn clean install -DskipTests - Run tests:
mvn test - Document any API changes from the library in the PR description
By contributing to OpenFrame OSS Tenant, you agree that your contributions will be licensed under the same license as the project. See the repository for license details.