Your First Contribution: Documentation & Tests

⏱️ Duration: 1.5-2 hours 📊 Difficulty: Basic 🎯 Hyperscale-rs Specific

Learning Objectives

1. Why Start with Docs and Tests?

Documentation and tests are the safest way to get familiar with the codebase and the project’s workflow:

2. Finding Good First Issues

Look for:

Guideline: claim the issue first. Before coding, comment on the issue to say you're working on it (e.g. "I'll take this") and give a one-line plan. That avoids duplicate work, lets maintainers steer you if your approach is off, and sets expectations so your PR has a better chance of a smooth review.

🤔 Think about it: You find an issue labeled "good first issue" but the description is vague. What's one thing you could do before writing code to make sure you're solving the right problem?

3. Documentation Guidelines

4. Testing Guidelines

5. Submitting Your PR

  1. Fork the repo (if that’s the project’s workflow) and create a branch, e.g. docs/improve-core-traits or tests/add-event-coverage.
  2. Keep the PR small: one logical change (one doc improvement, one test file, or one small bug fix).
  3. PR description format: Reference the issue (e.g. Fixes #42 or Closes #42) so reviewers see what you're addressing. Explain what you did and why, and how you verified it (e.g. "Added unit tests for handle(ProposalTimer) when node is proposer; ran cargo test, all tests pass"). That context makes review faster and shows you're thinking about verification, not just pushing code.
  4. Commit message format: Follow the project's convention if documented (e.g. in CONTRIBUTING.md). A common pattern is a short subject line (imperative, <72 chars) and optional body: e.g. docs(core): clarify StateMachine trait contract or test(bft): add ProposalTimer proposer path. If the project uses conventional commits or "type(scope): message", match that style.
  5. Run cargo test and cargo doc (and any other checks the repo uses) and fix any failures.
  6. Respond to review feedback promptly and update the PR accordingly.

6. Practical Assignment

Assignment: First Contribution

  1. Pick one: (a) add or improve doc comments for one public module or trait, or (b) add at least one new unit test for a function or state transition, or (c) fix a small bug from an open issue (with maintainer approval).
  2. Open a PR. In the description, say what you changed and how you verified it (e.g. “Ran cargo test; new test passes”).
  3. In your learning journal, write a short note: what you learned about the codebase and what you’d do differently next time.

Success Criteria

  • ✅ Your change is merged or accepted in principle with small requested edits
  • ✅ You ran the project’s tests and any doc build before submitting
  • ✅ You can describe how to find an issue, implement a fix, and submit a PR for this project