Skip to content
This repository was archived by the owner on May 8, 2026. It is now read-only.

Commit b168fa3

Browse files
committed
feat: Merge ehsann/new-types into main and resolve conflicts
2 parents 29dda01 + e1bcdd1 commit b168fa3

503 files changed

Lines changed: 60252 additions & 16509 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
---
2+
name: Verify Local Changes
3+
description: Verifies local Java SDK changes.
4+
---
5+
6+
# Verify Local Changes
7+
8+
This skill documents how to verify local code changes for the Java Firestore SDK. This should be run **every time** you complete a fix or feature and are prepared to push a pull request.
9+
10+
## Prerequisites
11+
12+
Ensure you have Maven installed and are in the `java-firestore` directory before running commands.
13+
14+
---
15+
16+
## Step 0: Format the Code
17+
18+
Run the formatter to ensure formatting checks pass:
19+
20+
```bash
21+
mvn com.spotify.fmt:fmt-maven-plugin:format
22+
```
23+
24+
---
25+
26+
## Step 1: Unit Testing (Isolated then Suite)
27+
28+
1. **Identify modified unit tests** in your changes.
29+
2. **Run specific units only** to test isolated logic regressions:
30+
```bash
31+
mvn test -Dtest=MyUnitTest#testMethod
32+
```
33+
3. **Run the entire unit test suite** that contains those modified tests if the isolated unit tests pass:
34+
```bash
35+
mvn test -Dtest=MyUnitTest
36+
```
37+
38+
---
39+
40+
## Step 2: Integration Testing (Isolated then Suite)
41+
42+
### 💡 Integration Test Nuances (from `ITBaseTest.java`)
43+
44+
When running integration tests, configure your execution using properties or environment variables:
45+
46+
- **`FIRESTORE_EDITION`**:
47+
- `standard` (Default)
48+
- `enterprise`
49+
- *Note*: **Pipelines can only be run against `enterprise` editions**, while standard Queries run on both.
50+
- **`FIRESTORE_DATABASE_ID`**:
51+
- Enterprise editions usually require a named database (often `enterprise`). Adjust this flag if pointing to specific instances.
52+
- **`FIRESTORE_TARGET_BACKEND`**:
53+
- `PROD` (Default)
54+
- `QA` (points to standard sandboxes)
55+
- `NIGHTLY` (points to `test-firestore.sandbox.googleapis.com:443`)
56+
- `EMULATOR` (points to `localhost:8080`)
57+
58+
1. **Identify modified integration tests** (usually Starting in `IT`).
59+
2. **Run specific integration tests only** (isolated checks run quicker):
60+
```bash
61+
mvn verify -Penable-integration-tests -DFIRESTORE_EDITION=enterprise -DFIRESTORE_DATABASE_ID=enterprise -Dtest=ITTest#testMethod -Dclirr.skip=true -Denforcer.skip=true -fae
62+
```
63+
3. **Run the entire integration test suite** for the modified class if isolation tests pass:
64+
```bash
65+
mvn verify -Penable-integration-tests -DFIRESTORE_EDITION=enterprise -DFIRESTORE_DATABASE_ID=enterprise -Dtest=ITTest -Dclirr.skip=true -Denforcer.skip=true -fae
66+
```
67+
68+
---
69+
70+
## Step 3: Full Suite Regressions
71+
72+
Run the full integration regression suite once you are confident subsets pass:
73+
74+
```bash
75+
mvn verify -Penable-integration-tests -DFIRESTORE_EDITION=enterprise -DFIRESTORE_DATABASE_ID=enterprise -Dclirr.skip=true -Denforcer.skip=true -fae
76+
```
77+
78+
---
79+
80+
> [!TIP]
81+
> Use `-Dclirr.skip=true -Denforcer.skip=true` to speed up iterations where appropriate without leaking compliance checks.
82+
83+
---
84+
85+
## 🛠️ Troubleshooting & Source of Truth
86+
87+
If you run into issues executing tests with the commands above, **consult the Kokoro configuration files** as the ultimate source of truth:
88+
89+
- **Presubmit configurations**: See `.kokoro/presubmit/integration.cfg` (or `integration-named-db.cfg`)
90+
- **Nightly configurations**: See `.kokoro/nightly/integration.cfg` (or `integration-named-db.cfg`)
91+
- **Build shell scripts**: See `.kokoro/build.sh`
92+
93+
These files define the exact environment variables (e.g., specific endpoints or endpoints overrides) the CI server uses!

.github/.OwlBot-hermetic.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ deep-remove-regex:
55
- "/google-cloud-firestore-admin/src"
66

77
deep-preserve-regex:
8+
- "/.*google-.*/src/main/java/.*/stub/Version.java"
89
- "/google-.*/src/test/java/com/google/cloud/.*/v.*/it/IT.*Test.java"
910
- "/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/DocumentPathName.java"
1011
- "/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/AnyPathName.java"

.github/CODEOWNERS

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,23 @@
44
# For syntax help see:
55
# https://help.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners#codeowners-syntax
66

7-
# The @googleapis/api-firestore @googleapis/firestore-dpe is the default owner for changes in this repo
8-
* @googleapis/yoshi-java @googleapis/api-firestore @googleapis/firestore-dpe
7+
# The @googleapis/firestore-team is the default owner for changes in this repo
8+
* @googleapis/cloud-sdk-java-team @googleapis/firestore-team
99

1010
# for handwritten libraries, keep codeowner_team in .repo-metadata.json as owner
11-
**/*.java @googleapis/api-firestore @googleapis/firestore-dpe
11+
**/*.java @googleapis/cloud-sdk-java-team @googleapis/firestore-team
1212

1313
# For generated Java code
14-
proto-*/ @googleapis/yoshi-java @googleapis/api-firestore @googleapis/firestore-dpe
15-
grpc-*/ @googleapis/yoshi-java @googleapis/api-firestore @googleapis/firestore-dpe
14+
proto-*/ @googleapis/cloud-sdk-java-team @googleapis/firestore-team
15+
grpc-*/ @googleapis/cloud-sdk-java-team @googleapis/firestore-team
1616
# Generated code pattern in google-cloud-firestore and google-cloud-firestore-admin
17-
**/*Client.java @googleapis/yoshi-java @googleapis/api-firestore @googleapis/firestore-dpe
18-
**/*Settings.java @googleapis/yoshi-java @googleapis/api-firestore @googleapis/firestore-dpe
19-
**/*ClientHttpJsonTest.java @googleapis/yoshi-java @googleapis/api-firestore @googleapis/firestore-dpe
20-
**/*ClientTest.java @googleapis/yoshi-java @googleapis/api-firestore @googleapis/firestore-dpe
17+
**/*Client.java @googleapis/cloud-sdk-java-team @googleapis/firestore-team
18+
**/*Settings.java @googleapis/cloud-sdk-java-team @googleapis/firestore-team
19+
**/*ClientHttpJsonTest.java @googleapis/cloud-sdk-java-team @googleapis/firestore-team
20+
**/*ClientTest.java @googleapis/cloud-sdk-java-team @googleapis/firestore-team
2121

2222
# The java-samples-reviewers team is the default owner for samples changes
2323
samples/**/*.java @googleapis/java-samples-reviewers
2424

2525
# Generated snippets should not be owned by samples reviewers
26-
samples/snippets/generated/ @googleapis/yoshi-java
26+
samples/snippets/generated/ @googleapis/cloud-sdk-java-team

.github/release-please.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@ bumpMinorPreMajor: true
22
handleGHRelease: true
33
releaseType: java-yoshi
44
branches:
5+
- branch: java7
6+
- branch: protobuf-4.x-rc
7+
manifest: true
58
- bumpMinorPreMajor: true
69
handleGHRelease: true
7-
releaseType: java-yoshi
8-
branch: java7
10+
releaseType: java-backport
11+
branch: 3.36.x

.github/scripts/update_generation_config.sh

Lines changed: 27 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
set -e
2+
set -ex
33
# This script should be run at the root of the repository.
44
# This script is used to update googleapis_commitish, gapic_generator_version,
55
# and libraries_bom_version in generation configuration at the time of running
@@ -15,8 +15,20 @@ set -e
1515
function get_latest_released_version() {
1616
local group_id=$1
1717
local artifact_id=$2
18-
json_content=$(curl -s "https://search.maven.org/solrsearch/select?q=g:${group_id}+AND+a:${artifact_id}&core=gav&rows=500&wt=json")
19-
latest=$(jq -r '.response.docs[] | select(.v | test("^[0-9]+(\\.[0-9]+)*$")) | .v' <<< "${json_content}" | sort -V | tail -n 1)
18+
group_id_url_path="$(sed 's|\.|/|g' <<< "${group_id}")"
19+
url="https://repo1.maven.org/maven2/${group_id_url_path}/${artifact_id}/maven-metadata.xml"
20+
xml_content=$(curl -s --fail "${url}")
21+
22+
# 1. Extract all version tags
23+
# 2. Strip the XML tags to leave just the version numbers
24+
# 3. Filter for strictly numbers.numbers.numbers (e.g., 2.54.0)
25+
# 4. Sort by version (V) and take the last one (tail -n 1)
26+
latest=$(echo "${xml_content}" \
27+
| grep -oE '<version>[0-9]+\.[0-9]+\.[0-9]+</version>' \
28+
| sed -E 's/<[^>]+>//g' \
29+
| sort -V \
30+
| tail -n 1)
31+
2032
if [[ -z "${latest}" ]]; then
2133
echo "The latest version of ${group_id}:${artifact_id} is empty."
2234
echo "The returned json from maven.org is invalid: ${json_content}"
@@ -36,13 +48,14 @@ function update_config() {
3648
}
3749

3850
# Update an action to a new version in GitHub action.
51+
# the second argument must have the git tag (including "v").
3952
function update_action() {
4053
local key_word=$1
4154
local new_value=$2
4255
local file=$3
4356
echo "Update ${key_word} to ${new_value} in ${file}"
4457
# use a different delimiter because the key_word contains "/".
45-
sed -i -e "s|${key_word}@v.*$|${key_word}@v${new_value}|" "${file}"
58+
sed -i -e "s|${key_word}@[^ ]*$|${key_word}@${new_value}|" "${file}"
4659
}
4760

4861
# The parameters of this script is:
@@ -131,12 +144,16 @@ rm -rf tmp-googleapis
131144
update_config "googleapis_commitish" "${latest_commit}" "${generation_config}"
132145

133146
# Update gapic-generator-java version to the latest
134-
latest_version=$(get_latest_released_version "com.google.api" "gapic-generator-java")
135-
update_config "gapic_generator_version" "${latest_version}" "${generation_config}"
136-
137-
# Update composite action version to latest gapic-generator-java version
138-
update_action "googleapis/sdk-platform-java/.github/scripts" \
139-
"${latest_version}" \
147+
latest_gapic_generator_version=$(get_latest_released_version "com.google.api" "gapic-generator-java")
148+
update_config "gapic_generator_version" "${latest_gapic_generator_version}" "${generation_config}"
149+
150+
# Update the GitHub Actions reference to the latest.
151+
# After the google-cloud-java monorepo migration of sdk-platform-java,
152+
# we cannot rely on the gapic-generator-java version tag. Let's use
153+
# the gapic-libraries-bom version
154+
latest_gapic_libraries_bom_version=$(get_latest_released_version "com.google.cloud" "gapic-libraries-bom")
155+
update_action "googleapis/google-cloud-java/sdk-platform-java/.github/scripts" \
156+
"v${latest_gapic_libraries_bom_version}" \
140157
"${workflow}"
141158

142159
# Update libraries-bom version to the latest

.github/sync-repo-settings.yaml

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,30 @@ branchProtectionRules:
3838
- units (11)
3939
- 'Kokoro - Test: Integration'
4040
- cla/google
41+
- pattern: 3.36.x
42+
isAdminEnforced: true
43+
requiredApprovingReviewCount: 1
44+
requiresCodeOwnerReviews: true
45+
requiresStrictStatusChecks: false
46+
requiredStatusCheckContexts:
47+
- dependencies (17)
48+
- lint
49+
- clirr
50+
- units (8)
51+
- units (11)
52+
- 'Kokoro - Test: Integration'
53+
- 'Kokoro - Test: Integration Against Named DB'
54+
- cla/google
55+
- 'Kokoro - Test: Java GraalVM Native Image A'
56+
- 'Kokoro - Test: Java GraalVM Native Image B'
57+
- 'Kokoro - Test: Java GraalVM Native Image C'
58+
- javadoc
59+
- library_generation
60+
- unmanaged_dependency_check
4161
permissionRules:
4262
- team: yoshi-admins
4363
permission: admin
4464
- team: yoshi-java-admins
4565
permission: admin
46-
- team: yoshi-java
66+
- team: cloud-sdk-java-team
4767
permission: push

.github/workflows/ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
strategy:
2626
fail-fast: false
2727
matrix:
28-
java: [11, 17, 21]
28+
java: [11, 17, 21, 25]
2929
steps:
3030
- uses: actions/checkout@v4
3131
- uses: actions/setup-java@v4

.github/workflows/hermetic_library_generation.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@ jobs:
3636
if: env.SHOULD_RUN == 'true'
3737
with:
3838
fetch-depth: 0
39-
token: ${{ secrets.CLOUD_JAVA_BOT_TOKEN }}
40-
- uses: googleapis/sdk-platform-java/.github/scripts@v2.56.2
39+
token: ${{ secrets.CLOUD_JAVA_BOT_GITHUB_TOKEN }}
40+
- uses: googleapis/google-cloud-java/sdk-platform-java/.github/scripts@v1.85.0
4141
if: env.SHOULD_RUN == 'true'
4242
with:
4343
base_ref: ${{ github.base_ref }}
4444
head_ref: ${{ github.head_ref }}
45-
token: ${{ secrets.CLOUD_JAVA_BOT_TOKEN }}
45+
token: ${{ secrets.CLOUD_JAVA_BOT_GITHUB_TOKEN }}

.github/workflows/renovate_config_check.yaml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
pull_request:
55
paths:
66
- 'renovate.json'
7+
- '.github/workflows/renovate_config_check.yaml'
78

89
jobs:
910
renovate_bot_config_validation:
@@ -18,8 +19,6 @@ jobs:
1819
with:
1920
node-version: '22'
2021

21-
- name: Install Renovate and Config Validator
22+
- name: Run Renovate Config Validator
2223
run: |
23-
npm install -g npm@latest
24-
npm install --global renovate
25-
renovate-config-validator
24+
npx --package renovate@43.136.0 renovate-config-validator

.github/workflows/unmanaged-dependency-check.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ jobs:
1414
shell: bash
1515
run: .kokoro/build.sh
1616
- name: Unmanaged dependency check
17-
uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v3.46.2
17+
uses: googleapis/google-cloud-java/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@v1.85.0
1818
with:
1919
bom-path: google-cloud-firestore-bom/pom.xml

0 commit comments

Comments
 (0)