Skip to content

Commit cf16279

Browse files
committed
chore: update contributing guidelines and license year
1 parent ce7b1ef commit cf16279

File tree

2 files changed

+106
-64
lines changed

2 files changed

+106
-64
lines changed

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@
186186
same "printed page" as the copyright notice for easier
187187
identification within third-party archives.
188188

189-
Copyright 2020 Invertase Limited
189+
Copyright 2026 Google LLC
190190

191191
Licensed under the Apache License, Version 2.0 (the "License");
192192
you may not use this file except in compliance with the License.

packages/dart_firebase_admin/CONTRIBUTING.md

Lines changed: 105 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,59 @@
11
# Contributing to Firebase Admin SDK for Dart
22

3-
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!
44

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
641

742
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.
843

944
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.
1045

11-
## Code Reviews
46+
### Code Reviews
1247

1348
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.
1449

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?
1657

1758
### Prerequisites
1859

@@ -21,6 +62,7 @@ All submissions, including submissions by project members, require review. We us
2162
- **Node.js** (required for the Firebase Emulator and Cloud Tasks emulator)
2263
- **Melos** — Dart monorepo tool (`dart pub global activate melos`)
2364
- **Firebase CLI** (`npm install -g firebase-tools`)
65+
- **Google Cloud SDK** ([`gcloud`](https://cloud.google.com/sdk/downloads)) — required to authorise integration tests against a real Firebase project
2466

2567
### Setup
2668

@@ -41,48 +83,44 @@ All submissions, including submissions by project members, require review. We us
4183
dart analyze
4284
```
4385

44-
## Development Workflow
86+
### Repo Organization
4587

46-
### Project Structure
88+
This repository is a monorepo managed by [Melos](https://melos.invertase.dev/).
4789

4890
```
4991
dart_firebase_admin/ # Workspace root
5092
├── packages/
51-
│ └── dart_firebase_admin/
52-
│ ├── lib/
53-
│ │ ├── dart_firebase_admin.dart # Public API barrel file
54-
│ │ ├── auth.dart # Auth public exports
55-
│ │ ├── firestore.dart # Firestore public exports
56-
│ │ ├── messaging.dart # Messaging public exports
57-
│ │ ├── storage.dart # Storage public exports
58-
│ │ ├── app_check.dart # App Check public exports
59-
│ │ ├── security_rules.dart # Security Rules public exports
60-
│ │ ├── functions.dart # Functions public exports
61-
│ │ └── src/ # Private implementation
62-
│ │ ├── app/ # FirebaseApp & credential management
63-
│ │ ├── auth/ # Authentication (users, tenants, tokens)
64-
│ │ ├── app_check/ # App Check token verification
65-
│ │ ├── firestore/ # Firestore wrapper
66-
│ │ ├── messaging/ # FCM messaging
67-
│ │ ├── storage/ # Cloud Storage
68-
│ │ ├── security_rules/ # Security Rules management
69-
│ │ ├── functions/ # Cloud Functions invocation
70-
│ │ └── utils/ # Shared utilities
71-
│ └── test/
72-
│ ├── auth/ # Auth unit & integration tests
73-
│ ├── app/ # App unit & integration tests
74-
│ ├── firestore/ # Firestore tests
75-
│ ├── messaging/ # Messaging tests
76-
│ ├── storage/ # Storage tests
77-
│ └── helpers.dart # Shared test utilities
93+
│ ├── dart_firebase_admin/ # Main Firebase Admin SDK package
94+
│ │ ├── lib/
95+
│ │ │ ├── dart_firebase_admin.dart # Public API barrel file
96+
│ │ │ ├── auth.dart # Auth public exports
97+
│ │ │ ├── firestore.dart # Firestore public exports
98+
│ │ │ ├── messaging.dart # Messaging public exports
99+
│ │ │ ├── storage.dart # Storage public exports
100+
│ │ │ ├── app_check.dart # App Check public exports
101+
│ │ │ ├── security_rules.dart # Security Rules public exports
102+
│ │ │ ├── functions.dart # Functions public exports
103+
│ │ │ └── src/ # Private implementation
104+
│ │ └── test/
105+
│ │ ├── auth/ # Auth unit & integration tests
106+
│ │ ├── app/ # App unit & integration tests
107+
│ │ ├── firestore/ # Firestore tests
108+
│ │ ├── messaging/ # Messaging tests
109+
│ │ ├── storage/ # Storage tests
110+
│ │ └── helpers.dart # Shared test utilities
111+
│ └── google_cloud_firestore/ # Standalone Firestore package
78112
└── scripts/
79113
├── coverage.sh # Run tests with coverage
80114
└── firestore-coverage.sh # Firestore package coverage
81115
```
82116

117+
## Development Workflow
118+
83119
### Running Tests
84120

85-
Tests are split into unit tests (run against emulators) and integration/production tests (run against a real Firebase project).
121+
Tests are split into unit/emulator tests and production integration tests.
122+
123+
#### Unit and Emulator Tests
86124

87125
```bash
88126
# From packages/dart_firebase_admin
@@ -96,12 +134,36 @@ firebase emulators:exec --project dart-firebase-admin --only auth,firestore,func
96134

97135
# Run a specific test file
98136
dart test test/auth/auth_test.dart
137+
```
138+
139+
#### Integration Tests with Emulator Suite
140+
141+
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+
```
99158

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
103163
```
104164

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+
105167
### Code Formatting and Analysis
106168

107169
```bash
@@ -117,11 +179,10 @@ dart analyze
117179

118180
### License Headers
119181

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/`:
121183

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
125186

126187
**Install addlicense:**
127188

@@ -189,30 +250,11 @@ The project uses strict analysis settings (`strict-casts`, `strict-inference`, `
189250
- **Unit/emulator tests** go in the appropriate subdirectory under `test/`. Use the `helpers.dart` utilities and `mocktail` for mocking where needed.
190251
- **Integration tests** (files named `*_integration_test.dart`) run against the Firebase Emulator in CI.
191252
- **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.
212254

213255
## CI/CD
214256

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:
216258

217259
| Job | Trigger | What it does |
218260
|-----|---------|--------------|
@@ -222,7 +264,7 @@ The project uses a single **build.yml** GitHub Actions workflow with four jobs:
222264
| `test-integration` | PRs (non-fork) & schedule | Runs production integration tests with Workload Identity Federation |
223265
| `build` | After all above pass | Validates `dart pub publish --dry-run` |
224266

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%**.
226268

227269
## License
228270

0 commit comments

Comments
 (0)