Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 25 additions & 8 deletions .github/workflows/unittest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,21 +59,35 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
# Use a fetch-depth of 2 to avoid error `fatal: origin/main...HEAD: no merge base`
# See https://github.com/googleapis/google-cloud-python/issues/12013
# and https://github.com/actions/checkout#checkout-head.
with:
fetch-depth: 2
# Use fetch-depth of 0 (full history) so Git can find the merge-base with the
# target branch and calculate the exact list of modified packages.
fetch-depth: 0
persist-credentials: false
# We must explicitly fetch and set the target branch reference (main, etc.)
# to perform a relative diff (target_branch...HEAD). Comparing against a generic "HEAD~1"
# is fragile and fails if developers merge main back into their PR, if the PR has
# multiple commits, or if running inside a Merge Queue (merge_group) environment.
- name: Set target branch ref
id: target
env:
TARGET_BRANCH: ${{ github.base_ref || github.event.merge_group.base_ref || 'main' }}
run: |
git fetch origin $TARGET_BRANCH
target_sha=$(git rev-parse FETCH_HEAD)
echo "sha=${target_sha}" >> "$GITHUB_OUTPUT"
- name: Setup Python
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
with:
python-version: "3.10"
- name: Set number of files changes in packages and preview-packages directories
id: packages
env:
# Use TARGET_SHA...HEAD instead of HEAD~1 to accurately detect all files modified across the entire PR
TARGET_SHA: ${{ steps.target.outputs.sha }}
run: |
git diff HEAD~1 -- packages preview-packages > /dev/null
num_files_changed=$(git diff HEAD~1 -- packages preview-packages | wc -l | tr -d ' ')
git diff "$TARGET_SHA"...HEAD -- packages preview-packages > /dev/null
num_files_changed=$(git diff "$TARGET_SHA"...HEAD -- packages preview-packages | wc -l | tr -d ' ')
echo "num_files_changed=${num_files_changed}" >> "$GITHUB_OUTPUT"
- name: Install coverage
if: ${{ steps.packages.outputs.num_files_changed > 0 }}
Expand All @@ -91,9 +105,12 @@ jobs:
# TODO: default to 100% coverage after next gapic-generator release
# https://github.com/googleapis/google-cloud-python/issues/17459
DEFAULT_FAIL_UNDER: 99
TARGET_SHA: ${{ steps.target.outputs.sha }}
run: |
# Use target_ref to find all packages modified across the entire PR branch relative to target branch
target_ref="$TARGET_SHA"
# Find all modified packages
modified_packages=$(git diff --name-only HEAD~1 -- packages preview-packages | cut -d/ -f1,2 | sort -u)
modified_packages=$(git diff --name-only ${target_ref}...HEAD -- packages preview-packages | cut -d/ -f1,2 | sort -u)

existing_modified_packages=()
for pkg in ${modified_packages}; do
Expand Down Expand Up @@ -122,7 +139,7 @@ jobs:
fi

# Find all modified packages
modified_packages=$(git diff --name-only HEAD~1 -- packages preview-packages | cut -d/ -f1,2 | sort -u)
modified_packages=$(git diff --name-only ${target_ref}...HEAD -- packages preview-packages | cut -d/ -f1,2 | sort -u)

failed_packages=()
passed_packages=()
Expand Down
102 changes: 51 additions & 51 deletions .release-please-bulk-manifest.json
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
{
"packages/bigquery-magics": "0.15.0",
"packages/bigquery-magics": "0.15.1",
"packages/db-dtypes": "1.7.1",
"packages/django-google-spanner": "5.0.0",
"packages/gapic-generator": "1.37.1",
"packages/gcp-sphinx-docfx-yaml": "3.3.0",
"packages/google-ads-admanager": "0.10.0",
"packages/gapic-generator": "1.37.2",
"packages/gcp-sphinx-docfx-yaml": "3.3.1",
"packages/google-ads-admanager": "0.10.1",
"packages/google-ads-datamanager": "0.9.1",
"packages/google-ads-marketingplatform-admin": "0.6.0",
"packages/google-ai-generativelanguage": "0.12.0",
"packages/google-analytics-admin": "0.30.1",
"packages/google-analytics-data": "0.23.0",
"packages/google-api-core": "2.33.0",
"packages/google-api-core": "2.34.0",
"packages/google-apps-card": "0.7.0",
"packages/google-apps-chat": "0.10.3",
"packages/google-apps-chat": "0.10.4",
"packages/google-apps-events-subscriptions": "0.6.0",
"packages/google-apps-meet": "0.5.0",
"packages/google-apps-script-type": "0.8.0",
"packages/google-area120-tables": "0.15.0",
"packages/google-auth": "2.56.2",
"packages/google-auth-httplib2": "0.4.0",
"packages/google-auth": "2.56.3",
"packages/google-auth-httplib2": "0.4.1",
"packages/google-auth-oauthlib": "1.4.0",
"packages/google-backstory": "0.1.0",
"packages/google-cloud-access-approval": "1.20.0",
"packages/google-cloud-access-context-manager": "0.6.0",
"packages/google-cloud-access-context-manager": "0.6.1",
"packages/google-cloud-advisorynotifications": "0.7.0",
"packages/google-cloud-agentidentity": "0.1.0",
"packages/google-cloud-agentidentitycredentials": "0.1.0",
"packages/google-cloud-agentidentitycredentials": "0.1.1",
"packages/google-cloud-agentregistry": "0.1.0",
"packages/google-cloud-alloydb": "0.11.0",
"packages/google-cloud-alloydb-connectors": "0.5.0",
Expand All @@ -41,19 +41,19 @@
"packages/google-cloud-artifact-registry": "1.22.0",
"packages/google-cloud-asset": "4.4.0",
"packages/google-cloud-assured-workloads": "2.4.0",
"packages/google-cloud-audit-log": "0.6.0",
"packages/google-cloud-audit-log": "0.6.1",
"packages/google-cloud-auditmanager": "0.3.0",
"packages/google-cloud-automl": "2.20.0",
"packages/google-cloud-backupdr": "0.10.0",
"packages/google-cloud-backupdr": "0.10.1",
"packages/google-cloud-bare-metal-solution": "1.14.0",
"packages/google-cloud-batch": "0.22.1",
"packages/google-cloud-batch": "0.22.2",
"packages/google-cloud-beyondcorp-appconnections": "0.8.0",
"packages/google-cloud-beyondcorp-appconnectors": "0.8.0",
"packages/google-cloud-beyondcorp-appgateways": "0.8.0",
"packages/google-cloud-beyondcorp-clientconnectorservices": "0.8.0",
"packages/google-cloud-beyondcorp-clientgateways": "0.8.0",
"packages/google-cloud-biglake": "0.5.0",
"packages/google-cloud-biglake-hive": "0.3.1",
"packages/google-cloud-biglake": "0.5.1",
"packages/google-cloud-biglake-hive": "0.3.2",
"packages/google-cloud-bigquery-analyticshub": "0.9.0",
"packages/google-cloud-bigquery-biglake": "0.8.0",
"packages/google-cloud-bigquery-connection": "1.22.0",
Expand All @@ -63,12 +63,12 @@
"packages/google-cloud-bigquery-logging": "1.10.0",
"packages/google-cloud-bigquery-migration": "0.15.0",
"packages/google-cloud-bigquery-reservation": "1.25.0",
"packages/google-cloud-bigquery-storage": "2.39.0",
"packages/google-cloud-bigtable": "2.41.0",
"packages/google-cloud-bigquery-storage": "2.39.1",
"packages/google-cloud-bigtable": "2.41.1",
"packages/google-cloud-billing": "1.20.0",
"packages/google-cloud-billing-budgets": "1.21.0",
"packages/google-cloud-binary-authorization": "1.19.0",
"packages/google-cloud-build": "3.38.0",
"packages/google-cloud-binary-authorization": "1.19.1",
"packages/google-cloud-build": "3.38.1",
"packages/google-cloud-capacityplanner": "0.5.0",
"packages/google-cloud-certificate-manager": "1.14.0",
"packages/google-cloud-ces": "0.7.1",
Expand All @@ -77,7 +77,7 @@
"packages/google-cloud-cloudcontrolspartner": "0.6.0",
"packages/google-cloud-cloudsecuritycompliance": "0.8.0",
"packages/google-cloud-commerce-consumer-procurement": "0.6.0",
"packages/google-cloud-commerceproducer": "0.1.0",
"packages/google-cloud-commerceproducer": "0.1.1",
"packages/google-cloud-common": "1.10.0",
"packages/google-cloud-compute": "1.50.0",
"packages/google-cloud-compute-v1beta": "0.12.1",
Expand All @@ -86,9 +86,9 @@
"packages/google-cloud-configdelivery": "0.5.0",
"packages/google-cloud-contact-center-insights": "1.27.0",
"packages/google-cloud-container": "2.65.0",
"packages/google-cloud-containeranalysis": "2.22.0",
"packages/google-cloud-containeranalysis": "2.22.1",
"packages/google-cloud-contentwarehouse": "0.11.0",
"packages/google-cloud-core": "2.6.0",
"packages/google-cloud-core": "2.6.1",
"packages/google-cloud-data-fusion": "1.17.0",
"packages/google-cloud-data-qna": "0.14.0",
"packages/google-cloud-databasecenter": "0.9.0",
Expand All @@ -113,7 +113,7 @@
"packages/google-cloud-dms": "1.16.0",
"packages/google-cloud-dns": "0.37.0",
"packages/google-cloud-documentai": "3.15.0",
"packages/google-cloud-documentai-toolbox": "0.17.1",
"packages/google-cloud-documentai-toolbox": "0.17.2",
"packages/google-cloud-domains": "1.14.0",
"packages/google-cloud-edgecontainer": "0.8.1",
"packages/google-cloud-edgenetwork": "0.5.1",
Expand All @@ -122,20 +122,20 @@
"packages/google-cloud-essential-contacts": "1.14.0",
"packages/google-cloud-eventarc": "1.21.0",
"packages/google-cloud-eventarc-publishing": "0.10.1",
"packages/google-cloud-filestore": "1.17.0",
"packages/google-cloud-filestore": "1.17.1",
"packages/google-cloud-financialservices": "0.4.1",
"packages/google-cloud-firestore": "2.28.0",
"packages/google-cloud-firestore": "2.28.1",
"packages/google-cloud-functions": "1.24.0",
"packages/google-cloud-gdchardwaremanagement": "0.5.1",
"packages/google-cloud-geminidataanalytics": "0.13.1",
"packages/google-cloud-gke-backup": "0.8.1",
"packages/google-cloud-gke-connect-gateway": "0.13.1",
"packages/google-cloud-gke-hub": "1.25.0",
"packages/google-cloud-gke-hub": "1.25.1",
"packages/google-cloud-gke-multicloud": "0.9.1",
"packages/google-cloud-gkerecommender": "0.3.1",
"packages/google-cloud-gsuiteaddons": "0.5.1",
"packages/google-cloud-hypercomputecluster": "0.4.1",
"packages/google-cloud-iam": "2.24.0",
"packages/google-cloud-iam": "2.24.1",
"packages/google-cloud-iam-logging": "1.8.0",
"packages/google-cloud-iamconnectorcredentials": "0.1.1",
"packages/google-cloud-iap": "1.22.0",
Expand All @@ -146,26 +146,26 @@
"packages/google-cloud-licensemanager": "0.4.1",
"packages/google-cloud-life-sciences": "0.12.1",
"packages/google-cloud-locationfinder": "0.4.1",
"packages/google-cloud-logging": "3.16.1",
"packages/google-cloud-logging": "3.16.2",
"packages/google-cloud-lustre": "0.4.1",
"packages/google-cloud-maintenance-api": "0.4.1",
"packages/google-cloud-managed-identities": "1.16.0",
"packages/google-cloud-managedkafka": "0.4.1",
"packages/google-cloud-managedkafka-schemaregistry": "0.4.1",
"packages/google-cloud-media-translation": "0.14.1",
"packages/google-cloud-memcache": "1.16.0",
"packages/google-cloud-memorystore": "0.5.3",
"packages/google-cloud-memorystore": "0.5.4",
"packages/google-cloud-migrationcenter": "0.4.1",
"packages/google-cloud-modelarmor": "0.7.1",
"packages/google-cloud-monitoring": "2.31.0",
"packages/google-cloud-monitoring-dashboards": "2.22.0",
"packages/google-cloud-monitoring-metrics-scopes": "1.13.0",
"packages/google-cloud-ndb": "2.5.0",
"packages/google-cloud-ndb": "2.5.1",
"packages/google-cloud-netapp": "0.10.1",
"packages/google-cloud-network-connectivity": "2.16.0",
"packages/google-cloud-network-connectivity": "2.17.0",
"packages/google-cloud-network-management": "1.37.0",
"packages/google-cloud-network-security": "0.13.3",
"packages/google-cloud-network-services": "0.10.1",
"packages/google-cloud-network-services": "0.10.2",
"packages/google-cloud-notebooks": "1.17.0",
"packages/google-cloud-optimization": "1.15.0",
"packages/google-cloud-oracledatabase": "0.6.1",
Expand All @@ -183,14 +183,14 @@
"packages/google-cloud-private-catalog": "0.12.1",
"packages/google-cloud-privilegedaccessmanager": "0.4.1",
"packages/google-cloud-productregistry": "0.1.0",
"packages/google-cloud-pubsub": "2.39.0",
"packages/google-cloud-quotas": "0.6.1",
"packages/google-cloud-pubsub": "2.39.1",
"packages/google-cloud-quotas": "0.6.2",
"packages/google-cloud-rapidmigrationassessment": "0.4.1",
"packages/google-cloud-recaptcha-enterprise": "1.32.0",
"packages/google-cloud-recommendations-ai": "0.13.1",
"packages/google-cloud-recommender": "2.22.0",
"packages/google-cloud-redis": "2.22.0",
"packages/google-cloud-redis-cluster": "0.5.1",
"packages/google-cloud-redis-cluster": "0.5.2",
"packages/google-cloud-resource-manager": "1.18.0",
"packages/google-cloud-retail": "2.11.0",
"packages/google-cloud-run": "0.16.1",
Expand All @@ -202,25 +202,25 @@
"packages/google-cloud-security-publicca": "0.7.0",
"packages/google-cloud-securitycenter": "1.46.0",
"packages/google-cloud-securitycentermanagement": "0.5.0",
"packages/google-cloud-service-control": "1.20.0",
"packages/google-cloud-service-control": "1.21.0",
"packages/google-cloud-service-directory": "1.18.0",
"packages/google-cloud-service-management": "1.17.0",
"packages/google-cloud-service-usage": "1.17.0",
"packages/google-cloud-servicehealth": "0.5.0",
"packages/google-cloud-shell": "1.16.0",
"packages/google-cloud-source-context": "1.11.0",
"packages/google-cloud-spanner": "3.69.0",
"packages/google-cloud-spanner": "3.69.1",
"packages/google-cloud-speech": "2.40.0",
"packages/google-cloud-storage": "3.13.0",
"packages/google-cloud-storage-control": "1.12.0",
"packages/google-cloud-storage": "3.13.1",
"packages/google-cloud-storage-control": "1.13.0",
"packages/google-cloud-storage-transfer": "1.21.0",
"packages/google-cloud-storagebatchoperations": "0.8.0",
"packages/google-cloud-storageinsights": "0.5.0",
"packages/google-cloud-support": "0.5.1",
"packages/google-cloud-support": "0.5.2",
"packages/google-cloud-talent": "2.21.0",
"packages/google-cloud-tasks": "2.23.0",
"packages/google-cloud-tasks": "2.24.0",
"packages/google-cloud-telcoautomation": "0.5.1",
"packages/google-cloud-testutils": "1.9.1",
"packages/google-cloud-testutils": "1.9.2",
"packages/google-cloud-texttospeech": "2.37.0",
"packages/google-cloud-tpu": "1.27.0",
"packages/google-cloud-trace": "1.20.0",
Expand All @@ -240,7 +240,7 @@
"packages/google-cloud-workflows": "1.23.0",
"packages/google-cloud-workloadmanager": "0.2.1",
"packages/google-cloud-workstations": "0.8.1",
"packages/google-developer-knowledge": "0.1.0",
"packages/google-developer-knowledge": "0.1.1",
"packages/google-devicesandservices-health": "0.1.1",
"packages/google-geo-type": "0.7.0",
"packages/google-maps-addressvalidation": "0.7.0",
Expand All @@ -251,12 +251,12 @@
"packages/google-maps-isochrones": "0.1.0",
"packages/google-maps-mapmanagement": "0.1.0",
"packages/google-maps-mapsplatformdatasets": "0.8.0",
"packages/google-maps-navconnect": "0.2.0",
"packages/google-maps-navconnect": "0.2.1",
"packages/google-maps-places": "0.9.0",
"packages/google-maps-routeoptimization": "0.5.0",
"packages/google-maps-routing": "0.11.0",
"packages/google-maps-solar": "0.6.0",
"packages/google-resumable-media": "2.10.0",
"packages/google-resumable-media": "2.10.1",
"packages/google-shopping-css": "0.6.0",
"packages/google-shopping-merchant-accounts": "1.6.0",
"packages/google-shopping-merchant-conversions": "1.4.0",
Expand All @@ -273,10 +273,10 @@
"packages/google-shopping-merchant-reports": "1.5.0",
"packages/google-shopping-merchant-reviews": "0.6.0",
"packages/google-shopping-type": "1.5.0",
"packages/googleapis-common-protos": "1.75.0",
"packages/grafeas": "1.23.0",
"packages/grpc-google-iam-v1": "0.14.4",
"packages/proto-plus": "1.28.2",
"packages/sqlalchemy-bigquery": "1.17.1",
"packages/sqlalchemy-spanner": "1.19.0"
"packages/googleapis-common-protos": "1.75.1",
"packages/grafeas": "1.24.0",
"packages/grpc-google-iam-v1": "0.14.5",
"packages/proto-plus": "1.28.3",
"packages/sqlalchemy-bigquery": "1.17.2",
"packages/sqlalchemy-spanner": "1.20.0"
}
20 changes: 12 additions & 8 deletions ci/run_conditional_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,6 @@ set -eo pipefail
export PROJECT_ROOT=$(realpath $(dirname "${BASH_SOURCE[0]}")/..)
TARGET_BRANCH="${TARGET_BRANCH:-main}"

# Redirect git clones for core dependencies to the local repository.
# This serves two purposes:
# 1. Performance: Avoids repeated 100MB+ downloads of the monorepo for each dependency.
# 2. Correctness: Ensures that changes in core packages (like google-api-core) are
# tested against downstream packages in the same Pull Request.
git config --global url."${PROJECT_ROOT}".insteadOf "https://github.com/googleapis/google-cloud-python"
git config --global url."${PROJECT_ROOT}".insteadOf "https://github.com/googleapis/google-cloud-python.git"

# A script file for running the test in a sub project.
test_script="${PROJECT_ROOT}/ci/run_single_test.sh"

Expand All @@ -68,6 +60,18 @@ else
GIT_DIFF_ARG=""
fi

# Redirect git clones for core dependencies to the local repository.
# This serves two purposes:
# 1. Performance: Avoids repeated 100MB+ downloads of the monorepo for each dependency.
# 2. Correctness: Ensures that changes in core packages (like google-api-core) are
# tested against downstream packages in the same Pull Request.
#
# NOTE: This configuration MUST be set AFTER `git fetch origin` above, otherwise Git will
# intercept and redirect `git fetch origin` to the local repository instead of GitHub,
# breaking target branch fetching and package change detection.
git config --global url."${PROJECT_ROOT}".insteadOf "https://github.com/googleapis/google-cloud-python"
git config --global url."${PROJECT_ROOT}".insteadOf "https://github.com/googleapis/google-cloud-python.git"
Comment on lines +72 to +73

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

When configuring multiple insteadOf values for the same key, subsequent git config commands without the --add option will overwrite the previous values rather than appending them. Additionally, if the script is run multiple times on a persistent runner, git config may fail with an error indicating that the key has multiple values.

To ensure both patterns are correctly registered and to avoid potential errors, use --replace-all for the first entry and --add for the subsequent entries.

Suggested change
git config --global url."${PROJECT_ROOT}".insteadOf "https://github.com/googleapis/google-cloud-python"
git config --global url."${PROJECT_ROOT}".insteadOf "https://github.com/googleapis/google-cloud-python.git"
git config --global --replace-all url."${PROJECT_ROOT}".insteadOf "https://github.com/googleapis/google-cloud-python"
git config --global --add url."${PROJECT_ROOT}".insteadOf "https://github.com/googleapis/google-cloud-python.git"


# Then detect changes in the test scripts.

set +e
Expand Down
Loading
Loading