Skip to content

Commit 22b18b1

Browse files
committed
Merge remote-tracking branch 'origin/main' into jdbc/feature-branch-otel
# Conflicts: # java-bigquery/google-cloud-bigquery-jdbc/pom.xml # java-bigquery/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryConnection.java # java-bigquery/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryDatabaseMetaData.java # java-bigquery/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryDriver.java # java-bigquery/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryPreparedStatement.java # java-bigquery/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryStatement.java # java-bigquery/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryDatabaseMetaDataTest.java
2 parents 27ed8de + a327bf2 commit 22b18b1

1,647 files changed

Lines changed: 250082 additions & 26704 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: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
---
2+
name: api-lifecycle
3+
description: Guidelines and playbooks for managing the API lifecycle (BetaApi, GA, ObsoleteApi, Deprecated, and Removal) in the Google Cloud Java SDK. Use this skill when modifying, deprecating, or introducing new public API surfaces.
4+
---
5+
6+
# API Lifecycle & Stability Guide
7+
8+
This guide defines the lifecycle phases and stability annotations of public APIs inside the Google Cloud Java SDK. Use this to ensure all public methods, classes, and fields correctly adhere to Semantic Versioning (Semver) and safely transition through deprecation phases.
9+
10+
> [!IMPORTANT]
11+
> **Scope & Visibility Rule**
12+
> This guideline applies **ONLY to public API surfaces** (e.g., `public` classes, interfaces, methods, and fields) that are exposed to external/downstream consumers. It does **NOT** apply to private, package-private, or internal implementation details.
13+
14+
---
15+
16+
## Design Principle: Minimize Public API Surface
17+
18+
To reduce maintenance overhead and ensure long-term flexibility, developers should actively avoid creating public APIs unless absolutely necessary.
19+
20+
* **Default to Restrictive Visibility**: Always default to the most restrictive access modifier (`private`, `package-private`, or `@InternalApi`) for new classes, methods, and fields. Only expose an API as `public` if there is a clear, justified requirement for external consumers.
21+
* **Exposing Public APIs Commits Us**: Every public class, method, or field represents a strict compatibility contract under Semantic Versioning. Once public, modifying or removing it requires a long, multi-phase deprecation cycle.
22+
* Prefer Internal Utilities: If functionality is only needed within the same package or module, keep it private or package-private. Do not make it public "just in case".
23+
24+
---
25+
26+
## The API Lifecycle Flow
27+
28+
An API does **not** have to start with `@BetaApi`. Stable, well-designed features can be introduced directly as General Availability (GA). The `@BetaApi` annotation is reserved for experimental, preview, or unstable APIs.
29+
30+
Below is the transition flow for public APIs:
31+
32+
**Standard Lifecycle (Direct to GA):**
33+
`General Availability (GA) ──> @ObsoleteApi (Staged Deprecation) ──> @Deprecated (Official) ──> Removed`
34+
35+
**Experimental Lifecycle (Beta first):**
36+
`@BetaApi (Experimental) ──> General Availability (GA) ──> @ObsoleteApi (Staged Deprecation) ──> @Deprecated (Official) ──> Removed`
37+
38+
---
39+
40+
## API Lifecycle Stages
41+
42+
### 1. `@BetaApi` (Experimental Phase)
43+
* **Purpose**: Used for experimental, preview, or unstable API surfaces.
44+
* **Semver Policy**: Treated as a **"0.x" feature inside a "1.x" library**. Subject to incompatible changes or removal between minor and patch releases at any time.
45+
* **Graduation Policy**: Not all APIs start here. Many APIs go directly to GA. If an API does start as `@BetaApi`, it is intended to eventually graduate to a GA feature by removing the `@BetaApi` annotation.
46+
* **Usage Rule**: Do **NOT** depend on `@BetaApi` features inside a public library `B` that has downstream consumers, *unless* the consuming components of library `B` are also marked with `@BetaApi`.
47+
* **Exception**: `google-cloud-java` is allowed to depend on `@BetaApi` features in `gax-java` without declaring the consuming code `@BetaApi`, as they move in lockstep.
48+
49+
### 2. General Availability (GA)
50+
* **Purpose**: Stable API surfaces intended for production use.
51+
* Policy: Deprecation or breaking changes to GA APIs are considered breaking changes and should generally not be performed under a minor version release using standard @Deprecated.
52+
53+
### 3. `@ObsoleteApi` (Staged Deprecation)
54+
* **Purpose**: Signals to users that an API will be deprecated in a future version, allowing them to transition to alternative methods before official deprecation.
55+
* **Policy**: Used during minor version releases.
56+
* **Usage Guidelines**:
57+
* **Annotation**: Apply `@ObsoleteApi("Reason or alternative instructions")`. A descriptive reason is required.
58+
* **Javadoc**: Detail the replacement or migration path, referencing alternative methods via `{@link}`.
59+
* **IDE Impact**: Does not trigger IDE compilation/strike-through warnings, keeping downstream builds warning-free.
60+
61+
### 4. `@Deprecated` (Official Deprecation)
62+
* **Purpose**: Officially deprecates the API in the editor/IDE, producing compiler warnings and strike-throughs.
63+
* **Policy**: Strongly recommended to be applied during **Major Version Releases** (e.g., `v2.0.0`), or in rare emergency cases to fix critical security vulnerabilities. However, it can be acceptable in minor version releases if the library owners explicitly review and determine that the deprecation is low-risk for downstream consumers.
64+
* **Usage Guidelines**:
65+
* **Annotation**: Apply Java's standard `@Deprecated` annotation to the code element.
66+
* **Javadoc**: Add the standard `@deprecated` Javadoc tag describing alternative APIs or transition steps.
67+
68+
### 5. Removal
69+
* **Purpose**: Complete removal of the API from the codebase.
70+
* **Policy**: Performed in a subsequent major version release following official deprecation.
71+
* **Usage Guidelines**:
72+
* **Action**: Completely delete the class, interface, method, or field, along with its Javadoc and annotations.
73+
* **Validation**: Verify that all internal usages, references, and tests within the monorepo are fully cleaned up or migrated.
74+
75+
---
76+
77+
## API Stability & Visibility Annotations
78+
79+
While the standard **API Lifecycle Stages** section above defines how public APIs transition over time, the SDK also utilizes specialized stability annotations. These annotations serve as "exceptions" or "special contracts" that dictate how Semantic Versioning applies to public elements:
80+
81+
### 1. `@InternalApi`
82+
* **Definition**: Technically `public` because of Java's access modifier limitations, but intended **only** for internal use.
83+
* **Semver Policy**: For the purposes of semver, these are considered **private**. They can be modified or deleted in any minor or patch release without breaking compatibility.
84+
85+
### 2. `@InternalExtensionOnly`
86+
* **Definition**: A `public` interface that is only intended to be implemented by internal SDK classes, though it can be consumed publicly.
87+
* **Semver Policy**: We reserve the right to add new methods to these interfaces without providing default implementations in minor/patch releases. Downstream consumers should **not** write custom implementations of these interfaces.
88+
89+
*(Note: For experimental public APIs, see the `@BetaApi` stage in the Lifecycle Stages section above.)*
90+
91+
---
92+
93+
## Checklist for API Modifiers & Code Reviewers
94+
95+
- [ ] **Is the API GA?** If so, do **NOT** apply `@Deprecated` directly in a minor release. Apply `@ObsoleteApi` first.
96+
- [ ] **Is it intended only for internal use?** If so, mark it `@InternalApi` so downstream users don't rely on it.
97+
- [ ] **Is it an interface meant only for internal implementation?** Mark it `@InternalExtensionOnly` to protect future extensions.
98+
- [ ] **Does `@ObsoleteApi` or `@Deprecated` have a `value` parameter?** The string must explain *why* and *what* the user should do instead.
99+
- [ ] **Does the Javadoc link to alternatives?** Use `{@link #alternativeMethod()}` so the user can easily navigate in their IDE.

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
/java-vertexai/ @googleapis/vertexai-team @googleapis/cloud-sdk-java-team
1010
/java-bigquerystorage/ @googleapis/bigquery-team @googleapis/cloud-sdk-java-team
1111
/java-bigquery/ @googleapis/bigquery-team @googleapis/cloud-sdk-java-team
12+
/grpc-gcp-java/ @googleapis/spanner-team @googleapis/cloud-sdk-java-team
1213
/java-spanner/ @googleapis/spanner-team @googleapis/cloud-sdk-java-team
1314
/java-spanner-jdbc/ @googleapis/spanner-team @googleapis/cloud-sdk-java-team
1415
/google-auth-library-java/ @googleapis/cloud-sdk-auth-team @googleapis/cloud-sdk-java-team @googleapis/aion-team

.github/workflows/ci.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ jobs:
3636
with:
3737
filters: |
3838
src:
39-
- '!(google-auth-library-java|java-bigquery|java-bigquerystorage|java-bigtable|java-datastore|java-firestore|java-logging|java-logging-logback|java-pubsub|java-spanner|java-storage)/**/*.java'
40-
- '!(google-auth-library-java|java-bigquery|java-bigquerystorage|java-bigtable|java-datastore|java-firestore|java-logging|java-logging-logback|java-pubsub|java-spanner|java-storage)/**/pom.xml'
39+
- '!(google-auth-library-java|grpc-gcp-java|java-bigquery|java-bigquerystorage|java-bigtable|java-datastore|java-firestore|java-logging|java-logging-logback|java-pubsub|java-spanner|java-storage)/**/*.java'
40+
- '!(google-auth-library-java|grpc-gcp-java|java-bigquery|java-bigquerystorage|java-bigtable|java-datastore|java-firestore|java-logging|java-logging-logback|java-pubsub|java-spanner|java-storage)/**/pom.xml'
4141
- 'pom.xml'
4242
ci:
4343
- '.github/workflows/ci.yaml'
@@ -123,6 +123,8 @@ jobs:
123123
filters: |
124124
google-auth-library-java:
125125
- 'google-auth-library-java/**'
126+
grpc-gcp-java:
127+
- 'grpc-gcp-java/**'
126128
java-bigquery:
127129
- 'java-bigquery/**'
128130
- 'google-auth-library-java/**/*.java'
@@ -160,6 +162,7 @@ jobs:
160162
- 'sdk-platform-java/gapic-generator-java-pom-parent/pom.xml'
161163
java-spanner:
162164
- 'java-spanner/**'
165+
- 'grpc-gcp-java/**'
163166
- 'google-auth-library-java/**/*.java'
164167
- 'google-auth-library-java/**/pom.xml'
165168
- 'sdk-platform-java/**/*.java'

.github/workflows/sdk-platform-java-shared_dependencies.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,4 @@ jobs:
4040
mvn install -B -ntp -DskipTests -Pquick-build
4141
- name: Check the BOM content satisfies the upper-bound-check test case
4242
run: mvn -B -V -ntp verify -Pquick-build
43-
working-directory: sdk-plaform-java/java-shared-dependencies/upper-bound-check
43+
working-directory: sdk-platform-java/java-shared-dependencies/upper-bound-check

.github/workflows/sdk-platform-java-sonar.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,7 @@ jobs:
7979
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
8080
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN_FOR_GENERATOR }}
8181
run: |
82-
mvn -B verify -Pquick-build \
83-
-DenableFullTestCoverage \
82+
mvn -B verify -Pquick-build -Djacoco.skip=false \
8483
-Penable-integration-tests \
8584
org.sonarsource.scanner.maven:sonar-maven-plugin:sonar \
8685
-Dsonar.projectKey=googleapis_google-cloud-java_generator \
@@ -92,7 +91,7 @@ jobs:
9291
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
9392
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN_FOR_SHOWCASE }}
9493
run: |
95-
mvn -B clean verify -Pquick-build \
94+
mvn -B clean verify -Pquick-build -Djacoco.skip=false \
9695
-DskipUnitTests \
9796
-Penable-integration-tests \
9897
-DenableShowcaseTestCoverage \

.kokoro/bigtable-conformance.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ retry_with_backoff 3 10 \
3737
-DskipTests=true \
3838
-Dclirr.skip=true \
3939
-Denforcer.skip=true \
40+
-Dcheckstyle.skip=true \
4041
-Dmaven.javadoc.skip=true \
4142
-Dgcloud.download.skip=true \
4243
-T 1C
@@ -48,7 +49,7 @@ set +e
4849
# Build the proxy
4950
pushd .
5051
cd java-bigtable/test-proxy
51-
mvn clean install -U -DskipTests
52+
mvn clean install -U -DskipTests -Dcheckstyle.skip=true
5253
popd
5354

5455
declare -a configs=("default" "enable_all")

.kokoro/common.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ excluded_modules=(
3939
'java-firestore'
4040
'java-bigtable'
4141
'java-pubsub'
42+
'java-common-protos'
43+
'java-iam'
4244
)
4345

4446
function retry_with_backoff {

gapic-libraries-bom/pom.xml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -297,14 +297,7 @@
297297
<dependency>
298298
<groupId>com.google.cloud</groupId>
299299
<artifactId>google-cloud-bigtable-bom</artifactId>
300-
<version>2.78.1-SNAPSHOT</version><!-- {x-version-update:google-cloud-bigtable:current} -->
301-
<type>pom</type>
302-
<scope>import</scope>
303-
</dependency>
304-
<dependency>
305-
<groupId>com.google.cloud</groupId>
306-
<artifactId>google-cloud-bigtable-deps-bom</artifactId>
307-
<version>2.78.1-SNAPSHOT</version><!-- {x-version-update:google-cloud-bigtable-deps:current} -->
300+
<version>2.79.0-SNAPSHOT</version><!-- {x-version-update:google-cloud-bigtable:current} -->
308301
<type>pom</type>
309302
<scope>import</scope>
310303
</dependency>

generation/check_non_release_please_versions.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ for pomFile in $(find . -mindepth 2 -name pom.xml | sort ); do
1919
[[ "${pomFile}" =~ .*java-spanner.* ]] || \
2020
[[ "${pomFile}" =~ .*java-spanner-jdbc.* ]] || \
2121
[[ "${pomFile}" =~ .*google-auth-library-java.* ]] || \
22+
[[ "${pomFile}" =~ .*grpc-gcp.* ]] || \
2223
[[ "${pomFile}" =~ .*java-storage.* ]] || \
2324
[[ "${pomFile}" =~ .*java-storage-nio.* ]] || \
2425
[[ "${pomFile}" =~ .*java-pubsub.* ]] || \

generation_config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
googleapis_commitish: 3adc515b8bda328fb894f86765d9c5ec8c944480
2-
libraries_bom_version: 26.80.0
1+
googleapis_commitish: 3aa565f453bae9dcef06685a6f84b6e48ccdf335
2+
libraries_bom_version: 26.82.0
33
is_monorepo: true
44
libraries:
55
- api_shortname: accessapproval

0 commit comments

Comments
 (0)