Skip to content

Commit 5bf67e3

Browse files
authored
Merge branch 'main' into renovate/github-actions
2 parents 47ea75b + 44e39ad commit 5bf67e3

13 files changed

Lines changed: 334 additions & 114 deletions

.claude-plugin/marketplace.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,7 @@
99
"plugins": [
1010
{
1111
"name": "spanner",
12-
"source": {
13-
"source": "git",
14-
"url": "https://github.com/gemini-cli-extensions/spanner.git"
15-
},
12+
"source": "./",
1613
"policy": {
1714
"installation": "AVAILABLE",
1815
"authentication": "ON_INSTALL"

.claude-plugin/plugin.json

Lines changed: 2 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "spanner",
3-
"version": "0.3.1",
3+
"version": "0.3.4",
44
"description": "Connect and interact with Spanner data using natural language.",
55
"author": {
66
"name": "Google LLC",
@@ -9,31 +9,5 @@
99
"homepage": "https://cloud.google.com/spanner",
1010
"license": "Apache-2.0",
1111
"repository": "https://github.com/gemini-cli-extensions/spanner",
12-
"skills": "./skills/",
13-
"userConfig": {
14-
"spanner_project": {
15-
"title": "Project ID",
16-
"description": "ID of the Google Cloud project",
17-
"type": "string",
18-
"sensitive": false
19-
},
20-
"spanner_instance": {
21-
"title": "Instance",
22-
"description": "ID of the Spanner instance",
23-
"type": "string",
24-
"sensitive": false
25-
},
26-
"spanner_database": {
27-
"title": "Database",
28-
"description": "ID of the Spanner database",
29-
"type": "string",
30-
"sensitive": false
31-
},
32-
"spanner_dialect": {
33-
"title": "Database Dialect",
34-
"description": "(Optional) The SQL dialect of the Spanner Database: 'googlesql' or 'postgresql'. (Default: 'googlesql')",
35-
"type": "string",
36-
"sensitive": false
37-
}
38-
}
12+
"skills": "./skills/"
3913
}

.codex-plugin/plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "spanner",
3-
"version": "0.3.1",
3+
"version": "0.3.4",
44
"description": "Connect and interact with Spanner data using natural language.",
55
"author": {
66
"name": "Google LLC",

.github/scripts/generate_skills.sh

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
#!/bin/bash
2+
set -e
3+
4+
# Ensure VERSION is passed from the environment
5+
if [ -z "$VERSION" ]; then
6+
echo "Error: VERSION environment variable is not set."
7+
exit 1
8+
fi
9+
10+
# SKILL CONFIGURATION
11+
# Format: "toolset" "description"
12+
# The skill name is automatically generated as "spanner-<toolset>"
13+
SKILLS=(
14+
"data"
15+
"Use these skills when you need to explore the database structure, discover schema objects like tables and graphs, and execute custom SQL queries to interact with your data."
16+
17+
"data_with_discovery"
18+
"Use these skills when you need to explore the database structure, discover schema objects like tables and graphs, execute custom SQL queries, and search the data catalog to find relevant instances, databases, tables, or views."
19+
)
20+
21+
echo "VALIDATING TOOLSETS BEFORE GENERATION"
22+
23+
# Dynamically build the SUPPORTED_TOOLSETS array from the SKILLS array.
24+
# We use 'set --' to process the array in chunks without index arithmetic.
25+
SUPPORTED_TOOLSETS=()
26+
set -- "${SKILLS[@]}"
27+
while [ $# -gt 0 ]; do
28+
SUPPORTED_TOOLSETS+=("$1")
29+
shift 2
30+
done
31+
32+
echo "Currently Supported Toolsets: ${SUPPORTED_TOOLSETS[*]}"
33+
34+
# Fetch the upstream source of truth YAML for this specific version
35+
RAW_URL="https://raw.githubusercontent.com/googleapis/mcp-toolbox/v${VERSION}/internal/prebuiltconfigs/tools/spanner.yaml"
36+
echo "Fetching upstream config from: $RAW_URL"
37+
UPSTREAM_YAML=$(curl -sL --fail "$RAW_URL" || { echo "Error: Could not fetch upstream YAML for v$VERSION"; exit 1; })
38+
39+
# Extract the list of toolsets. Each toolset is its own YAML document:
40+
# kind: toolset
41+
# name: <toolset>
42+
UPSTREAM_TOOLSETS=$(echo "$UPSTREAM_YAML" | awk '$1=="kind:" && $2=="toolset"{f=1; next} f && $1=="name:"{print $2; f=0}')
43+
44+
# Compare upstream toolsets against our supported list
45+
MISSING_TOOLSETS=false
46+
47+
for upstream_tool in $UPSTREAM_TOOLSETS; do
48+
if [ -z "$upstream_tool" ] || [ "$upstream_tool" == "-" ]; then continue; fi
49+
50+
if [[ ! " ${SUPPORTED_TOOLSETS[*]} " =~ " ${upstream_tool} " ]]; then
51+
echo "ERROR: Upstream configuration contains a new toolset: '$upstream_tool'"
52+
MISSING_TOOLSETS=true
53+
fi
54+
done
55+
56+
if [ "$MISSING_TOOLSETS" = true ]; then
57+
echo "PIPELINE FAILED: Missing Toolset Generators"
58+
echo "The source of truth file has toolsets that your script does not support."
59+
echo "Please update the SKILLS array in generate_skills.sh to include generators"
60+
echo "for the missing toolsets above, then commit your changes to unblock this PR."
61+
exit 1
62+
fi
63+
64+
echo "Validation passed. All upstream toolsets are supported."
65+
66+
echo "BEGINNING SKILL GENERATION"
67+
68+
LICENSE_HEADER="// Copyright 2026 Google LLC
69+
//
70+
// Licensed under the Apache License, Version 2.0 (the \"License\");
71+
// you may not use this file except in compliance with the License.
72+
// You may obtain a copy of the License at
73+
//
74+
// http://www.apache.org/licenses/LICENSE-2.0
75+
//
76+
// Unless required by applicable law or agreed to in writing, software
77+
// distributed under the License is distributed on an \"AS IS\" BASIS,
78+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
79+
// See the License for the specific language governing permissions and
80+
// limitations under the License."
81+
82+
ADDITIONAL_NOTES="Note: The scripts automatically load the environment variables from various .env files. Do not ask the user to set vars unless skill executions fails due to env var absence."
83+
84+
# Base Command Function
85+
generate_skill() {
86+
local TOOLSET="$1"
87+
local SKILL_DESC="$2"
88+
local SKILL_NAME="spanner-$TOOLSET"
89+
90+
echo "Generating skill: $SKILL_NAME..."
91+
92+
npx "@toolbox-sdk/server@${VERSION}" --prebuilt spanner skills-generate \
93+
--name "$SKILL_NAME" \
94+
--description "$SKILL_DESC" \
95+
--toolset="$TOOLSET" \
96+
--license-header "$LICENSE_HEADER" \
97+
--additional-notes="$ADDITIONAL_NOTES"
98+
}
99+
100+
set -- "${SKILLS[@]}"
101+
while [ $# -gt 0 ]; do
102+
generate_skill "$1" "$2"
103+
shift 2
104+
done
105+
106+
echo "All skills generated successfully!"
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# Copyright 2026 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
name: Generate Skills
16+
17+
on:
18+
pull_request:
19+
paths:
20+
- "toolbox_version.txt"
21+
22+
jobs:
23+
generate-skills:
24+
# Only run for same-repo PRs (e.g. renovate's toolbox bump), where the
25+
# built-in GITHUB_TOKEN can push back to the PR branch.
26+
if: github.event.pull_request.head.repo.full_name == github.repository
27+
runs-on: ubuntu-latest
28+
permissions:
29+
contents: write
30+
steps:
31+
- name: Check out PR branch
32+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
33+
with:
34+
ref: ${{ github.head_ref }}
35+
36+
- name: Generate skills
37+
run: |
38+
VERSION="$(tr -d '\n' < toolbox_version.txt)"
39+
echo "Detected toolbox version: $VERSION"
40+
export VERSION
41+
chmod +x ./.github/scripts/generate_skills.sh
42+
./.github/scripts/generate_skills.sh
43+
44+
- name: Commit and push regenerated skills
45+
run: |
46+
if [ -z "$(git status --porcelain)" ]; then
47+
echo "No skill changes generated. Nothing to commit."
48+
exit 0
49+
fi
50+
51+
echo "Changes detected. Committing regenerated skills..."
52+
git config user.name "release-please[bot]"
53+
git config user.email "55107282+release-please[bot]@users.noreply.github.com"
54+
55+
git add .
56+
git commit -m "chore: auto-generate skills for toolbox v$(tr -d '\n' < toolbox_version.txt)"
57+
git push

.lycheeignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
https://github.com/gemini-cli-extensions/spanner/compare/
2+
https://www.npmjs.com/package/skills
3+
https://agent-plugins.org/compatible-clients

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "0.3.1"
2+
".": "0.3.4"
33
}

0 commit comments

Comments
 (0)