Skip to content
This repository
Newer
Older
100644 113 lines (68 sloc) 3.877 kb
06949c16 »
2011-10-21 Wrote a quick guide for contributing to Active Admin
1 ## Contributing
2
3 This is a guide to contributing to Active Admin. It should walk you through the
4 major steps to contributing code to the project.
5
6 ### 1. Create an Issue on Github
7
8 The first step to contributing to Active Admin is creating a ticket in our
7bae7b13 » Rhys Powell
2011-11-27 Quickly fixed a typo in CONTRIBUTING.md
9 [ticketing system on Github](https://github.com/gregbell/active_admin/issues).
06949c16 »
2011-10-21 Wrote a quick guide for contributing to Active Admin
10 The community has been hard at work already, so please take a second to search
11 for the issue or feature before creating a new one.
12
13 All features or bug fixes should have a ticket. This makes it easy for everyone
14 to discuss the code and know if a fix is already in progress for an issue. If
15 it's a feature, the team can prioritize what it should work on based on these
16 tickets.
17
18
19 ### 2. Fork & Create a Feature Branch
20
21 The next step is to fork Active Admin (if you haven't already done so) and
22 create a new git branch based on the feature or issue you're working on. Please
23 use a descriptive name for your branch.
24
25 For example a great branch name would be (where issue #325 is the ticket you're
26 working on):
27
28 $> git checkout -b 325-add-japanese-translations
29
30
31 ### 3. Get the test suite running
32
33 Active Admin is a gem that many people and businesses rely on for managing data
34 in their production applications. Bugs are not cool. Although we're not perfect,
35 we pride ourselves on writing well tested code. I hope you do too :)
36
37 Active Admin uses rspec and cucumber for it's test suite.
38
39 Make sure you have a recent version of bundler:
40
41 $> gem install bundler
42
43 Then install the development the development dependencies:
44
45 $> bundle install
46
47 Now you should be able to run the entire suite using:
48
49 $> rake test
50
51 `rake test` runs the unit specs, integration specs and cucumber scenarios. The
52 test suite will generate a rails application in `spec/rails` to run the tests
53 against.
54
55
56 ### 4. Implement your fix or feature
57
58 At this point, you should be ready to implement your feature!
59
60
61 ### 5. View your changes in a Rails application
62
63 Active Admin is meant to be used by humans, not cucumbers. So make sure to take
64 a look at your changes in a browser (preferably a few browsers if you made view
65 changes).
66
67 To boot up a test rails application, use the provided script:
68
69 $> ./script/local server
70
71 This will generate a rails application at ./test-rails-app with some sane
72 defaults and use your local version of Active Admin.
73
74 If you have any Bundler issues, call the provided `use_rails` script then prepend
75 the version of rails you would like to use in an environment variable:
76
77 $> ./script/use_rails 3.1.0
78 $> RAILS=3.1.0 ./script/local server
79
80 You should be able to open `http://localhost:3000/admin` and view a test
81 environment.
82
83 If you need to perform any other commands on the test application, use the
84 `local` script. For example to boot the rails console:
85
86 $> ./script/local console
87
88 Or to migrate the database:
89
90 $> ./script/local rake db:migrate
91
92
93 ### 6. Run tests against major supported rails versions
94
95 Once you've implemented your code, got the tests passing, previewed it in a
96 browser, you're ready to test it against multiple versions of Rails.
97
98 $> rake test:major_supported_rails
99
100 This command runs the cukes and specs against a couple of major versions of
101 Rails. We will run this command when we review your pull request, if this
102 rake task isn't passing, the pull request will not be merged in.
103
104
105 ### 7. Make a pull request
106
107 At this point, you should switch back to your master branch and make sure it's
108 up to date with Active Admin's master branch. If there were any changes, you
109 should rebase your feature branch and make sure that it will merge correctly. If
110 there are any merge conflicts, your pull request will not be merged in.
111
112 Now push your changes up to your feature branch on github and make a pull request!
113 We will pull your changes, run the test suite, review the code and merge it in.
Something went wrong with that request. Please try again.