• This repository has been archived on 13/Oct/2021
  • Stars
    star
    194
  • Rank 200,219 (Top 4 %)
  • Language
    Ruby
  • License
    MIT License
  • Created almost 11 years ago
  • Updated over 6 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

DEPRECATED - Your new best friend for isolated testing environments on Heroku.

This project is deprecated...

Our friends at Heroku have used Fourchette and used it as an inspiration for their "Review Apps". We have decided to move from Fourchette ourselves to the "official" way and we strongly encourage you to do so.

Fourchette
Your new best friend for isolated testing environments on Heroku
Coverage Status Gem Version

Fourchette is your new best friend for having isolated testing environments. It will help you test your @GitHub PRs against a fork of one your @Heroku apps. You will have one Heroku app per PR now. Isn't that amazing? It will make testing way easier and you won't have the (maybe) broken code from other PRs on staging but only the code that requires testing.

Fourchette is maintained by @jipiboily! You can see the other contributors here.

IMPORTANT: Please note that forking your Heroku app means it will copy the same addon plans and that you will pay for multiple apps and their addons. Watch out!

Table of content

  1. How does that work exactly?

How does that work exactly?

  1. A PR is created against your GitHub project
  • Fourchette then receives an event via GitHub Hooks:
    • It forks an environment making it available to you
    • Any new commit against that PR will update the code
  • Closing the PR will delete the forked app
  • Re-opening the PR will re-create a fork

We use it a lot at Rainforest QA. If you want to see a sample Fourchette app, here is one for you to look at: https://github.com/rainforestapp/rf-ourchette.

Installation

You have two choices here, the easy path, or the manual path.

Easy

Deploy to Heroku

Manual

This will give you more flexibility to create before and after actions, though you could also do it with the easy path and cloning your repo, etc.

  1. run gem install fourchette
  2. run fourchette new my-app-name. You can replace "my-app-name" by whatever you want it, this is the name of the directory your Fourchette app will be created in.
  3. run cd my-app-name (replace app name, again)
  4. run git init && git add . && git commit -m "Initial commit :tada:"
  5. push to Heroku
  6. configure the right environment variables (see #configuration)
  7. Enable your Fourchette instance

Configuration

  • export FOURCHETTE_GITHUB_PROJECT="rainforestapp/fourchette"
  • export FOURCHETTE_GITHUB_USERNAME="rainforestapp"
  • export FOURCHETTE_GITHUB_PERSONAL_TOKEN='a token here...' # You can create one here: https://github.com/settings/applications
  • export FOURCHETTE_HEROKU_API_KEY="API key here"
  • export FOURCHETTE_HEROKU_APP_TO_FORK='the name of the app to fork from'
  • export FOURCHETTE_APP_URL="https://fourchette-app.herokuapp.com"
  • export FOURCHETTE_HEROKU_APP_PREFIX="fourchette" # This is basically to namespace your forks. In that example, they would be named "fourchette-pr-1234" where "1234" is the PR number. Beware, the name can't be more than 30 characters total! It will be changed to be lowercase only, so you should probably just use lowercase characters anyways.

IMPORTANT: the GitHub user needs to be an admin of the repo to be able to add, enable or disable the web hook used by Fourchette. You could create it by hand if you prefer.

Enable your Fourchette instance

run bundle exec rake fourchette:enable

Enable, disable, update or delete the hook

bundle exec rake -T will tell you the rake tasks available. There are tasks to enable, disable or delete the GitHub hook to your Fourchette instance. There is also one to update the hook. That last one is mostly for development, if your local tunnel URL changed and you want to update the hook's URL.

Before & after steps, aka, callbacks

You need to run steps before and/or after the creation of your new Heroku app? Let's say you want to run mirgations after deploying new code. There is a simple (and primitive) way of doing it. It might not be perfect but will work until there is a cleaner and more flexible way of doing so, if required.

Create a file in your project to override the Fourchette::Callbacks class and include it after Fourchette.

You just want to override the before or after methods of Fourchette::Callbacks (lib/fourchette/callbacks.rb) to suit your needs. In those methods, you have access to GitHub's hook data via the @param instance variable.

Rake tasks

rake fourchette:console  # Brings up a REPL with the code loaded
rake fourchette:delete   # This deletes the Fourchette hook
rake fourchette:disable  # This disables Fourchette hook
rake fourchette:enable   # This enables Fourchette hook
rake fourchette:update   # This updates the Fourchette hook with the current URL of the app

QA Skip

Adding [qa skip] to the title of your pull request will cause Fourchette to ignore the pull request. This is inspired by the [ci skip] directive that various ci tools support.

Async processing note

Fourchette uses Sucker Punch, "a single-process Ruby asynchronous processing library". No need for redis or extra processes. It also mean you can run it for free on Heroku, if this is what you want.

License

See here

Contribute

  • fork & clone
  • bundle install
  • foreman start
  • You now have the app running on port 9292

Bonus: if you need a tunnel to your local dev machine to work with GitHub hooks, you might want to look at https://ngrok.com/.

Logging

If you want the maximum output in your GitHub comments, set this environment variable:

export DEBUG='true'

Thanks to...

More Repositories

1

heroku.json

Setting up Heroku apps made easy.
Ruby
163
star
2

decaf

Coffeescript to ES.next transpiler. Now maintained over at
JavaScript
106
star
3

http-exceptions

Rescue from any http exceptions.
Ruby
94
star
4

react-pusher

A react component for handling pusher subscriptions
JavaScript
52
star
5

rainforest-cli

Command line interface to Rainforest
Go
43
star
6

Docker-Terminal

A terminal for Docker containers in js!
JavaScript
42
star
7

tester-chrome-extension

A Chrome Extension for Rainforest Testers that notifies of new work!
JavaScript
35
star
8

accessibility

Simple chrome extension to notify websites of your accessibility requirements.
JavaScript
16
star
9

destimator

Describe your scikit-learn estimators for posterity!
Python
15
star
10

fourchette-app

Deployable version of the Fourchette core - https://github.com/rainforestapp/fourchette
Ruby
15
star
11

circlemator

A bucket of tricks for automating CircleCI and Github
Ruby
15
star
12

github-chrome

Github for Chrome!
JavaScript
14
star
13

vagrant-camera

Capture Screenshots of your Virtual Box Vagrant VM's
Ruby
10
star
14

doorman

Your personal doorman
CoffeeScript
8
star
15

amazon-s3-redirects

Tiny web-app to help you make Amazon S3 redirects
Ruby
8
star
16

elixir_smtp

Send emails with SMTP and Elixir
Elixir
7
star
17

pronto-commentator

A simple code review tool for Pronto.
Ruby
7
star
18

arp

Retrieve the content of the ARP cache
Ruby
6
star
19

github-action

Easily trigger a Rainforest Run from your GitHub workflows
Shell
5
star
20

queue_classic_plus

QueueClassicPlus is queue_classic with batteries included
Ruby
4
star
21

mc.uploader

A tool to upload markdown files with frontmatter to contentful
JavaScript
4
star
22

get_env

Read values from ENV in a reasonable way
Ruby
4
star
23

omniauth-protect

Protects your Rails app from Omniauth request phase CSRF vulnerability
Ruby
3
star
24

queue_classic_matchers

RSpec matchers for queue_classic
Ruby
2
star
25

Flashlight-vnc

Rainforest's fork of Flashlight-vnc
ActionScript
2
star
26

digestive

A simple email digest of what your team did today on GitHub.
Python
2
star
27

GitSatisfaction

GetSatisfaction using Github Issues
Python
2
star
28

do-this-from-day-0

Stuff you should do from day 0, to minimize technical debt.
1
star
29

rainforest-python

โš ๏ธ Unmaintained โš ๏ธ Rainforest API Python bindings
Python
1
star
30

rainforest-orb

Rainforest QA CircleCI Orb
Ruby
1
star
31

rf-stylez

Styles for Rainforest code
Ruby
1
star
32

seguranca

Auto update an AWS security group to allow traffic from Rainforest QA tests
Go
1
star
33

rf-ourchette

This is our app using Fourchette (https://github.com/rainforestapp/fourchette) to fork our Heroku app on PR creation.
Ruby
1
star
34

rainforest-cordova-plugin

Rainforest plugin for Cordova projects
JavaScript
1
star
35

spcedge

Cutting-Edge Scientific Python Stack on Ubuntu Using Vagrant and Ansible
1
star
36

rainforest_ruby_runtime

Ruby
1
star
37

sample-capybara-test

Ruby
1
star
38

docker-aws-cli

A docker image with Docker and AWS CLI installed (useful for CD pipelines for ECR)
Dockerfile
1
star
39

middleman-async-loader

Generates javascript to asynchronously inject scripts and stylesheets
Ruby
1
star
40

jasmine-basic-part-1-examples

Companion repo for the first part of our intro to Jasmine
JavaScript
1
star