Skip to content

Commit 3a1feb4

Browse files
authored
Added contributing guide (#6)
1 parent 49c571b commit 3a1feb4

File tree

1 file changed

+137
-0
lines changed

1 file changed

+137
-0
lines changed

CONTRIBUTING.md

Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
# Contributing | Firebase Admin .NET SDK
2+
3+
Thank you for contributing to the Firebase community!
4+
5+
- [Have a usage question?](#question)
6+
- [Think you found a bug?](#issue)
7+
- [Have a feature request?](#feature)
8+
- [Want to submit a pull request?](#submit)
9+
- [Need to get set up locally?](#local-setup)
10+
11+
12+
## <a name="question"></a>Have a usage question?
13+
14+
We get lots of those and we love helping you, but GitHub is not the best place for them. Issues
15+
which just ask about usage will be closed. Here are some resources to get help:
16+
17+
- Go through the [guides](https://firebase.google.com/docs/admin/setup/)
18+
- Read the full [API reference](https://firebase.google.com/docs/reference/admin/)
19+
20+
If the official documentation doesn't help, try asking a question on the
21+
[Firebase Google Group](https://groups.google.com/forum/#!forum/firebase-talk/) or one of our
22+
other [official support channels](https://firebase.google.com/support/).
23+
24+
**Please avoid double posting across multiple channels!**
25+
26+
27+
## <a name="issue"></a>Think you found a bug?
28+
29+
Yeah, we're definitely not perfect!
30+
31+
Search through [old issues](https://github.com/firebase/firebase-admin-dotnet/issues) before
32+
submitting a new issue as your question may have already been answered.
33+
34+
If your issue appears to be a bug, and hasn't been reported,
35+
[open a new issue](https://github.com/firebase/firebase-admin-dotnet/issues/new). Please use the
36+
provided bug report template and include a minimal repro.
37+
38+
If you are up to the challenge, [submit a pull request](#submit) with a fix!
39+
40+
41+
## <a name="feature"></a>Have a feature request?
42+
43+
Great, we love hearing how we can improve our products! Share you idea through our
44+
[feature request support channel](https://firebase.google.com/support/contact/bugs-features/).
45+
46+
47+
## <a name="submit"></a>Want to submit a pull request?
48+
49+
Sweet, we'd love to accept your contribution!
50+
[Open a new pull request](https://github.com/firebase/firebase-admin-dotnet/pull/new/master) and fill
51+
out the provided template.
52+
53+
**If you want to implement a new feature, please open an issue with a proposal first so that we can
54+
figure out if the feature makes sense and how it will work.**
55+
56+
Make sure your changes pass our linter and the tests all pass on your local machine. We've hooked
57+
up this repo with continuous integration to double check those things for you.
58+
59+
Most non-trivial changes should include some extra test coverage. If you aren't sure how to add
60+
tests, feel free to submit regardless and ask us for some advice.
61+
62+
Finally, you will need to sign our
63+
[Contributor License Agreement](https://cla.developers.google.com/about/google-individual),
64+
and go through our code review process before we can accept your pull request.
65+
66+
### Contributor License Agreement
67+
68+
Contributions to this project must be accompanied by a Contributor License
69+
Agreement. You (or your employer) retain the copyright to your contribution.
70+
This simply gives us permission to use and redistribute your contributions as
71+
part of the project. Head over to <https://cla.developers.google.com/> to see
72+
your current agreements on file or to sign a new one.
73+
74+
You generally only need to submit a CLA once, so if you've already submitted one
75+
(even if it was for a different project), you probably don't need to do it
76+
again.
77+
78+
### Code reviews
79+
80+
All submissions, including submissions by project members, require review. We
81+
use GitHub pull requests for this purpose. Consult
82+
[GitHub Help](https://help.github.com/articles/about-pull-requests/) for more
83+
information on using pull requests.
84+
85+
86+
## <a name="local-setup"></a>Need to get set up locally?
87+
88+
### Initial Setup
89+
90+
Run the following commands from the command line to get your local environment set up:
91+
92+
```bash
93+
$ git clone https://github.com/firebase/firebase-admin-dotnet.git
94+
$ cd firebase-admin-dotnet/FirebaseAdmin # Change into the FirebaseAdmin solution directory
95+
$ dotnet restore # Install dependencies
96+
```
97+
98+
### Running Tests
99+
100+
There are two test suites, housed under two separate subdirectories:
101+
102+
* `FirebaseAdmin/FirebaseAdmin.Tests`: Unit tests
103+
* `FirebaseAdmin/FirebaseAdmin.IntegrationTests`: Integration tests
104+
105+
The unit test suite is intended to be run during development, and the integration test suite is
106+
intended to be run before packaging up release candidates.
107+
108+
To run the unit test suite:
109+
110+
```bash
111+
$ dotnet test FirebaseAdmin.Tests
112+
```
113+
114+
The integration test suite requires a service account JSON key file, and an API key for a Firebase
115+
project. Create a new project in the [Firebase console](https://console.firebase.google.com) if
116+
you do not already have one. Use a separate, dedicated project for integration tests since the
117+
test suite makes a large number of writes to the Firebase realtime database. Download the service
118+
account key file from the "Settings > Service Accounts" page of the project, and copy it to
119+
`FirebaseAdmin/FirebaseAdmin.IntegrationTests/resources/integration_cert.json`. Also obtain the
120+
API key for the same project from "Settings > General", and save it to
121+
`FirebaseAdmin/FirebaseAdmin.IntegrationTests/resources/integration_apikey.txt`. Finally, to run
122+
the integration test suite:
123+
124+
```bash
125+
$ dotnet test FirebaseAdmin.IntegrationTests
126+
```
127+
128+
### Repo Organization
129+
130+
Here are some highlights of the directory structure and notable source files
131+
132+
* `FirebaseAdmin/` - Solution directory containing all source code and tests.
133+
* `FirebaseAdmin.sln/` - Visual Studio solution file for the project.
134+
* `FirebaseAdmin/` - Source directory.
135+
* `FirebaseAdmin.Tests/` - Unit tests directory.
136+
* `FirebaseAdmin.IntegrationTests/` - Integrarion tests directory.
137+

0 commit comments

Comments
 (0)