Skip to content

Contributing

Issue queue

Report bugs and feature requests on the drupal.org issue queue.

Source code

Pull requests are accepted on GitHub and mirrored to drupal.org.

Branch conventions

  • 1.x: main development branch
  • Feature branches: feat/<description> or feature/<description>
  • Bug fixes: fix/<description>

Coding standards

The project enforces Drupal coding standards and ESLint for JavaScript. All checks run automatically on pull requests.

PHP (Drupal coding standards)

docker compose --profile lint run --rm drupal-lint

Auto-fix coding standard violations:

docker compose --profile lint run --rm drupal-lint-auto-fix

Drupal compatibility

docker compose --profile lint run --rm drupal-check

JavaScript (ESLint)

npm ci
npx eslint .

Running tests

The project uses end-to-end tests via Drush commands against a real Drupal site. To run the full test suite locally:

docker compose --profile test run --rm e2e-test

Architecture overview

The module is built around these core services:

  • rl.experiment_manager: records turns (impressions) and rewards (conversions)
  • rl.ts_calculator: Thompson Sampling algorithm implementation
  • rl.experiment_registry: experiment registration and lookup
  • rl.cache_manager: page cache lifetime management
  • rl.analyzer: experiment analysis and recommendations

Consumer modules (like rl_sorting, rl_page_title, rl_menu_link) extend the core by registering experiments and implementing variant selectors and decorators. Each consumer provides an experiment entity, a selector service extending VariantSelectorBase, a report decorator, and tracking JS. See the Building a Consumer Module guide for a detailed walkthrough using rl_page_title and rl_menu_link as worked examples.