Skip to content

Commit e7abe6f

Browse files
authored
Merge branch 'dev' into justinattw/add-quotafailure
2 parents 501baf0 + c06a674 commit e7abe6f

File tree

15 files changed

+702
-64
lines changed

15 files changed

+702
-64
lines changed
-6 Bytes
Binary file not shown.

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ jobs:
1212

1313
steps:
1414
- name: Check out code
15-
uses: actions/checkout@v4
15+
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
1616

1717
- name: Set up Go ${{ matrix.go }}
18-
uses: actions/setup-go@v5
18+
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
1919
with:
2020
go-version: ${{ matrix.go }}
2121

.github/workflows/nightly.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ jobs:
2929

3030
steps:
3131
- name: Check out code
32-
uses: actions/checkout@v4
32+
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
3333
with:
3434
ref: ${{ github.event.client_payload.ref || github.ref }}
3535

3636
- name: Set up Go
37-
uses: actions/setup-go@v5
37+
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
3838
with:
3939
go-version: '1.23'
4040

@@ -53,7 +53,7 @@ jobs:
5353

5454
- name: Send email on failure
5555
if: failure()
56-
uses: firebase/firebase-admin-node/.github/actions/send-email@master
56+
uses: firebase/firebase-admin-node/.github/actions/send-email@2e2b36a84ba28679bcb7aecdacabfec0bded2d48 # Admin Node SDK v13.6.0
5757
with:
5858
api-key: ${{ secrets.OSS_BOT_MAILGUN_KEY }}
5959
domain: ${{ secrets.OSS_BOT_MAILGUN_DOMAIN }}
@@ -68,7 +68,7 @@ jobs:
6868

6969
- name: Send email on cancelled
7070
if: cancelled()
71-
uses: firebase/firebase-admin-node/.github/actions/send-email@master
71+
uses: firebase/firebase-admin-node/.github/actions/send-email@2e2b36a84ba28679bcb7aecdacabfec0bded2d48 # Admin Node SDK v13.6.0
7272
with:
7373
api-key: ${{ secrets.OSS_BOT_MAILGUN_KEY }}
7474
domain: ${{ secrets.OSS_BOT_MAILGUN_DOMAIN }}

.github/workflows/release.yml

Lines changed: 16 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,12 @@ jobs:
3636

3737
runs-on: ubuntu-latest
3838

39-
# When manually triggering the build, the requester can specify a target branch or a tag
40-
# via the 'ref' client parameter.
4139
steps:
4240
- name: Check out code
43-
uses: actions/checkout@v4
44-
with:
45-
ref: ${{ github.event.client_payload.ref || github.ref }}
41+
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
4642

4743
- name: Set up Go
48-
uses: actions/setup-go@v5
44+
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
4945
with:
5046
go-version: '1.23'
5147

@@ -71,57 +67,34 @@ jobs:
7167
# 3. with the label 'release:publish', and
7268
# 4. the title prefix '[chore] Release '.
7369
if: github.event.pull_request.merged &&
74-
github.ref == 'refs/heads/dev' &&
70+
github.base_ref == 'dev' &&
7571
contains(github.event.pull_request.labels.*.name, 'release:publish') &&
7672
startsWith(github.event.pull_request.title, '[chore] Release ')
7773

7874
runs-on: ubuntu-latest
7975
permissions:
80-
contents: write
76+
pull-requests: write
8177

8278
steps:
8379
- name: Checkout source for publish
84-
uses: actions/checkout@v4
80+
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
8581
with:
82+
ref: dev
8683
persist-credentials: false
8784

8885
- name: Publish preflight check
8986
id: preflight
9087
run: ./.github/scripts/publish_preflight_check.sh
9188

92-
# We authorize this step with an access token that has write access to the master branch.
93-
- name: Merge to master
94-
uses: actions/github-script@v7
95-
with:
96-
github-token: ${{ secrets.FIREBASE_GITHUB_TOKEN }}
97-
script: |
98-
github.rest.repos.merge({
99-
owner: context.repo.owner,
100-
repo: context.repo.repo,
101-
base: 'master',
102-
head: 'dev'
103-
})
104-
105-
# See: https://cli.github.com/manual/gh_release_create
106-
- name: Create release tag
89+
# Create a PR to merge dev into master.
90+
- name: Create Release PR
10791
env:
10892
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
109-
run: gh release create ${{ steps.preflight.outputs.version }}
110-
--title "Firebase Admin Go SDK ${{ steps.preflight.outputs.version }}"
111-
--notes '${{ steps.preflight.outputs.changelog }}'
112-
--target "master"
113-
114-
# Post to Twitter if explicitly opted-in by adding the label 'release:tweet'.
115-
- name: Post to Twitter
116-
if: success() &&
117-
contains(github.event.pull_request.labels.*.name, 'release:tweet')
118-
uses: firebase/firebase-admin-node/.github/actions/send-tweet@master
119-
with:
120-
status: >
121-
${{ steps.preflight.outputs.version }} of @Firebase Admin Go SDK is available.
122-
https://github.com/firebase/firebase-admin-go/releases/tag/${{ steps.preflight.outputs.version }}
123-
consumer-key: ${{ secrets.FIREBASE_TWITTER_CONSUMER_KEY }}
124-
consumer-secret: ${{ secrets.FIREBASE_TWITTER_CONSUMER_SECRET }}
125-
access-token: ${{ secrets.FIREBASE_TWITTER_ACCESS_TOKEN }}
126-
access-token-secret: ${{ secrets.FIREBASE_TWITTER_ACCESS_TOKEN_SECRET }}
127-
continue-on-error: true
93+
RELEASE_BODY: ${{ steps.preflight.outputs.changelog }}
94+
RELEASE_TITLE: "[chore] Release ${{ steps.preflight.outputs.version }}"
95+
run: |
96+
gh pr create \
97+
--base master \
98+
--head dev \
99+
--title "$RELEASE_TITLE" \
100+
--body "$RELEASE_BODY"

.github/workflows/tag_release.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Copyright 2026 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
name: Tag Release
16+
17+
on:
18+
push:
19+
branches:
20+
- master
21+
paths:
22+
- 'firebase.go'
23+
24+
jobs:
25+
tag_release:
26+
if: startsWith(github.event.head_commit.message, '[chore] Release ')
27+
28+
runs-on: ubuntu-latest
29+
environment: Release
30+
permissions:
31+
contents: write
32+
33+
steps:
34+
- name: Checkout code
35+
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
36+
37+
- name: Publish preflight check
38+
id: preflight
39+
run: ./.github/scripts/publish_preflight_check.sh
40+
41+
- name: Create release tag
42+
env:
43+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
44+
RELEASE_VER: ${{ steps.preflight.outputs.version }}
45+
RELEASE_NOTES: ${{ steps.preflight.outputs.changelog }}
46+
run: gh release create "$RELEASE_VER" \
47+
--title "Firebase Admin Go SDK $RELEASE_VER" \
48+
--notes "$RELEASE_NOTES" \
49+
--target "master"

AGENTS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ The Firebase Admin Go SDK enables server-side (backend) applications to interact
6464

6565
- **DO:** Use the centralized HTTP client in `internal/http_client.go` for all network calls.
6666
- **DO:** Pass `context.Context` as the first argument to all functions that perform I/O or other blocking operations.
67+
- **DO:** Run `go fmt` after implementing a change and fix any linting errors.
6768
- **DON'T:** Expose types or functions from the `internal/` directory in the public API.
6869
- **DON'T:** Introduce new third-party dependencies without a strong, documented justification and team consensus.
6970

CONTRIBUTING.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,12 @@ Set up your Firebase project as follows:
148148

149149
2. Enable Firestore:
150150
1. Go to the Firebase Console, and select **Firestore Database** from the **Build** menu.
151-
2. Click on the **Create database** button. You can choose to set up Firestore either in
152-
the production mode or in the test mode.
151+
2. Click on the **Create database** button and create a default database. You can choose
152+
to set up Firestore either in the production mode or in the test mode.
153+
> **Note:** Integration tests are run against both the default database and an additional
154+
database named "testing-database".
155+
3. After the default database is created, click the **Add database** button to create a
156+
second database named "testing-database".
153157

154158

155159
3. Enable Realtime Database:

auth/tenant_mgt_test.go

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,35 @@ func TestTenantGetUser(t *testing.T) {
9090
}
9191
}
9292

93+
func TestTenantQueryUsers(t *testing.T) {
94+
resp := `{
95+
"usersInfo": [],
96+
"recordsCount": "0"
97+
}`
98+
s := echoServer([]byte(resp), t)
99+
defer s.Close()
100+
101+
tenantClient, err := s.Client.TenantManager.AuthForTenant("test-tenant")
102+
if err != nil {
103+
t.Fatalf("Failed to create tenant client: %v", err)
104+
}
105+
106+
returnUserInfo := true
107+
query := &QueryUsersRequest{
108+
ReturnUserInfo: &returnUserInfo,
109+
}
110+
111+
_, err = tenantClient.QueryUsers(context.Background(), query)
112+
if err != nil {
113+
t.Fatalf("QueryUsers() with tenant client = %v", err)
114+
}
115+
116+
wantPath := "/projects/mock-project-id/tenants/test-tenant/accounts:query"
117+
if s.Req[0].RequestURI != wantPath {
118+
t.Errorf("QueryUsers() URL = %q; want = %q", s.Req[0].RequestURI, wantPath)
119+
}
120+
}
121+
93122
func TestTenantGetUserByEmail(t *testing.T) {
94123
s := echoServer(testGetUserResponse, t)
95124
defer s.Close()

0 commit comments

Comments
 (0)