Skip to content
Edit this page View source of this page

Contribute

Thanks for helping improve Mankai. This page shows you how to set up the repository, check your change, add a changelog entry, and open a pull request. For every command and target, see Development.

The gems follow the design principles. Read them before you write code.

Set up the repository

Before you begin, install Ruby 4.0.10, which mise.toml pins. The gems themselves support Ruby 3.3 or later.

To install the root bundle and the demo app's bundle, run:

make deps

Test and lint your change

To run one spec, run RSpec from the gem's directory, or use the gem's make target from the repository root:

cd gems/mankai-jobs && bundle exec rspec spec/unit/SPEC_FILE:LINE
make test/jobs RSPEC_ARGS="spec/unit/SPEC_FILE:LINE"

Replace SPEC_FILE with the spec's path under spec/unit/, and LINE with the line of the example to run. Each gem has its own target, such as make test/jobs-sql or make test/cache. To list them, run make.

Before you open a pull request, run the linters and tests, and check that every gem builds:

make lint/all
make test/all
make build

Each gem's .rubocop.yml is a pinned copy of a shared config. Don't edit it by hand. To apply RuboCop's safe autocorrections, run make lint/fix.

make lint/all also runs ShellCheck; to run it alone, run make lint/shell. Shell scripts follow the Google Shell Style Guide, except that they keep the #!/usr/bin/env bash shebang.

Add a changelog entry

Every user-visible change needs a changelog entry in the gem that changed. Mankai uses changie to collect entries as small files called fragments. To add one, run the following command and answer the prompts:

make changie/new GEM_NAME=GEM_NAME

Replace GEM_NAME with the gem's name, for example mankai-jobs.

CI checks that a pull request that changes a gem's lib/ also adds a fragment to that gem's .changes/unreleased/. Don't edit CHANGELOG.md; changie generates it when a gem is released.

Open a pull request

Follow these rules for pull requests:

  • Keep one change per pull request, and explain why you made it.
  • Add specs for new behavior, and keep make test/all passing on SQLite.
  • Name any new dependency, and explain why it's necessary.
  • Don't commit built gems. Git ignores pkg/, and CI builds the gems itself.

Releases

Maintainers release gems by following Release a gem. Pushing a release tag starts the release, and CI publishes the gem through trusted publishing.