Skip to content

Commit fa17047

Browse files
authoredApr 4, 2023
Create CONTRIBUTING.md
1 parent ca6dd47 commit fa17047

File tree

1 file changed

+137
-0
lines changed

1 file changed

+137
-0
lines changed
 

‎CONTRIBUTING.md

+137
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
# Contributing to Open mSupply
2+
3+
:tada: First off, thanks for considering contributing to open mSupply! :tada:
4+
5+
The following is a set of guidelines for contributing to open mSupply. These are mostly guidelines, not rules. Use your best judgment, and feel free to propose changes to this document in a pull request.
6+
Following the guidelines shows us that you respect the time of the developers managing and developing this open source project. In return, they'll try their best to help in assessing changes, reviewing and merging as best they can!
7+
8+
### Where do I go from here?
9+
10+
If you've noticed a bug or have a feature request, [make one][new issue]! There are templates for creating issues, please try to fill in as much as you can of the pre-defined sections. That really helps!
11+
It's generally best if you get confirmation of your bug or approval for your feature request this way before starting to code.
12+
13+
Note that the issue tracker is only for bugs and feature requests. If you have a general question, please ask elsewhere.
14+
15+
The best place to start are the issues which have the label [good first issue](https://github.com/openmsupply/open-msupply/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22)
16+
17+
Working on your first Pull Request? You might find http://makeapullrequest.com/ and http://www.firsttimersonly.com/ helpful.
18+
19+
### Fork & create a branch
20+
21+
If this is something you think you can fix, then [fork Open mSupply] and create a branch with a descriptive name.
22+
23+
A good branch name would be (where issue #325 is the ticket you're working on):
24+
25+
```sh
26+
git checkout -b 325-fix-a-bug
27+
```
28+
29+
We're using the ticket number to start the branch name, and dropping the `#` because that can be a pain when using command line tools.
30+
31+
### Get the test suite running
32+
33+
Make sure you're using a recent version of rust and nodejs.
34+
35+
To get started, have a look at the [readme](README.md)
36+
37+
The repo is split into a client and server application - you'll need to have a look at both individual readme files to get the full app running.
38+
For the client app, clone the repo, install packages
39+
40+
```sh
41+
cd ./client
42+
yarn install
43+
```
44+
45+
and you can then run the client tests:
46+
47+
```sh
48+
yarn test
49+
```
50+
51+
For the server app, you'll need rust installed - and then you can
52+
53+
```sh
54+
cd ./server
55+
cargo test
56+
```
57+
58+
59+
### Implement your fix or feature
60+
61+
At this point, you're ready to make your changes! Feel free to ask for help;
62+
everyone is a beginner at first :smile_cat:
63+
64+
### View your changes in the client application
65+
66+
To see the application running, you can get up and running quickly by running this from the client folder:
67+
68+
```sh
69+
yarn start
70+
```
71+
72+
This will compile the react app and launch a browser on <http://localhost:3003>. We're using mostly chrome and firefox.. but you be you!
73+
Running `yarn start` will connect you to our [demo server](https://demo-open.msupply.org/)
74+
You can log in using:
75+
76+
*User*: developer
77+
*Password*: password
78+
79+
### Get the style right
80+
81+
Your patch should follow the same conventions & pass the same code quality checks as the rest of the project. We're using prettier for the react app, and there is typescript validation required before you can commit.
82+
The valdiation is running
83+
84+
```sh
85+
yarn pre-commit-lint
86+
```
87+
88+
and you can run that yourself to test!
89+
90+
### Make a Pull Request
91+
92+
At this point, you should switch back to your main branch and make sure it's
93+
up to date with open mSupply's develop branch:
94+
95+
```sh
96+
git remote add upstream git@github.com:openmsupply/open-msupply.git
97+
git checkout develop
98+
git pull upstream develop
99+
```
100+
101+
Then update your feature branch from your local copy of develop, and push it!
102+
103+
```sh
104+
git checkout 325-fix-a-bug
105+
git rebase develop
106+
git push --set-upstream origin 325-fix-a-bug
107+
```
108+
109+
Finally, go to GitHub and [make a Pull Request][] :D
110+
111+
Github Actions will run our test suite for changes to the server. An action will run to check the bundle size for client changes.
112+
We care about quality, so your PR won't be merged until all tests pass.
113+
114+
Thanks!! It's great to get to this point - and your contribution is much appreciated!
115+
From here - the maintainers will review and give you feedback, possibly asking for changes. Once approved, they'll merge the pull request and you're done!
116+
117+
### Keeping your Pull Request updated
118+
119+
If a maintainer asks you to "rebase" your PR, they're saying that a lot of code has changed, and that you need to update your branch so it's easier to merge.
120+
121+
To learn more about rebasing in Git, there are a lot of [good][git rebasing] [resources][interactive rebase] but here's the suggested workflow:
122+
123+
```sh
124+
git checkout 325-fix-a-bug
125+
git pull --rebase upstream develop
126+
git push --force-with-lease fix-a-bug
127+
```
128+
129+
[Stack Overflow]: http://stackoverflow.com/questions/tagged/activeadmin
130+
[new issue]: https://github.com//openmsupply/open-msupply/issues/new
131+
[fork Active Admin]: https://help.github.com/articles/fork-a-repo
132+
[make a pull request]: https://help.github.com/articles/creating-a-pull-request
133+
[git rebasing]: http://git-scm.com/book/en/Git-Branching-Rebasing
134+
[interactive rebase]: https://help.github.com/en/github/using-git/about-git-rebase
135+
[shortcut reference links]: https://github.github.com/gfm/#shortcut-reference-link
136+
[Yarn]: https://yarnpkg.com/en/docs/install
137+
[Node.js]: https://nodejs.org/en/

0 commit comments

Comments
 (0)
Please sign in to comment.