Skip to content

Commit 794834e

Browse files
Merge branch 'main' into main
2 parents 04c615d + 223d9a7 commit 794834e

File tree

116 files changed

+11995
-1716
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

116 files changed

+11995
-1716
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "1.24.1"
2+
".": "1.25.1"
33
}

.github/release-please-config.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
3+
"last-release-sha": "9f7d5b3f1476234e552b783415527cc4bac55b39",
34
"packages": {
45
".": {
56
"release-type": "python",

.github/workflows/python-unit-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
run: |
4444
uv venv .venv
4545
source .venv/bin/activate
46-
uv sync --extra test --extra eval --extra a2a
46+
uv sync --extra test
4747
4848
- name: Run unit tests with pytest
4949
run: |

.github/workflows/release-cherry-pick.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# Cherry-picks a commit from main to the release/candidate branch.
2-
# Use this to include bug fixes in an in-progress release.
1+
# Step 3 (optional): Cherry-picks a commit from main to the release/candidate branch.
2+
# Use between step 1 and step 4 to include bug fixes in an in-progress release.
33
name: "Release: Cherry-pick"
44

55
on:
@@ -42,5 +42,5 @@ jobs:
4242
env:
4343
GH_TOKEN: ${{ github.token }}
4444
run: |
45-
gh workflow run release-please.yml --repo ${{ github.repository }}
45+
gh workflow run release-please.yml --repo ${{ github.repository }} --ref release/candidate
4646
echo "Triggered Release Please workflow"

.github/workflows/release-cut.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# Starts the release process by creating a release/candidate branch.
2-
# Triggers release-please to generate a changelog PR.
1+
# Step 1: Starts the release process by creating a release/candidate branch.
2+
# Generates a changelog PR for review (step 2).
33
name: "Release: Cut"
44

55
on:
@@ -42,5 +42,5 @@ jobs:
4242
env:
4343
GH_TOKEN: ${{ github.token }}
4444
run: |
45-
gh workflow run release-please.yml --repo ${{ github.repository }}
45+
gh workflow run release-please.yml --repo ${{ github.repository }} --ref release/candidate
4646
echo "Triggered Release Please workflow"

.github/workflows/release-finalize.yml

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# Triggers when release-please PR is merged to release/candidate.
2-
# Creates the final release/v{version} branch and deletes the candidate branch.
1+
# Step 4: Triggers when the changelog PR is merged to release/candidate.
2+
# Records last-release-sha and renames release/candidate to release/v{version}.
33
name: "Release: Finalize"
44

55
on:
@@ -33,6 +33,8 @@ jobs:
3333
if: steps.check.outputs.is_release_pr == 'true'
3434
with:
3535
ref: release/candidate
36+
token: ${{ secrets.RELEASE_PAT }}
37+
fetch-depth: 0
3638

3739
- name: Extract version from manifest
3840
if: steps.check.outputs.is_release_pr == 'true'
@@ -42,18 +44,33 @@ jobs:
4244
echo "version=$VERSION" >> $GITHUB_OUTPUT
4345
echo "Extracted version: $VERSION"
4446
45-
- name: Create release branch
47+
- name: Configure git identity from RELEASE_PAT
48+
if: steps.check.outputs.is_release_pr == 'true'
49+
env:
50+
GH_TOKEN: ${{ secrets.RELEASE_PAT }}
51+
run: |
52+
USER_JSON=$(gh api user)
53+
git config user.name "$(echo "$USER_JSON" | jq -r '.login')"
54+
git config user.email "$(echo "$USER_JSON" | jq -r '.id')+$(echo "$USER_JSON" | jq -r '.login')@users.noreply.github.com"
55+
56+
- name: Record last-release-sha for release-please
4657
if: steps.check.outputs.is_release_pr == 'true'
4758
run: |
48-
git checkout -b "release/v${{ steps.version.outputs.version }}"
49-
git push origin "release/v${{ steps.version.outputs.version }}"
50-
echo "Created branch: release/v${{ steps.version.outputs.version }}"
59+
git fetch origin main
60+
CUT_SHA=$(git merge-base origin/main HEAD)
61+
echo "Release was cut from main at: $CUT_SHA"
62+
jq --arg sha "$CUT_SHA" '. + {"last-release-sha": $sha}' \
63+
.github/release-please-config.json > tmp.json && mv tmp.json .github/release-please-config.json
64+
git add .github/release-please-config.json
65+
git commit -m "chore: update last-release-sha for next release"
66+
git push origin release/candidate
5167
52-
- name: Delete release/candidate branch
68+
- name: Rename release/candidate to release/v{version}
5369
if: steps.check.outputs.is_release_pr == 'true'
5470
run: |
55-
git push origin --delete release/candidate
56-
echo "Deleted branch: release/candidate"
71+
VERSION="v${{ steps.version.outputs.version }}"
72+
git push origin "release/candidate:refs/heads/release/$VERSION" ":release/candidate"
73+
echo "Renamed release/candidate to release/$VERSION"
5774
5875
- name: Update PR label to tagged
5976
if: steps.check.outputs.is_release_pr == 'true'

.github/workflows/release-please.yml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Runs release-please to create/update a PR with version bump and changelog.
2-
# Triggered by pushes to release/candidate or manually.
2+
# Triggered automatically by step 1 (cut) or step 3 (cherry-pick).
33
name: "Release: Please"
44

55
on:
@@ -18,11 +18,25 @@ jobs:
1818
if: "!startsWith(github.event.head_commit.message, 'chore(release')"
1919
runs-on: ubuntu-latest
2020
steps:
21+
- name: Check if release/candidate still exists
22+
id: check
23+
env:
24+
GH_TOKEN: ${{ github.token }}
25+
run: |
26+
if gh api repos/${{ github.repository }}/branches/release/candidate --silent 2>/dev/null; then
27+
echo "exists=true" >> $GITHUB_OUTPUT
28+
else
29+
echo "release/candidate branch no longer exists, skipping"
30+
echo "exists=false" >> $GITHUB_OUTPUT
31+
fi
32+
2133
- uses: actions/checkout@v4
34+
if: steps.check.outputs.exists == 'true'
2235
with:
2336
ref: release/candidate
2437

2538
- uses: googleapis/release-please-action@v4
39+
if: steps.check.outputs.exists == 'true'
2640
with:
2741
token: ${{ secrets.RELEASE_PAT }}
2842
config-file: .github/release-please-config.json

.github/workflows/release-publish.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# Builds and publishes the package to PyPI from a release branch.
2-
# Creates a merge-back PR to sync release changes to main.
1+
# Step 6: Builds and publishes the package to PyPI from a release/v{version} branch.
2+
# Creates a merge-back PR (step 7) to sync release changes to main.
33
name: "Release: Publish to PyPi"
44

55
on:

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
## [1.25.1](https://github.com/google/adk-python/compare/v1.25.0...v1.25.1) (2026-02-18)
4+
5+
### Bug Fixes
6+
7+
* Fix pickling lock errors in McpSessionManager ([4e2d615](https://github.com/google/adk-python/commit/4e2d6159ae3552954aaae295fef3e09118502898))
8+
39
## [1.25.0](https://github.com/google/adk-python/compare/v1.24.1...v1.25.0) (2026-02-11)
410

511
### Features
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Agent Registry Sample
2+
3+
This sample demonstrates how to use the `AgentRegistry` client to discover agents and MCP servers registered in Google Cloud.
4+
5+
## Setup
6+
7+
1. Ensure you have Google Cloud credentials configured (e.g., `gcloud auth application-default login`).
8+
2. Set the following environment variables:
9+
10+
```bash
11+
export GOOGLE_CLOUD_PROJECT=your-project-id
12+
export GOOGLE_CLOUD_LOCATION=global # or your specific region
13+
```
14+
15+
3. Obtain the full resource names for the agents and MCP servers you want to use. You can do this by running the sample script once to list them:
16+
17+
```bash
18+
python3 agent.py
19+
```
20+
21+
Alternatively, use `gcloud` to list them:
22+
23+
```bash
24+
# For agents
25+
gcloud alpha agent-registry agents list --project=$GOOGLE_CLOUD_PROJECT --location=$GOOGLE_CLOUD_LOCATION
26+
27+
# For MCP servers
28+
gcloud alpha agent-registry mcp-servers list --project=$GOOGLE_CLOUD_PROJECT --location=$GOOGLE_CLOUD_LOCATION
29+
```
30+
31+
4. Replace `AGENT_NAME` and `MCP_SERVER_NAME` in `agent.py` with the last part of the resource names (e.g., if the name is `projects/.../agents/my-agent`, use `my-agent`).
32+
33+
## Running the Sample
34+
35+
Run the sample script to list available agents and MCP servers:
36+
37+
```bash
38+
python3 agent.py
39+
```
40+
41+
## How it Works
42+
43+
The sample uses `AgentRegistry` to:
44+
- List registered agents using `list_agents()`.
45+
- List registered MCP servers using `list_mcp_servers()`.
46+
47+
It also shows (in comments) how to:
48+
- Get a `RemoteA2aAgent` instance using `get_remote_a2a_agent(name)`.
49+
- Get an `McpToolset` instance using `get_mcp_toolset(name)`.

0 commit comments

Comments
 (0)