You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thank you for contributing to Firebase Admin SDK for Dart! This guide will help you get set up and familiar with the project conventions.
3
+
Thank you for contributing to the Firebase community!
4
4
5
-
## Contributor License Agreement
5
+
-[Have a usage question?](#have-a-usage-question)
6
+
-[Think you found a bug?](#think-you-found-a-bug)
7
+
-[Have a feature request?](#have-a-feature-request)
8
+
-[Want to submit a pull request?](#want-to-submit-a-pull-request)
9
+
-[Need to get set up locally?](#need-to-get-set-up-locally)
10
+
11
+
## Have a usage question?
12
+
13
+
We get lots of those and we love helping you, but GitHub is not the best place for them. Issues which just ask about usage will be closed. Here are some resources to get help:
14
+
15
+
- Go through the [Firebase Admin SDK setup guide](https://firebase.google.com/docs/admin/setup/)
16
+
- Read the full [API reference](https://pub.dev/documentation/dart_firebase_admin/latest/)
17
+
18
+
If the official documentation doesn't help, try asking on [Stack Overflow](https://stackoverflow.com/questions/tagged/firebase+dart).
19
+
20
+
**Please avoid double posting across multiple channels!**
21
+
22
+
## Think you found a bug?
23
+
24
+
Search through [existing issues](https://github.com/invertase/dart_firebase_admin/issues) before opening a new one — your question may have already been answered.
25
+
26
+
If your issue appears to be a bug and hasn't been reported, [open a new issue](https://github.com/invertase/dart_firebase_admin/issues/new) using the bug report template and include a minimal repro.
27
+
28
+
If you are up to the challenge, [submit a pull request](#want-to-submit-a-pull-request) with a fix!
29
+
30
+
## Have a feature request?
31
+
32
+
Share your idea through our [feature request support channel](https://firebase.google.com/support/contact/bugs-features/).
33
+
34
+
## Want to submit a pull request?
35
+
36
+
Sweet, we'd love to accept your contribution! [Open a new pull request](https://github.com/invertase/dart_firebase_admin/pulls) and fill out the provided template.
37
+
38
+
**If you want to implement a new feature, please open an issue with a proposal first so that we can figure out if the feature makes sense and how it will work.**
39
+
40
+
### Contributor License Agreement
6
41
7
42
Contributions to this project must be accompanied by a Contributor License Agreement (CLA). You (or your employer) retain the copyright to your contribution; the CLA gives us permission to use and redistribute your contributions as part of the project.
8
43
9
44
Visit <https://cla.developers.google.com/> to see your current agreements on file or to sign a new one. You generally only need to submit a CLA once, so if you have already submitted one you probably don't need to do it again.
10
45
11
-
## Code Reviews
46
+
###Code Reviews
12
47
13
48
All submissions, including submissions by project members, require review. We use GitHub pull requests for this purpose. Consult [GitHub Help](https://help.github.com/articles/about-pull-requests/) for more information on pull requests.
14
49
15
-
## Getting Started
50
+
### Commit Messages
51
+
52
+
- Write clear, descriptive commit messages.
53
+
- Use imperative mood (e.g., "Add App Check token verification" not "Added App Check token verification").
54
+
- Reference issues with `#number` where applicable.
55
+
56
+
## Need to get set up locally?
16
57
17
58
### Prerequisites
18
59
@@ -21,6 +62,7 @@ All submissions, including submissions by project members, require review. We us
21
62
-**Node.js** (required for the Firebase Emulator and Cloud Tasks emulator)
22
63
-**Melos** — Dart monorepo tool (`dart pub global activate melos`)
Start the emulators, then run with the relevant environment variables:
142
+
143
+
```bash
144
+
firebase emulators:start --only firestore,auth
145
+
146
+
export FIRESTORE_EMULATOR_HOST=localhost:8080
147
+
export FIREBASE_AUTH_EMULATOR_HOST=localhost:9099
148
+
dart test test/firestore/firestore_integration_test.dart
149
+
```
150
+
151
+
#### Production Integration Tests
152
+
153
+
Requires a real Firebase project and Google application default credentials. Authorise `gcloud` first:
154
+
155
+
```bash
156
+
gcloud beta auth application-default login
157
+
```
99
158
100
-
# Run production integration tests (requires real credentials)
101
-
# Set GOOGLE_APPLICATION_CREDENTIALS and RUN_PROD_TESTS=true first
102
-
dart test test/app/firebase_app_prod_test.dart --concurrency=1
159
+
Then run with `RUN_PROD_TESTS=true`:
160
+
161
+
```bash
162
+
RUN_PROD_TESTS=true dart test test/app/firebase_app_prod_test.dart --concurrency=1
103
163
```
104
164
165
+
See [`README.md`](README.md) for Firebase project setup details. You can create a project in the [Firebase Console](https://console.firebase.google.com) if you don't have one already.
166
+
105
167
### Code Formatting and Analysis
106
168
107
169
```bash
@@ -117,11 +179,10 @@ dart analyze
117
179
118
180
### License Headers
119
181
120
-
All source files must include a license header. The project uses [addlicense](https://github.com/google/addlicense) to manage this automatically, with two templates in `.github/licenses/`:
182
+
All source files must include a license header. The project uses [addlicense](https://github.com/google/addlicense) to manage this automatically, with templates in `.github/licenses/`:
121
183
122
-
-`default.txt` — plain text, applied to TypeScript (`/** */`) and shell (`#`) files; addlicense adds the correct comment style per file type
123
-
124
-
Dart files use the built-in `-l apache` license type instead of a custom template, which handles the `//` comment style and year substitution natively.
184
+
-`default.txt` — plain text, applied to TypeScript (`/** */`) and shell (`#`) files
185
+
- Dart files use the built-in `-l apache` type, which handles `//` style and year substitution natively
-**Unit/emulator tests** go in the appropriate subdirectory under `test/`. Use the `helpers.dart` utilities and `mocktail` for mocking where needed.
190
251
-**Integration tests** (files named `*_integration_test.dart`) run against the Firebase Emulator in CI.
191
252
-**Production tests** (files named `*_prod_test.dart`) require real credentials and are not run in CI by default — gate them behind `RUN_PROD_TESTS`.
192
-
- Maintain the overall coverage above the **40% threshold** enforced by CI.
193
-
194
-
## Pull Request Process
195
-
196
-
1. Create a feature branch from `main`.
197
-
2. Make your changes, including tests.
198
-
3. Run formatting, analysis, and tests locally (see commands above).
199
-
4. Push your branch and open a pull request.
200
-
5. Fill in the PR description:
201
-
-**What** the change does and **why**.
202
-
- Link to any related issues.
203
-
- Note any breaking changes.
204
-
6. CI will run automatically. All checks must pass before merging.
205
-
7. A project maintainer will review and may request changes.
206
-
207
-
### Commit Messages
208
-
209
-
- Write clear, descriptive commit messages.
210
-
- Use imperative mood (e.g., "Add App Check token verification" not "Added App Check token verification").
211
-
- Reference issues with `#number` where applicable.
253
+
- Maintain overall coverage above the **40% threshold** enforced by CI.
212
254
213
255
## CI/CD
214
256
215
-
The project uses a single **build.yml** GitHub Actions workflow with four jobs:
257
+
The project uses a single **build.yml** GitHub Actions workflow:
216
258
217
259
| Job | Trigger | What it does |
218
260
|-----|---------|--------------|
@@ -222,7 +264,7 @@ The project uses a single **build.yml** GitHub Actions workflow with four jobs:
222
264
|`test-integration`| PRs (non-fork) & schedule | Runs production integration tests with Workload Identity Federation |
223
265
|`build`| After all above pass | Validates `dart pub publish --dry-run`|
224
266
225
-
Tests run against both `stable` and `beta` Dart SDK channels. Coverage is reported as a PR comment and uploaded to Codecov. The minimum coverage threshold is **40%**.
267
+
Tests run against both `stable` and `beta` Dart SDK channels. Coverage is reported as a PR comment and uploaded to Codecov. The minimum threshold is **40%**.
0 commit comments