Skip to content

Commit 36f5905

Browse files
committed
Merge branch 'main' into migrate-layer-traffic
2 parents 06d3864 + 9ddf10a commit 36f5905

2,741 files changed

Lines changed: 340356 additions & 95830 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/blunderbuss.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@
1515
assign_issues:
1616
- googlemaps/devrel
1717
assign_prs:
18-
- googlemaps/devrel
18+
- googlemaps/devrel

.github/dependabot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ updates:
2020
interval: "weekly"
2121
ignore:
2222
- dependency-name: "three"
23-
- dependency-name: "@types/three"
23+
- dependency-name: "@types/three"

.github/header-checker-lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ sourceFileExtensions:
1414
- .sh
1515
- .swift
1616
- .ts
17-
- .yml
17+
- .yml

.github/snippet-bot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
alwaysCreateStatusCheck: true
22
ignoreFiles:
3-
- "samples/*.sh"
3+
- "samples/*.sh"

.github/workflows/approve-merge.yml

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

.github/workflows/dependabot.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,7 @@ jobs:
3232
run: gh pr comment --body "@dependabot rebase" "$PR_URL"
3333
- name: approve
3434
run: gh pr review --approve "$PR_URL"
35-
- name: merge
36-
run: gh pr merge --auto --squash --delete-branch "$PR_URL"
35+
# Merge step is commented out to prevent auto merging.
36+
# This allows us to review version updates for breakage before publishing.
37+
# - name: merge
38+
# run: gh pr merge --auto --squash --delete-branch "$PR_URL"

.github/workflows/dist-pr.yml

Lines changed: 60 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,41 +12,93 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
name: Create release PR for dist
15+
name: Create, approve, and merge release PR for dist
1616

1717
on:
1818
workflow_dispatch:
1919
inputs:
2020
source_run_id:
21-
description: 'ID of the upstream workflow run that triggered this'
21+
description: "ID of the upstream workflow run that triggered this"
2222
required: false
2323
type: string
2424

2525
jobs:
26-
create-pr:
26+
create-approve-merge-pr:
2727
runs-on: ubuntu-latest
2828
permissions:
2929
pull-requests: write
3030
contents: write
31+
3132
steps:
3233
- name: Checkout code
33-
uses: actions/checkout@v3
34+
uses: actions/checkout@v4
3435
with:
3536
token: ${{ secrets.GH_MERGE_TOKEN }}
36-
fetch-depth: 0 # Fetch all history
37+
fetch-depth: 0
3738

3839
- name: Set Git Identity
3940
run: |
4041
git config --global user.name 'googlemaps-bot'
4142
git config --global user.email 'googlemaps-bot@google.com'
4243
44+
- name: Ensure temp branch exists on origin
45+
run: |
46+
git fetch origin temp-build-branch:temp-build-branch
47+
git ls-remote --exit-code --heads origin temp-build-branch
48+
49+
- name: Find existing PR
50+
id: find_pr
51+
env:
52+
GH_TOKEN: ${{ secrets.GH_MERGE_TOKEN }}
53+
run: |
54+
PR_URL="$(gh pr list \
55+
--base main \
56+
--head temp-build-branch \
57+
--state open \
58+
--json url \
59+
--jq '.[0].url')"
60+
61+
if [ -n "$PR_URL" ] && [ "$PR_URL" != "null" ]; then
62+
echo "pr_url=$PR_URL" >> "$GITHUB_OUTPUT"
63+
echo "pr_exists=true" >> "$GITHUB_OUTPUT"
64+
else
65+
echo "pr_exists=false" >> "$GITHUB_OUTPUT"
66+
fi
67+
4368
- name: Create Pull Request
69+
id: create_pr
70+
if: steps.find_pr.outputs.pr_exists != 'true'
71+
env:
72+
GH_TOKEN: ${{ secrets.GH_MERGE_TOKEN }}
4473
run: |
45-
gh pr create \
74+
PR_URL="$(gh pr create \
4675
--base main \
4776
--head temp-build-branch \
4877
--title "chore: automated output update (dist)" \
4978
--body "This PR contains updated build output from the dist branch." \
50-
--label "automated pr,dist-update"
79+
--label "automated pr" \
80+
--label "dist-update")"
81+
echo "pr_url=$PR_URL" >> "$GITHUB_OUTPUT"
82+
83+
- name: Determine PR URL
84+
id: pr
85+
run: |
86+
if [ "${{ steps.find_pr.outputs.pr_exists }}" = "true" ]; then
87+
echo "pr_url=${{ steps.find_pr.outputs.pr_url }}" >> "$GITHUB_OUTPUT"
88+
else
89+
echo "pr_url=${{ steps.create_pr.outputs.pr_url }}" >> "$GITHUB_OUTPUT"
90+
fi
91+
92+
- name: Approve PR
5193
env:
52-
GH_TOKEN: ${{ secrets.GH_MERGE_TOKEN }}
94+
PR_URL: ${{ steps.pr.outputs.pr_url }}
95+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
96+
run: |
97+
gh pr review --approve "$PR_URL"
98+
99+
- name: Enable auto-merge
100+
env:
101+
PR_URL: ${{ steps.pr.outputs.pr_url }}
102+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
103+
run: |
104+
gh pr merge --auto --squash --delete-branch "$PR_URL"

.github/workflows/release.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ on:
1919
branches:
2020
- main
2121
paths:
22-
- 'samples/**'
22+
- "samples/**"
2323

2424
jobs:
2525
release:
@@ -51,7 +51,7 @@ jobs:
5151
5252
- uses: actions/setup-node@v4
5353
with:
54-
node-version: '24.x'
54+
node-version: "24.x"
5555

5656
- run: npm i
5757

@@ -93,7 +93,7 @@ jobs:
9393
echo " - samples/$workspace"
9494
rm -rf dist/samples/$workspace
9595
done
96-
96+
9797
- name: Generate Index
9898
run: bash samples/generate-index.sh
9999

@@ -130,6 +130,6 @@ jobs:
130130
uses: benc-uk/workflow-dispatch@v1
131131
with:
132132
workflow: dist-pr.yml
133-
ref: 'temp-build-branch'
133+
ref: "main"
134134
token: ${{ secrets.GH_APPROVER_TOKEN }} # Use the same token that pushed, it needs 'workflows: write' permissions
135135
inputs: '{ "source_run_id": "${{ github.run_id }}" }' # Optional: Pass the run ID for traceability
Lines changed: 25 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -12,24 +12,24 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
name: Playwright Tests
15+
name: Tests
1616

1717
on:
1818
pull_request:
1919
types: [opened, synchronize, edited]
2020
paths:
21-
- 'samples/**'
22-
- 'e2e/samples.spec.ts'
23-
- 'playwright.config.ts'
24-
- 'package.json'
21+
- "samples/**"
22+
- "e2e/samples.spec.ts"
23+
- "playwright.config.ts"
24+
- "package.json"
2525
push:
2626
branches:
2727
- main
2828
paths:
29-
- 'samples/**'
30-
- 'e2e/samples.spec.ts'
31-
- 'playwright.config.ts'
32-
- 'package.json'
29+
- "samples/**"
30+
- "e2e/samples.spec.ts"
31+
- "playwright.config.ts"
32+
- "package.json"
3333
schedule:
3434
- cron: "0 12 * * *"
3535

@@ -74,7 +74,7 @@ jobs:
7474
if: env.HAS_CHANGES == 'true'
7575
uses: actions/setup-node@v4
7676
with:
77-
node-version: '24.x'
77+
node-version: "24.x"
7878

7979
- name: Cache npm dependencies
8080
if: env.HAS_CHANGES == 'true'
@@ -108,17 +108,29 @@ jobs:
108108
if: env.HAS_CHANGES == 'true'
109109
run: npm install
110110

111+
- name: Prettier Check
112+
if: env.HAS_CHANGES == 'true'
113+
run: npx prettier ./samples/ --check --log-level warn
114+
env:
115+
CI: true
116+
117+
- name: ESLint Check
118+
if: env.HAS_CHANGES == 'true'
119+
run: npx eslint
120+
env:
121+
CI: true
122+
111123
- name: Install Playwright Browsers
112124
if: steps.playwright-cache.outputs.cache-hit != 'true' && env.HAS_CHANGES == 'true'
113125
run: npx playwright install chromium --with-deps
114-
126+
115127
- name: Build Changed Workspaces
116128
if: env.HAS_CHANGES == 'true'
117129
run: |
118130
IFS=$'\n'
119131
CHANGED_WORKSPACES_ARRAY=(${STEPS_GET_WORKSPACES_OUTPUTS_CHANGED_WORKSPACES})
120132
echo "Changed Workspaces Array: ${CHANGED_WORKSPACES_ARRAY[@]}"
121-
133+
122134
echo "Building changed workspaces:"
123135
for workspace in "${CHANGED_WORKSPACES_ARRAY[@]}"; do
124136
echo " - samples/$workspace"
@@ -162,7 +174,7 @@ jobs:
162174
- name: Setup Node.js
163175
uses: actions/setup-node@v4
164176
with:
165-
node-version: '24.x'
177+
node-version: "24.x"
166178

167179
- name: Cache npm dependencies
168180
uses: actions/cache@v4
@@ -211,10 +223,3 @@ jobs:
211223
with:
212224
name: Test Results
213225
path: test-results/
214-
215-
- name: Create Issue on Failure
216-
if: failure()
217-
run: |
218-
gh issue create --title "Nightly Playwright Tests Failed" --body "The nightly E2E tests failed. Please check the logs: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
219-
env:
220-
GH_TOKEN: ${{ github.token }}

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ samples/.env
66

77
# Ignore dist files generated by build.
88
samples/*/dist/
9-
samples/**/*.js
9+
samples/*/*.js
1010

1111
# Ignore playwright outputs
1212
/test-results/

0 commit comments

Comments
 (0)