GitHub

Contributing to Diskus

First off, thank you for considering contributing to Diskus! It’s people like you that make Diskus a great modern commenting platform.

Diskus is built as an open-source monorepo. This document will guide you through our development process, testing standards, and how to get your contributions merged.

Setting Up for Development

Please refer to our Quick Start guide for detailed instructions on how to install dependencies and run the local development server using Bun.


Testing Guidelines

We take code quality seriously. Diskus maintains strict global coverage thresholds. Pull requests that lower code coverage will automatically be rejected by our CI/CD pipeline.

To ensure your changes don’t break existing functionality, you must run the relevant test suites before committing:

Backend Tests

The backend uses native bun test with an in-memory SQLite database.

cd backend
bun test --coverage

(Coverage threshold: 65%)

Mocking Tips: If you are adding new controllers, use spyOn and mock from "bun:test" to mock the Service layers. We avoid mocking the database directly to keep the integration layer robust.

Dashboard Tests

The dashboard uses vitest alongside happy-dom for browser environment simulation.

cd dashboard
bun run test:coverage

(Coverage threshold: 80%)

Widget Tests

The widget also relies on vitest and happy-dom.

cd widget
bun run test:coverage

(Coverage threshold: 80%)


Code Style & Linting

Diskus uses Biome as our singular tool to enforce consistent code styling and catch errors quickly across the entire monorepo.

Before committing, please ensure your code passes the linter:

bun run lint

To automatically fix formatting and linting issues, run:

bunx biome check --apply .

Pull Request Process

  1. Fork the repo and create your branch from main.
  2. Write clear code and add tests if you are adding new functionality or fixing a bug.
  3. Run tests & linter locally to ensure everything is green and coverage thresholds are met.
  4. Create a Pull Request with a clear title and description.
    • Describe why you are making the change.
    • Link any relevant GitHub issues.
  5. CI/CD Checks: Our GitHub Actions will automatically run Biome (Linter) and all Test Coverage suites on your PR. Ensure they pass!
  6. Code Review: A maintainer will review your PR, suggest any tweaks, and merge it.

Reporting Bugs & Suggesting Features

We use GitHub Issues to track bugs and feature requests.

  • Bugs: Provide detailed steps to reproduce the issue, what you expected to happen, and what actually happened. Include error logs if applicable.
  • Features: Provide a clear explanation of what the feature is and why it would be beneficial to the Diskus ecosystem.

Thank you for helping make Diskus better!