Thank you for your interest in contributing to ghdash! This document provides guidelines to help you get started.
-
Fork the repository and clone your fork:
git clone https://github.com/your-username/ghdash.git cd ghdash -
Make sure you have Rust installed (1.85+ required for edition 2024):
rustup update stable
-
Build and run the tests:
cargo build cargo test
# Create a config file
mkdir -p ~/.config/ghdash
cat > ~/.config/ghdash/config.toml << 'EOF'
[github]
users = ["your-github-username"]
EOF
# Run in debug mode
cargo run -- --debugBefore submitting a PR, make sure all checks pass:
cargo fmt --all -- --check # Formatting
cargo clippy --all-targets # Linting
cargo test --all-targets # Tests
cargo build --release # Release buildCI runs these same checks on every pull request.
src/
app/ App state machine, actions, reducer, event loop, layout
github/ GraphQL client, queries, models, auth
cache/ Disk cache with TTL
ui/ Theme constants, widget rendering functions
util/ Config loader, time formatting, browser helper
tests/ Integration tests
- Action Channel pattern — All events (keyboard, API responses) flow through a single
mpscchannel asActions. Theupdate()function is a pure state reducer that returnsSideEffects, keeping state transitions testable. - Bounded concurrency — A
tokio::sync::Semaphore(4)limits concurrent GitHub API requests. - Client-side search — Search filters the already-fetched PR list by substring matching. No additional API calls.
- Flat nav tree — The navigation tree is a
Vec<NavNode>rebuilt from org data whenever it changes, rather than a recursive tree structure.
-
Create a branch for your change:
git checkout -b my-feature
-
Make your changes. Follow the existing code style —
cargo fmtandcargo clippyenforce this. -
Add tests for new functionality. Tests live in
tests/as integration tests. The main test suites are:config_tests.rs— Config parsing and defaultscache_tests.rs— Cache set/get/TTL/invalidationstate_tests.rs— State transitions and the update reducertime_tests.rs— Relative time formattinggraphql_parse_tests.rs— Model serialization and accessors
-
Run the full check suite:
cargo fmt --all -- --check cargo clippy --all-targets cargo test --all-targets -
Commit and push your branch, then open a pull request.
- Keep PRs focused — one feature or fix per PR.
- Write a clear description of what changed and why.
- Ensure CI passes before requesting review.
- Add tests for bug fixes and new features.
- Use GitHub Issues to report bugs or request features.
- Include your OS, Rust version (
rustc --version), and steps to reproduce.
By contributing to ghdash, you agree that your contributions will be licensed under the Apache License 2.0.