From 99cbcadc57957ec843460a8516771508b48c7533 Mon Sep 17 00:00:00 2001 From: ohmayr Date: Fri, 29 May 2026 23:09:50 +0000 Subject: [PATCH 01/12] wip --- .github/workflows/experiment.yaml | 50 ++++++++++++++++++++++++ packages/gapic-generator/noxfile.py | 60 +++++++++++++++++++++++++++-- 2 files changed, 106 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/experiment.yaml diff --git a/.github/workflows/experiment.yaml b/.github/workflows/experiment.yaml new file mode 100644 index 000000000000..e32f1b2024a4 --- /dev/null +++ b/.github/workflows/experiment.yaml @@ -0,0 +1,50 @@ +name: Experiment centralized testing + +on: + pull_request: + paths: + - 'packages/gapic-generator/**' + - '.github/workflows/prerelease-radar.yml' + +jobs: + test-prerelease: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v6 + + - name: Setup Python + uses: actions/setup-python@v6 + with: + python-version: '3.14' + allow-prereleases: true + + - name: Setup Go + uses: actions/setup-go@v6 + with: + go-version: '1.26.x' + + - name: Install protoc + uses: arduino/setup-protoc@v3 + with: + version: "25.3" + + - name: Install Librarian + run: | + version=$(sed -n 's/^version: *//p' librarian.yaml) + go run "github.com/googleapis/librarian/cmd/librarian@${version}" install + + - name: Generate Redis via Librarian + run: | + version=$(sed -n 's/^version: *//p' librarian.yaml) + go run "github.com/googleapis/librarian/cmd/librarian@${version}" generate -packages=redis -output-dir=./workspace/redis + + - name: Install Nox + run: | + python -m pip install --upgrade pip setuptools wheel + python -m pip install nox + + - name: Run Dynamic Prerelease Check + run: | + cd packages/gapic-generator + nox -s prerelease_deps -- ../../workspace/redis \ No newline at end of file diff --git a/packages/gapic-generator/noxfile.py b/packages/gapic-generator/noxfile.py index 8ef965740c2b..7ecbee88f410 100644 --- a/packages/gapic-generator/noxfile.py +++ b/packages/gapic-generator/noxfile.py @@ -829,11 +829,63 @@ def system(session): ) def prerelease_deps(session, protobuf_implementation): """ - Run all tests with pre-release versions of dependencies installed. + Run generated unit tests against pre-release ecosystem dependencies. + Usage: nox -s prerelease_deps -- /path/to/generated/library """ - # TODO(https://github.com/googleapis/google-cloud-python/issues/16184): - # Implement pre-release dependency logic to test against upcoming runtime changes. - session.skip("prerelease_deps session is not yet implemented for gapic-generator-python.") + if not session.posargs: + session.error( + "You must provide the path to the generated library.\n" + "Usage: nox -s prerelease_deps -- ./workspace/redis" + ) + + target_path = session.posargs[0] + + if not os.path.exists(target_path): + session.error(f"Target path does not exist: {target_path}") + + # 1. Move into the generated library and install its baseline + session.chdir(target_path) + session.install("-e", ".") + session.install("pytest", "pytest-asyncio", "mock") + + # 2. Force install the exact pre-release ecosystem targets from PyPI + session.install( + "--pre", + "--upgrade", + "googleapis-common-protos", + "google-api-core", + "google-auth", + "grpc-google-iam-v1", + "grpcio", + "grpcio-status", + "protobuf", + "proto-plus", + ) + + # 3. Print out the versions to mimic the downstream logging verification + package_namespaces = { + "google-api-core": "google.api_core", + "google-auth": "google.auth", + "grpcio": "grpc", + "protobuf": "google.protobuf", + "proto-plus": "proto", + } + for pkg, namespace in package_namespaces.items(): + session.run( + "python", + "-c", + f"import {namespace}; print('{pkg}:', {namespace}.__version__)", + silent=False, + ) + + # 4. Run the hermetic unit tests with the specific protobuf backend + session.run( + "py.test", + "tests/unit", + env={ + "PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION": protobuf_implementation, + }, + ) @nox.session(python=NEWEST_PYTHON) From f6104bdd0d7f0736abda52a10fe33b539170a959 Mon Sep 17 00:00:00 2001 From: ohmayr Date: Fri, 29 May 2026 23:12:44 +0000 Subject: [PATCH 02/12] wip --- .github/workflows/{experiment.yaml => experiment.yml} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename .github/workflows/{experiment.yaml => experiment.yml} (96%) diff --git a/.github/workflows/experiment.yaml b/.github/workflows/experiment.yml similarity index 96% rename from .github/workflows/experiment.yaml rename to .github/workflows/experiment.yml index e32f1b2024a4..684ab493999a 100644 --- a/.github/workflows/experiment.yaml +++ b/.github/workflows/experiment.yml @@ -4,7 +4,7 @@ on: pull_request: paths: - 'packages/gapic-generator/**' - - '.github/workflows/prerelease-radar.yml' + - '.github/workflows/experiment.yml' jobs: test-prerelease: From 19d18aa00a9959239dd2d923b27fb510c6e329fe Mon Sep 17 00:00:00 2001 From: ohmayr Date: Fri, 29 May 2026 23:15:53 +0000 Subject: [PATCH 03/12] wip --- .github/workflows/experiment.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/experiment.yml b/.github/workflows/experiment.yml index 684ab493999a..45a20b01745e 100644 --- a/.github/workflows/experiment.yml +++ b/.github/workflows/experiment.yml @@ -37,7 +37,8 @@ jobs: - name: Generate Redis via Librarian run: | version=$(sed -n 's/^version: *//p' librarian.yaml) - go run "github.com/googleapis/librarian/cmd/librarian@${version}" generate -packages=redis -output-dir=./workspace/redis + # Pass the target package path as a positional argument + go run "github.com/googleapis/librarian/cmd/librarian@${version}" generate packages/google-cloud-redis - name: Install Nox run: | @@ -47,4 +48,5 @@ jobs: - name: Run Dynamic Prerelease Check run: | cd packages/gapic-generator - nox -s prerelease_deps -- ../../workspace/redis \ No newline at end of file + # Point the Nox engine to the newly generated package directory + nox -s prerelease_deps -- ../google-cloud-redis \ No newline at end of file From 364cfa98f106dfb6947817db6d5099a7829441be Mon Sep 17 00:00:00 2001 From: ohmayr Date: Fri, 29 May 2026 23:26:41 +0000 Subject: [PATCH 04/12] wip --- .github/workflows/experiment.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/experiment.yml b/.github/workflows/experiment.yml index 45a20b01745e..e9e2f622fa49 100644 --- a/.github/workflows/experiment.yml +++ b/.github/workflows/experiment.yml @@ -4,7 +4,10 @@ on: pull_request: paths: - 'packages/gapic-generator/**' - - '.github/workflows/experiment.yml' + - '.github/workflows/prerelease-radar.yml' + +env: + SYNTHTOOL_TEMPLATES: /home/runner/synthtool/synthtool/gcp/templates jobs: test-prerelease: @@ -29,6 +32,10 @@ jobs: with: version: "25.3" + - name: Clone Synthtool Templates + run: | + git clone --recurse-submodules --single-branch https://github.com/googleapis/synthtool.git /home/runner/synthtool + - name: Install Librarian run: | version=$(sed -n 's/^version: *//p' librarian.yaml) @@ -37,8 +44,7 @@ jobs: - name: Generate Redis via Librarian run: | version=$(sed -n 's/^version: *//p' librarian.yaml) - # Pass the target package path as a positional argument - go run "github.com/googleapis/librarian/cmd/librarian@${version}" generate packages/google-cloud-redis + go run "github.com/googleapis/librarian/cmd/librarian@${version}" generate redis - name: Install Nox run: | From 4b05653f0c584074b701f2d7888212b7dfcda18a Mon Sep 17 00:00:00 2001 From: ohmayr Date: Fri, 29 May 2026 23:36:53 +0000 Subject: [PATCH 05/12] fix library name --- .github/workflows/experiment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/experiment.yml b/.github/workflows/experiment.yml index e9e2f622fa49..e30cfcfb766d 100644 --- a/.github/workflows/experiment.yml +++ b/.github/workflows/experiment.yml @@ -44,7 +44,7 @@ jobs: - name: Generate Redis via Librarian run: | version=$(sed -n 's/^version: *//p' librarian.yaml) - go run "github.com/googleapis/librarian/cmd/librarian@${version}" generate redis + go run "github.com/googleapis/librarian/cmd/librarian@${version}" generate google-cloud-redis - name: Install Nox run: | From 3563d24a6df0b3527bad56d6f2e644497abc8ad3 Mon Sep 17 00:00:00 2001 From: ohmayr Date: Fri, 29 May 2026 23:41:18 +0000 Subject: [PATCH 06/12] install pandoc --- .github/workflows/experiment.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/experiment.yml b/.github/workflows/experiment.yml index e30cfcfb766d..06b8041ef2be 100644 --- a/.github/workflows/experiment.yml +++ b/.github/workflows/experiment.yml @@ -31,6 +31,13 @@ jobs: uses: arduino/setup-protoc@v3 with: version: "25.3" + + - name: Install pandoc + run: | + mkdir -p /tmp/pandoc + curl -fsSL --retry 5 -o /tmp/pandoc.tar.gz https://github.com/jgm/pandoc/releases/download/3.8.2/pandoc-3.8.2-linux-amd64.tar.gz + tar -xvf /tmp/pandoc.tar.gz -C /tmp/pandoc --strip-components=1 + echo "/tmp/pandoc/bin" >> $GITHUB_PATH - name: Clone Synthtool Templates run: | From 7c43465c07abf626ab6e72214d676ee110e3a06d Mon Sep 17 00:00:00 2001 From: ohmayr Date: Mon, 1 Jun 2026 22:24:41 +0000 Subject: [PATCH 07/12] update canary --- .github/workflows/experiment.yml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/.github/workflows/experiment.yml b/.github/workflows/experiment.yml index 06b8041ef2be..cd07f2b7f5c6 100644 --- a/.github/workflows/experiment.yml +++ b/.github/workflows/experiment.yml @@ -12,6 +12,15 @@ env: jobs: test-prerelease: runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + canary: + - google-cloud-redis + - google-cloud-logging + - google-cloud-speech + - google-cloud-dialogflow + - google-cloud-dataproc steps: - name: Checkout uses: actions/checkout@v6 @@ -48,10 +57,10 @@ jobs: version=$(sed -n 's/^version: *//p' librarian.yaml) go run "github.com/googleapis/librarian/cmd/librarian@${version}" install - - name: Generate Redis via Librarian + - name: Generate Canary via Librarian run: | version=$(sed -n 's/^version: *//p' librarian.yaml) - go run "github.com/googleapis/librarian/cmd/librarian@${version}" generate google-cloud-redis + go run "github.com/googleapis/librarian/cmd/librarian@${version}" generate ${{ matrix.canary }} - name: Install Nox run: | @@ -62,4 +71,4 @@ jobs: run: | cd packages/gapic-generator # Point the Nox engine to the newly generated package directory - nox -s prerelease_deps -- ../google-cloud-redis \ No newline at end of file + nox -s prerelease_deps -- ../${{ matrix.canary }} \ No newline at end of file From d11a4636981ef7a8c3c3aac88fbc6de67633e527 Mon Sep 17 00:00:00 2001 From: ohmayr Date: Mon, 1 Jun 2026 23:09:55 +0000 Subject: [PATCH 08/12] replace logging with kms --- .github/workflows/experiment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/experiment.yml b/.github/workflows/experiment.yml index cd07f2b7f5c6..1a586c2537dc 100644 --- a/.github/workflows/experiment.yml +++ b/.github/workflows/experiment.yml @@ -17,7 +17,7 @@ jobs: matrix: canary: - google-cloud-redis - - google-cloud-logging + - google-cloud-kms - google-cloud-speech - google-cloud-dialogflow - google-cloud-dataproc From bcc849964fa148a2f0853f86c92222d10357e019 Mon Sep 17 00:00:00 2001 From: ohmayr Date: Mon, 1 Jun 2026 23:23:22 +0000 Subject: [PATCH 09/12] execute unit tests --- .github/workflows/experiment.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/experiment.yml b/.github/workflows/experiment.yml index 1a586c2537dc..3ddce8a9f6d2 100644 --- a/.github/workflows/experiment.yml +++ b/.github/workflows/experiment.yml @@ -67,8 +67,14 @@ jobs: python -m pip install --upgrade pip setuptools wheel python -m pip install nox - - name: Run Dynamic Prerelease Check + - name: Run Prerelease Check run: | cd packages/gapic-generator # Point the Nox engine to the newly generated package directory - nox -s prerelease_deps -- ../${{ matrix.canary }} \ No newline at end of file + nox -s prerelease_deps -- ../${{ matrix.canary }} + + - name: Run Unit Tests + run: | + # Library check: Execute directly from the generated package directory + cd packages/${{ matrix.canary }} + nox -s unit-3.14 \ No newline at end of file From 75d50b3ae4fa90f7a129577d579d2bd315bed260 Mon Sep 17 00:00:00 2001 From: ohmayr Date: Mon, 1 Jun 2026 23:51:51 +0000 Subject: [PATCH 10/12] update workflow --- .github/workflows/experiment.yml | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/.github/workflows/experiment.yml b/.github/workflows/experiment.yml index 3ddce8a9f6d2..c193fbd33704 100644 --- a/.github/workflows/experiment.yml +++ b/.github/workflows/experiment.yml @@ -10,7 +10,7 @@ env: SYNTHTOOL_TEMPLATES: /home/runner/synthtool/synthtool/gcp/templates jobs: - test-prerelease: + test-canary: runs-on: ubuntu-latest strategy: fail-fast: false @@ -67,14 +67,20 @@ jobs: python -m pip install --upgrade pip setuptools wheel python -m pip install nox - - name: Run Prerelease Check + - name: Run Unit Tests run: | - cd packages/gapic-generator - # Point the Nox engine to the newly generated package directory - nox -s prerelease_deps -- ../${{ matrix.canary }} + # Library check: Execute directly from the generated package directory + cd packages/${{ matrix.canary }} + nox -s unit-3.14 - - name: Run Unit Tests + - name: Run lint and and mypy run: | # Library check: Execute directly from the generated package directory cd packages/${{ matrix.canary }} - nox -s unit-3.14 \ No newline at end of file + nox -s mypy lint + + - name: Run Prerelease and Core Deps + run: | + cd packages/gapic-generator + # Point the Nox engine to the newly generated package directory + nox -s prerelease_deps core_deps_from_source -- ../${{ matrix.canary }} \ No newline at end of file From 00e6222d9815aab1bfb2d236809bba6d07afab39 Mon Sep 17 00:00:00 2001 From: ohmayr Date: Mon, 1 Jun 2026 23:52:19 +0000 Subject: [PATCH 11/12] update workflow --- .github/workflows/experiment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/experiment.yml b/.github/workflows/experiment.yml index c193fbd33704..610f28c023bc 100644 --- a/.github/workflows/experiment.yml +++ b/.github/workflows/experiment.yml @@ -81,6 +81,6 @@ jobs: - name: Run Prerelease and Core Deps run: | - cd packages/gapic-generator + cd packages/${{ matrix.canary }} # Point the Nox engine to the newly generated package directory nox -s prerelease_deps core_deps_from_source -- ../${{ matrix.canary }} \ No newline at end of file From a2f49124137a15e6212b1defa22b56f369b0984c Mon Sep 17 00:00:00 2001 From: ohmayr Date: Tue, 2 Jun 2026 00:00:09 +0000 Subject: [PATCH 12/12] update mypy check --- .github/workflows/experiment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/experiment.yml b/.github/workflows/experiment.yml index 610f28c023bc..44e31e4871bd 100644 --- a/.github/workflows/experiment.yml +++ b/.github/workflows/experiment.yml @@ -77,7 +77,7 @@ jobs: run: | # Library check: Execute directly from the generated package directory cd packages/${{ matrix.canary }} - nox -s mypy lint + nox -s mypy-3.14 lint - name: Run Prerelease and Core Deps run: |