Skip to content
This repository has been archived by the owner on Sep 27, 2024. It is now read-only.

Latest commit

 

History

History
107 lines (69 loc) · 3.1 KB

CONTRIBUTING.md

File metadata and controls

107 lines (69 loc) · 3.1 KB

Contributing to Rails Mini Profiler

Thank you for helping out with Rails Mini Profiler! ❤️

We welcome all support, whether on bug reports, code, design, reviews, tests, documentation, translations or just feature requests.

If you are interested in what's planned for the future, check the Next Release and Backlog projects to get an overview.

Using the Issue Tracker

Please use GitHub issues to submit bugs or feature requests.

Development

Thanks for considering to help make Rails Mini Profiler better! 🙌

Setting Up

Create a fork of Rails Mini Profiler and clone it locally. Create a new branch for your change, e.g.

git checkout -b add-awesome-new-feature

Setup RMP locally by executing:

# Setup Rails
bundle install
bin/rails db:setup

# Install Node and build assets
npm install
npm run build

Then code away!

Testing Local Changes

Rails Mini Profiler is a Rails Engine and can be tested out by mounting it in a 'real' Rails app. The Dummy application is such an app and resides in spec/dummy.

To manually test your changes simply run bin/rails server on the root level of your application. To execute the test suite run

bin/rspec

To locally test against multiple Rails versions use Appraisal:

bin/appraisal install
bin/appraisal rspec

Working with Assets

Javascript and CSS are packaged as a separate node module and bundled using Rollup. For continuous compilation and live preview first start your Rails server and then run:

npm run watch

Prepping your PR

Before opening your PR make sure to adhere to the repository code style and verify that all tests still pass. Run bin/rake to execute both tests and Rubocop

Rails Mini Profiler uses convential commits. Before opening your pull request, consider updating your commit messages accordingly. If your commits don't adhere to conventional commits maintainers will squash your commits to adhere to the guidelines.

Finally, go to GitHub and create a new Pull Request! 🚀

Other

Annotate

RMP uses Annotate to annotate models. When making changes to the schema, run

bin/annotate -i --models --exclude tests,fixtures 

to update model annotations.

Speedscope

RMP uses Speescope for Flamegraph rendering. To update to the latest release of Speedscope run

bin/rake speedscope:update

Database Support

RMP should work out with any database that Rails officially supports. To run tests or the dummy application with a specific database use the DATABASE environment variable:

DATABASE=sqlite rails s
DATABASE=postgres rails s