Skip to content

Commit 72503de

Browse files
Merge branch 'main' into ci_sharding
2 parents 7b565a4 + 690c15d commit 72503de

778 files changed

Lines changed: 161334 additions & 40131 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.

.github/CODEOWNERS

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
# - @googleapis/bigtable-team
1717
# - @googleapis/cloud-sdk-auth-team
1818
# - @googleapis/cloud-sdk-python-team
19-
# - @googleapis/dkp-team
2019
# - @googleapis/firestore-team
2120
# - @googleapis/gcs-team
2221
# - @googleapis/pubsub-team
@@ -33,7 +32,6 @@
3332
/packages/bigquery-magics/ @googleapis/bigquery-team @googleapis/bigquery-dataframe-team
3433
/packages/db-dtypes/ @googleapis/bigquery-team @googleapis/bigquery-dataframe-team
3534
/packages/django-google-spanner/ @googleapis/spanner-team
36-
/packages/gcp-sphinx-docfx-yaml/ @googleapis/dkp-team
3735
/packages/google-auth/ @googleapis/cloud-sdk-auth-team @googleapis/aion-team
3836
/packages/google-cloud-bigquery*/ @googleapis/bigquery-team @googleapis/bigquery-dataframe-team
3937
/packages/google-cloud-bigtable/ @googleapis/bigtable-team

.github/release-please.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
handleGHRelease: true
2+
manifest: true
3+
tagPullRequestNumber: true
4+
5+
branches:
6+
- branch: main
7+
handleGHRelease: true
8+
tagPullRequestNumber: true
9+
manifest: true
10+
manifestFile: .release-please-bulk-manifest.json
11+
manifestConfig: release-please-bulk-config.json
12+
- branch: main
13+
handleGHRelease: true
14+
tagPullRequestNumber: true
15+
manifest: true
16+
manifestFile: .release-please-individual-manifest.json
17+
manifestConfig: release-please-individual-config.json

.github/workflows/django-spanner-django5.2_tests.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
outputs:
2222
run_django_spanner: ${{ steps.filter.outputs.django_spanner }}
2323
steps:
24-
- uses: actions/checkout@v4
24+
- uses: actions/checkout@v6
2525
- uses: dorny/paths-filter@v3
2626
id: filter
2727
with:
@@ -68,9 +68,9 @@ jobs:
6868

6969
steps:
7070
- name: Checkout code
71-
uses: actions/checkout@v4
71+
uses: actions/checkout@v6
7272
- name: Setup Python
73-
uses: actions/setup-python@v5
73+
uses: actions/setup-python@v6
7474
with:
7575
python-version: "3.10"
7676
- name: Run Django tests

.github/workflows/librarian_config_check.yml

Lines changed: 0 additions & 43 deletions
This file was deleted.

.github/workflows/unittest.yml

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,14 @@ jobs:
4949
name: ${{ matrix.package_shard.is_sharded && format('unit ({0}, {1})', matrix.python, matrix.package_shard.name) || format('unit ({0})', matrix.python) }}
5050
steps:
5151
- name: Checkout
52-
uses: actions/checkout@v4
52+
uses: actions/checkout@v6
5353
# Use a fetch-depth of 2 to avoid error `fatal: origin/main...HEAD: no merge base`
5454
# See https://github.com/googleapis/google-cloud-python/issues/12013
5555
# and https://github.com/actions/checkout#checkout-head.
5656
with:
5757
fetch-depth: 2
5858
- name: Setup Python
59-
uses: actions/setup-python@v5
59+
uses: actions/setup-python@v6
6060
with:
6161
python-version: ${{ matrix.python }}
6262
- name: Install nox
@@ -116,27 +116,40 @@ jobs:
116116
python-version: "3.10"
117117
- name: Set number of files changes in packages directory
118118
id: packages
119-
run: echo "num_files_changed=$(git diff HEAD~1 -- packages | wc -l)" >> $GITHUB_OUTPUT
119+
run: |
120+
git diff HEAD~1 -- packages > /dev/null
121+
num_files_changed=$(git diff HEAD~1 -- packages | wc -l | tr -d ' ')
122+
echo "num_files_changed=${num_files_changed}" >> "$GITHUB_OUTPUT"
120123
- name: Install coverage
121-
if: steps.packages.outputs.num_files_changed > 0
124+
if: ${{ steps.packages.outputs.num_files_changed > 0 }}
122125
run: |
123126
python -m pip install --upgrade setuptools pip wheel
124127
python -m pip install coverage
125128
- name: Download coverage results
126-
if: steps.packages.outputs.num_files_changed > 0
127-
uses: actions/download-artifact@v4
129+
if: ${{ steps.packages.outputs.num_files_changed > 0 }}
130+
uses: actions/download-artifact@v5
128131
with:
129132
path: .coverage-results/
130133
- name: Report coverage results
131-
if: steps.packages.outputs.num_files_changed > 0
134+
if: ${{ steps.packages.outputs.num_files_changed > 0 }}
132135
env:
133136
# TODO: default to 100% coverage after next gapic-generator release
134137
# https://github.com/googleapis/google-cloud-python/issues/17459
135138
DEFAULT_FAIL_UNDER: 99
136139
run: |
137140
if [ -d .coverage-results ]; then
138-
find .coverage-results -type f -name '.coverage*' -exec mv {} . \;
139-
coverage combine
141+
# Unzip any zipped coverage results
142+
find .coverage-results -type f -name '*.zip' -exec unzip -o {} \;
143+
144+
# Find all coverage files and combine them.
145+
# We find files starting with .coverage (excluding .coveragerc files and templates)
146+
coverage_files=$(find .coverage-results . -type f -name '.coverage*' ! -name '.coveragerc*')
147+
if [ -n "${coverage_files}" ]; then
148+
coverage combine ${coverage_files}
149+
else
150+
echo "Error: No coverage files found to combine."
151+
exit 1
152+
fi
140153
141154
# Find all modified packages
142155
modified_packages=$(git diff --name-only HEAD~1 -- packages | cut -d/ -f1,2 | sort -u)
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
name: Version Scan
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- '**version-scanner**'
8+
schedule:
9+
- cron: '0 * * * *' # Run hourly at the top of the hour
10+
workflow_dispatch:
11+
12+
permissions:
13+
contents: read
14+
issues: write
15+
16+
jobs:
17+
scan:
18+
name: Version Scan
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v6
22+
23+
- name: Set up Python
24+
uses: actions/setup-python@v6
25+
with:
26+
python-version: '3.14'
27+
28+
- name: Install dependencies
29+
run: |
30+
python -m pip install --upgrade pip
31+
pip install pyyaml
32+
33+
- name: Run Version Scanner
34+
run: |
35+
# Uses -o to output a detailed, raw CSV to a file
36+
# Uses --stdout to print a slim, easier to parse summary to the GitHub Actions UI
37+
# Uses --soft-fail to temporarily limit causing CI/CD failures during the migration to full operation.
38+
python scripts/version_scanner/version_scanner.py -d python -v 3.7 --stdout -o version_scanner_output.csv --soft-fail
39+
40+
- name: Upload CSV Results
41+
if: always()
42+
uses: actions/upload-artifact@v7
43+
with:
44+
name: version-scanner-results
45+
path: version_scanner_output.csv
46+
47+
- name: Create or update issue on finding
48+
if: failure()
49+
env:
50+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
51+
run: |
52+
TITLE="Version Scanner found deprecated dependencies"
53+
RUN_URL="${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
54+
55+
# Read the first 50 lines to prevent blowing up the issue body if it's massive
56+
CSV_PREVIEW=$(head -n 50 version_scanner_output.csv)
57+
58+
BODY="The [Version Scanner]($RUN_URL) found deprecated dependencies in the repository.
59+
60+
**Matches Found:**
61+
\`\`\`csv
62+
$CSV_PREVIEW
63+
\`\`\`
64+
*(If there are more than 50 matches, see the workflow logs for the full list)*"
65+
66+
# Mirroring regenerate-all.yml: check if an issue already exists to prevent spam
67+
EXISTING_ISSUE=$(gh issue list --state open --search "in:title \"$TITLE\"" --json number --jq '.[0].number')
68+
69+
if [ -z "$EXISTING_ISSUE" ]; then
70+
echo "WOULD HAVE CREATED ISSUE:"
71+
echo "gh issue create --title \"$TITLE\" --body \"$BODY\""
72+
# gh issue create --title "$TITLE" --body "$BODY"
73+
else
74+
echo "Issue #$EXISTING_ISSUE already exists."
75+
echo "WOULD HAVE ADDED COMMENT:"
76+
echo "gh issue comment \"$EXISTING_ISSUE\" --body \"Another scanner run found deprecated dependencies: $RUN_URL\""
77+
# gh issue comment "$EXISTING_ISSUE" --body "Another scanner run found deprecated dependencies: $RUN_URL"
78+
fi

.librarian/config.yaml

Lines changed: 0 additions & 45 deletions
This file was deleted.

.librarian/generator-input/client-post-processing/firestore-integration.yaml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -564,6 +564,34 @@ replacements:
564564
"freezegun",
565565
]
566566
count: 1
567+
- paths: [
568+
packages/google-cloud-firestore/noxfile.py
569+
]
570+
before: |
571+
SYSTEM_TEST_STANDARD_DEPENDENCIES = \[
572+
"mock",
573+
"pytest",
574+
"google-cloud-testutils",
575+
\]
576+
after: |
577+
SYSTEM_TEST_STANDARD_DEPENDENCIES = [
578+
"mock",
579+
"pytest",
580+
]
581+
count: 1
582+
- paths: [
583+
packages/google-cloud-firestore/noxfile.py
584+
]
585+
before: |
586+
SYSTEM_TEST_LOCAL_DEPENDENCIES: List\[str\] = \[\]
587+
after: |
588+
SYSTEM_TEST_LOCAL_DEPENDENCIES: List[str] = [
589+
"../google-cloud-testutils"
590+
]
591+
count: 1
592+
# TODO(https://github.com/googleapis/google-cloud-python/issues/17429):
593+
# Temporary post-processing rule to add pytest-xdist dependency.
594+
# Remove this once gapic-generator includes pytest-xdist by default.
567595
- paths: [
568596
packages/google-cloud-firestore/noxfile.py
569597
]
@@ -574,6 +602,7 @@ replacements:
574602
"pytest-asyncio",
575603
"six",
576604
"pyyaml",
605+
"pytest-xdist",
577606
]
578607
count: 1
579608
- paths: [
@@ -584,6 +613,54 @@ replacements:
584613
after: |
585614
"pytest-asyncio==0.21.2",
586615
count: 2
616+
# TODO(https://github.com/googleapis/google-cloud-python/issues/17429):
617+
# Temporary post-processing rule to inject `-n auto` for Firestore parallel tests.
618+
# This rule should be removed once the generator template changes are released
619+
# and the generator version is updated in librarian.yaml.
620+
- paths: [
621+
packages/google-cloud-firestore/noxfile.py
622+
]
623+
before: |
624+
# Run py.test against the system tests\.
625+
if system_test_exists:
626+
session\.run\(
627+
"py.test",
628+
"--quiet",
629+
f"--junitxml=system_\{session\.python\}_sponge_log\.xml",
630+
system_test_path,
631+
\*session\.posargs,
632+
\)
633+
if system_test_folder_exists:
634+
session\.run\(
635+
"py.test",
636+
"--quiet",
637+
f"--junitxml=system_\{session\.python\}_sponge_log\.xml",
638+
system_test_folder_path,
639+
\*session\.posargs,
640+
\)
641+
after: |
642+
# Run py.test against the system tests.
643+
if system_test_exists:
644+
session.run(
645+
"py.test",
646+
"-n",
647+
"10",
648+
"--quiet",
649+
f"--junitxml=system_{session.python}_sponge_log.xml",
650+
system_test_path,
651+
*session.posargs,
652+
)
653+
if system_test_folder_exists:
654+
session.run(
655+
"py.test",
656+
"-n",
657+
"10",
658+
"--quiet",
659+
f"--junitxml=system_{session.python}_sponge_log.xml",
660+
system_test_folder_path,
661+
*session.posargs,
662+
)
663+
count: 1
587664
- paths: [
588665
"packages/google-cloud-firestore/docs/conf.py",
589666
]

0 commit comments

Comments
 (0)