Welcome to the Jido Signal contributor's guide! We're excited that you're interested in contributing to Jido Signal, the event signaling and pub/sub library for the Jido ecosystem.
-
Elixir Version Requirements
- Jido Signal requires Elixir ~> 1.18
- We recommend using asdf or similar version manager
-
Initial Setup
# Clone the repository git clone https://github.com/agentjido/jido_signal.git cd jido_signal # Install dependencies mix deps.get # Install git hooks (enforces conventional commits) mix git_hooks.install # Run tests to verify your setup mix test
-
Quality Checks
# Run the full quality check suite mix quality # Or individual checks mix format # Format code mix compile --warnings-as-errors # Check compilation mix dialyzer # Type checking mix credo --strict # Static analysis
-
Recommended Workflow
# Create a topic branch from main git checkout -b my-change # Run the test suite while you work mix test # Run the full quality checks before opening a PR mix quality
Contributors should:
- Keep changes focused on one topic per pull request
- Add or update tests when behavior changes
- Update documentation when APIs, behavior, or usage guidance changes
.
├── lib/
│ ├── jido_signal/
│ │ ├── bus/ # Event bus implementations
│ │ ├── dispatch/ # Signal dispatching logic
│ │ ├── router/ # Signal routing
│ │ ├── journal/ # Signal journal + persistence adapters
│ │ ├── serialization/ # Signal serializers and schema helpers
│ │ └── ext/ # Signal extension helpers
│ └── jido_signal.ex # Main entry point
├── test/
│ ├── jido_signal/
│ │ └── ... # Tests mirroring lib structure
│ ├── support/ # Test helpers and shared fixtures
│ └── test_helper.exs
└── mix.exs
- Bus: Event bus for publish/subscribe patterns
- Dispatch: Signal dispatching and delivery
- Router: Signal routing based on topics and patterns
- Dispatch Adapters: Delivery targets like PID, PubSub, HTTP, and webhooks
-
Formatting
- Run
mix formatbefore committing - Follow standard Elixir style guide
- Use
snake_casefor functions and variables - Use
PascalCasefor module names
- Run
-
Documentation
- Add
@moduledocto every module - Document all public functions with
@doc - Include examples when helpful
- Use doctests for simple examples
- Add
-
Type Specifications
@type signal :: %JidoSignal{} @spec dispatch(signal()) :: {:ok, term()} | {:error, term()} def dispatch(signal) do # Implementation end
-
Test Organization
defmodule JidoSignal.BusTest do use ExUnit.Case, async: true describe "publish/2" do test "publishes signal to subscribers" do # Test implementation end test "handles missing topic" do # Error case testing end end end
-
Coverage Requirements
- Maintain high test coverage
- Test both success and error paths
- Include property-based tests for complex logic
- Test async behavior where applicable
-
Running Tests
# Run full test suite mix test # Run with coverage mix test --cover # Run specific test file mix test test/jido_signal/signal/bus_test.exs
-
Use With Patterns
def subscribe(topic, opts) do with {:ok, validated} <- validate_topic(topic), {:ok, subscription} <- create_subscription(validated, opts) do {:ok, subscription} end end
-
Return Values
- Use tagged tuples:
{:ok, result}or{:error, reason} - Create specific error types for different failures
- Avoid silent failures
- Document error conditions
- Use tagged tuples:
We use git_hooks to enforce commit message conventions:
mix git_hooks.installThis installs a commit-msg hook that validates your commit messages follow the Conventional Commits specification.
<type>[optional scope]: <description>
[optional body]
[optional footer(s)]
| Type | Description |
|---|---|
feat |
A new feature |
fix |
A bug fix |
docs |
Documentation only changes |
style |
Changes that don't affect code meaning |
refactor |
Code change that neither fixes a bug nor adds a feature |
perf |
Performance improvement |
test |
Adding or correcting tests |
chore |
Changes to build process or auxiliary tools |
ci |
CI configuration changes |
# Feature
git commit -m "feat(bus): add topic pattern matching"
# Bug fix
git commit -m "fix(dispatch): resolve message ordering issue"
# Breaking change
git commit -m "feat(api)!: change subscription return type"The hook will reject non-conforming commits, ensuring a clean changelog can be generated automatically.
-
Before Submitting
- Run the full quality check suite:
mix quality - Ensure all tests pass
- Update documentation if needed
- Add tests for new functionality
- Run the full quality check suite:
-
PR Guidelines
- Create a feature branch from
main - Use descriptive commit messages following conventional commits
- Reference any related issues
- Keep changes focused and atomic
- Create a feature branch from
-
Review Process
- PRs require at least one review
- Address all review comments
- Maintain a clean commit history
- Update your branch if needed
Releases are handled automatically by maintainers using git_ops. Contributors should:
-
Use Conventional Commits - Your commit messages determine changelog entries:
feat:commits create "Added" entriesfix:commits create "Fixed" entriesdocs:,chore:,ci:commits are excluded
-
Do NOT edit
CHANGELOG.md- It is auto-generated during releases -
Documentation
- Update guides if needed
- Check all docstrings
- Verify README is current
If you have questions about contributing:
- Open a GitHub Discussion
- Check existing issues
- Review the guides directory
Thank you for contributing to Jido Signal!