Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 145 lines (99 sloc) 4.121 kb
06949c1 @gregbell Wrote a quick guide for contributing to Active Admin
gregbell authored
1 ## Contributing
2
bd8a608 @seanlinsley update CONTRIBUTING.md
seanlinsley authored
3 First off, thank you for considering contributing to Active Admin. It's people
4 like you that make Active Admin such a great tool.
06949c1 @gregbell Wrote a quick guide for contributing to Active Admin
gregbell authored
5
bd8a608 @seanlinsley update CONTRIBUTING.md
seanlinsley authored
6 ### 1. Where do I go from here?
06949c1 @gregbell Wrote a quick guide for contributing to Active Admin
gregbell authored
7
bd8a608 @seanlinsley update CONTRIBUTING.md
seanlinsley authored
8 If you've noticed a bug or have a question that doesn't belong on the
9 [mailing list](http://groups.google.com/group/activeadmin) or
10 [Stack Overflow](http://stackoverflow.com/questions/tagged/activeadmin),
03a1c14 @timoschilling update issues tracker search url in CONTRIBUTING
timoschilling authored
11 [search the issue tracker](https://github.com/activeadmin/activeadmin/issues?q=something)
bd8a608 @seanlinsley update CONTRIBUTING.md
seanlinsley authored
12 to see if someone else in the community has already created a ticket.
a3fc6dd @seanlinsley ✏️
seanlinsley authored
13 If not, go ahead and [make one](https://github.com/activeadmin/activeadmin/issues/new)!
06949c1 @gregbell Wrote a quick guide for contributing to Active Admin
gregbell authored
14
bd8a608 @seanlinsley update CONTRIBUTING.md
seanlinsley authored
15 ### 2. Fork & create a branch
06949c1 @gregbell Wrote a quick guide for contributing to Active Admin
gregbell authored
16
bd8a608 @seanlinsley update CONTRIBUTING.md
seanlinsley authored
17 If this is something you think you can fix, then
18 [fork Active Admin](https://help.github.com/articles/fork-a-repo)
19 and create a branch with a descriptive name.
06949c1 @gregbell Wrote a quick guide for contributing to Active Admin
gregbell authored
20
f629781 @seanlinsley update contributing docs
seanlinsley authored
21 A good branch name would be (where issue #325 is the ticket you're working on):
06949c1 @gregbell Wrote a quick guide for contributing to Active Admin
gregbell authored
22
1f4f90c @seanlinsley update CONTRIBUTING.md
seanlinsley authored
23 ```sh
24 git checkout -b 325-add-japanese-translations
25 ```
06949c1 @gregbell Wrote a quick guide for contributing to Active Admin
gregbell authored
26
27 ### 3. Get the test suite running
28
1f4f90c @seanlinsley update CONTRIBUTING.md
seanlinsley authored
29 Install the development dependencies:
bd8a608 @seanlinsley update CONTRIBUTING.md
seanlinsley authored
30
1f4f90c @seanlinsley update CONTRIBUTING.md
seanlinsley authored
31 ```sh
32 bundle install
33 ```
06949c1 @gregbell Wrote a quick guide for contributing to Active Admin
gregbell authored
34
35 Now you should be able to run the entire suite using:
bd8a608 @seanlinsley update CONTRIBUTING.md
seanlinsley authored
36
1f4f90c @seanlinsley update CONTRIBUTING.md
seanlinsley authored
37 ```sh
38 rake test
39 ```
06949c1 @gregbell Wrote a quick guide for contributing to Active Admin
gregbell authored
40
1f4f90c @seanlinsley update CONTRIBUTING.md
seanlinsley authored
41 Which will generate a rails application in `spec/rails` to run the tests against.
06949c1 @gregbell Wrote a quick guide for contributing to Active Admin
gregbell authored
42
bd8a608 @seanlinsley update CONTRIBUTING.md
seanlinsley authored
43 If your tests are passing locally but they're failing on Travis, reset your test environment:
44
af32388 @seanlinsley update CONTRIBUTING.md
seanlinsley authored
45 ```sh
46 rm -rf spec/rails && bundle update
47 ```
48
06949c1 @gregbell Wrote a quick guide for contributing to Active Admin
gregbell authored
49 ### 4. Implement your fix or feature
50
a3fc6dd @seanlinsley ✏️
seanlinsley authored
51 At this point, you're ready to make your changes! Feel free to ask for help;
f629781 @seanlinsley update contributing docs
seanlinsley authored
52 everyone is a beginner at first :smile_cat:
06949c1 @gregbell Wrote a quick guide for contributing to Active Admin
gregbell authored
53
54 ### 5. View your changes in a Rails application
55
56 Active Admin is meant to be used by humans, not cucumbers. So make sure to take
bd8a608 @seanlinsley update CONTRIBUTING.md
seanlinsley authored
57 a look at your changes in a browser.
06949c1 @gregbell Wrote a quick guide for contributing to Active Admin
gregbell authored
58
f629781 @seanlinsley update contributing docs
seanlinsley authored
59 To boot up a test Rails app:
bd8a608 @seanlinsley update CONTRIBUTING.md
seanlinsley authored
60
1f4f90c @seanlinsley update CONTRIBUTING.md
seanlinsley authored
61 ```sh
62 script/local server
63 ```
06949c1 @gregbell Wrote a quick guide for contributing to Active Admin
gregbell authored
64
f629781 @seanlinsley update contributing docs
seanlinsley authored
65 This will automatically create a Rails app if none already exists, and store it in the
66 `.test-rails-apps` folder. The currently active app is symlinked to `test-rails-app`.
06949c1 @gregbell Wrote a quick guide for contributing to Active Admin
gregbell authored
67
bd8a608 @seanlinsley update CONTRIBUTING.md
seanlinsley authored
68 If you have any Bundler issues, call the `use_rails` script then prepend
06949c1 @gregbell Wrote a quick guide for contributing to Active Admin
gregbell authored
69 the version of rails you would like to use in an environment variable:
bd8a608 @seanlinsley update CONTRIBUTING.md
seanlinsley authored
70
1f4f90c @seanlinsley update CONTRIBUTING.md
seanlinsley authored
71 ```sh
72 script/use_rails 4.0.0
73 RAILS=4.0.0 script/local server
74 ```
06949c1 @gregbell Wrote a quick guide for contributing to Active Admin
gregbell authored
75
764a3ce @fmendez Add credential info for the test rails app to the docs.
fmendez authored
76 You should now be able to open <http://localhost:3000/admin> in your browser. You can log in using:
77
78 User: admin@example.com
79 Password: password
06949c1 @gregbell Wrote a quick guide for contributing to Active Admin
gregbell authored
80
81 If you need to perform any other commands on the test application, use the
a3fc6dd @seanlinsley ✏️
seanlinsley authored
82 `local` script. For example:
83
84 To boot the rails console:
bd8a608 @seanlinsley update CONTRIBUTING.md
seanlinsley authored
85
1f4f90c @seanlinsley update CONTRIBUTING.md
seanlinsley authored
86 ```sh
87 script/local console
88 ```
06949c1 @gregbell Wrote a quick guide for contributing to Active Admin
gregbell authored
89
90 Or to migrate the database:
bd8a608 @seanlinsley update CONTRIBUTING.md
seanlinsley authored
91
1f4f90c @seanlinsley update CONTRIBUTING.md
seanlinsley authored
92 ```sh
93 script/local rake db:migrate
94 ```
06949c1 @gregbell Wrote a quick guide for contributing to Active Admin
gregbell authored
95
96 ### 6. Run tests against major supported rails versions
97
98 Once you've implemented your code, got the tests passing, previewed it in a
99 browser, you're ready to test it against multiple versions of Rails.
bd8a608 @seanlinsley update CONTRIBUTING.md
seanlinsley authored
100
1f4f90c @seanlinsley update CONTRIBUTING.md
seanlinsley authored
101 ```sh
102 rake test:major_supported_rails
103 ```
06949c1 @gregbell Wrote a quick guide for contributing to Active Admin
gregbell authored
104
bd8a608 @seanlinsley update CONTRIBUTING.md
seanlinsley authored
105 This runs our test suite against a couple of major versions of Rails.
106 Travis does essentially the same thing when you open a Pull Request.
107 We care about quality, so your PR won't be merged until all tests pass.
06949c1 @gregbell Wrote a quick guide for contributing to Active Admin
gregbell authored
108
bd8a608 @seanlinsley update CONTRIBUTING.md
seanlinsley authored
109 ### 7. Make a Pull Request
06949c1 @gregbell Wrote a quick guide for contributing to Active Admin
gregbell authored
110
111 At this point, you should switch back to your master branch and make sure it's
bd8a608 @seanlinsley update CONTRIBUTING.md
seanlinsley authored
112 up to date with Active Admin's master branch:
06949c1 @gregbell Wrote a quick guide for contributing to Active Admin
gregbell authored
113
bd8a608 @seanlinsley update CONTRIBUTING.md
seanlinsley authored
114 ```sh
1e938ac @seanlinsley rename active_admin to activeadmin
seanlinsley authored
115 git remote add upstream git@github.com:activeadmin/activeadmin.git
bd8a608 @seanlinsley update CONTRIBUTING.md
seanlinsley authored
116 git checkout master
117 git pull upstream master
118 ```
119
120 Then update your feature branch from your local copy of master, and push it!
121
122 ```sh
123 git checkout 325-add-japanese-translations
124 git rebase master
125 git push --set-upstream origin 325-add-japanese-translations
126 ```
127
128 Finally, go to GitHub and [make a Pull Request](https://help.github.com/articles/creating-a-pull-request) :D
129
130 ### 8. Keeping your Pull Request updated
131
132 If a maintainer asks you to "rebase" your PR, they're saying that a lot of code
133 has changed, and that you need to update your branch so it's easier to merge.
134
135 To learn more about rebasing in Git, there are a lot of
136 [good](http://git-scm.com/book/en/Git-Branching-Rebasing)
137 [resources](https://help.github.com/articles/interactive-rebase),
138 but here's the suggested workflow:
139
140 ```sh
141 git checkout 325-add-japanese-translations
142 git pull --rebase upstream master
143 git push -f 325-add-japanese-translations
144 ```
Something went wrong with that request. Please try again.