Compare commits

..

7 Commits

Author SHA1 Message Date
sasha-gitg b0610cac8e Update breaking-change-detector.yml 2026-01-12 17:19:10 -05:00
sasha-gitg 97542097c9 Update breaking-change-detector.yml 2026-01-12 17:15:20 -05:00
sasha-gitg 0bd06c09aa Update breaking-change-detector.yml 2026-01-12 17:03:42 -05:00
sasha-gitg 313b042b69 Update breaking-change-detector.yml 2026-01-12 16:57:30 -05:00
sasha-gitg e5e15a807e Update breaking-change-detector.yml 2026-01-12 16:55:12 -05:00
sasha-gitg 20590deb81 trigger the workflow 2026-01-12 16:49:48 -05:00
sasha-gitg dc17c8501c chore: add breaking change detector 2026-01-12 16:42:46 -05:00
1218 changed files with 7964 additions and 31736 deletions
-3
View File
@@ -1,3 +0,0 @@
{
".": "1.24.1"
}
+16 -51
View File
@@ -7,69 +7,34 @@ assignees: ''
---
## đź”´ Required Information
*Please ensure all items in this section are completed to allow for efficient
triaging. Requests without complete information may be rejected / deprioritized.
If an item is not applicable to you - please mark it as N/A*
** Please make sure you read the contribution guide and file the issues in the right place. **
[Contribution guide.](https://google.github.io/adk-docs/contributing-guide/)
**Describe the Bug:**
**Describe the bug**
A clear and concise description of what the bug is.
**Steps to Reproduce:**
Please provide a numbered list of steps to reproduce the behavior:
**To Reproduce**
Please share a minimal code and data to reproduce your problem.
Steps to reproduce the behavior:
1. Install '...'
2. Run '....'
3. Open '....'
4. Provide error or stacktrace
**Expected Behavior:**
**Expected behavior**
A clear and concise description of what you expected to happen.
**Observed Behavior:**
What actually happened? Include error messages or crash stack traces here.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Environment Details:**
- ADK Library Version (pip show google-adk):
- Desktop OS:** [e.g., macOS, Linux, Windows]
- Python Version (python -V):
**Model Information:**
**Desktop (please complete the following information):**
- OS: [e.g. macOS, Linux, Windows]
- Python version(python -V):
- ADK version(pip show google-adk):
**Model Information:**
- Are you using LiteLLM: Yes/No
- Which model is being used: (e.g., gemini-2.5-pro)
- Which model is being used(e.g. gemini-2.5-pro)
---
## 🟡 Optional Information
*Providing this information greatly speeds up the resolution process.*
**Regression:**
Did this work in a previous version of ADK? If so, which one?
**Logs:**
Please attach relevant logs. Wrap them in code blocks (```) or attach a
text file.
```text
// Paste logs here
```
**Screenshots / Video:**
If applicable, add screenshots or screen recordings to help explain
your problem.
**Additional Context:**
**Additional context**
Add any other context about the problem here.
**Minimal Reproduction Code:**
Please provide a code snippet or a link to a Gist/repo that isolates the issue.
```python
// Code snippet here
```
**How often has this issue occurred?:**
- Always (100%)
- Often (50%+)
- Intermittently (<50%)
- Once / Rare
+8 -33
View File
@@ -10,39 +10,14 @@ assignees: ''
** Please make sure you read the contribution guide and file the issues in the right place. **
[Contribution guide.](https://google.github.io/adk-docs/contributing-guide/)
## đź”´ Required Information
*Please ensure all items in this section are completed to allow for efficient
triaging. Requests without complete information may be rejected / deprioritized.
If an item is not applicable to you - please mark it as N/A*
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
### Is your feature request related to a specific problem?
Please describe the problem you are trying to solve. (Ex: "I'm always frustrated
when I have to manually handle X...")
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
### Describe the Solution You'd Like
A clear and concise description of the feature or API change you want.
Be specific about input/outputs if this involves an API change.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
### Impact on your work
How does this feature impact your work and what are you trying to achieve?
If this is critical for you, tell us if there is a timeline by when you need
this feature.
### Willingness to contribute
Are you interested in implementing this feature yourself or submitting a PR?
(Yes/No)
---
## 🟡 Recommended Information
### Describe Alternatives You've Considered
A clear and concise description of any alternative solutions or workarounds
you've considered and why they didn't work for you.
### Proposed API / Implementation
If you have ideas on how this should look in code, please share a
pseudo-code example.
### Additional Context
Add any other context or screenshots about the feature request here.
**Additional context**
Add any other context or screenshots about the feature request here.
-24
View File
@@ -1,24 +0,0 @@
{
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
"packages": {
".": {
"release-type": "python",
"package-name": "google-adk",
"include-component-in-tag": false,
"skip-github-release": true,
"changelog-path": "CHANGELOG.md",
"changelog-sections": [
{"type": "feat", "section": "Features"},
{"type": "fix", "section": "Bug Fixes"},
{"type": "perf", "section": "Performance Improvements"},
{"type": "refactor", "section": "Code Refactoring"},
{"type": "docs", "section": "Documentation"},
{"type": "test", "section": "Tests", "hidden": true},
{"type": "build", "section": "Build System", "hidden": true},
{"type": "ci", "section": "CI/CD", "hidden": true},
{"type": "style", "section": "Styles", "hidden": true},
{"type": "chore", "section": "Miscellaneous Chores", "hidden": true}
]
}
}
}
+5
View File
@@ -0,0 +1,5 @@
releaseType: python
handleGHRelease: true
bumpMinorPreMajor: false
extraFiles:
- src/google/adk/version.py
+1
View File
@@ -0,0 +1 @@
enabled: true
@@ -24,7 +24,7 @@ jobs:
python-version: '3.11'
- name: Load adk-bot SSH Private Key
uses: webfactory/ssh-agent@v0.9.1
uses: webfactory/ssh-agent@v0.9.0
with:
ssh-private-key: ${{ secrets.ADK_BOT_SSH_PRIVATE_KEY }}
@@ -0,0 +1,102 @@
name: Breaking Change Detector
on:
pull_request:
branches:
- main
paths:
- 'src/**'
jobs:
check-api:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0 # Required for accessing the main branch history
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install the latest version of uv
uses: astral-sh/setup-uv@v5
- name: Install dependencies
# Syncing installs the package and its dependencies (populating google.* namespace)
# Installing 'griffe' ensures the tool is available in the environment
run: |
uv sync --extra test
uv pip install griffe
- name: Run Breaking Change Detection
# Uses 'uv run python' to execute in the environment with all dependencies installed
run: |
uv run python - <<EOF
import sys
import griffe
from griffe import find_breaking_changes, load, load_git
def check_return_types(old_obj, new_obj):
"""Custom check to strictly compare return type annotations."""
errors = []
# Check Runner.run specifically, or extend to check all methods
try:
old_run = old_obj.members["Runner"].members["run"]
new_run = new_obj.members["Runner"].members["run"]
# Convert to string and strip to compare the annotation text
old_ret = str(old_run.returns).strip()
new_ret = str(new_run.returns).strip()
if old_ret != new_ret:
errors.append(
f"Breaking Change in {new_run.path}: Return type changed from '{old_ret}' to '{new_ret}'"
)
except KeyError:
pass # Member missing (will be caught by standard checks)
except AttributeError:
pass # Member might not be a function
return errors
try:
print("Loading new API (from local source)...")
# allow_inspection=False forces static analysis, preventing sys.modules caching issues
new_api = load("google.adk", search_paths=["src"], allow_inspection=False)
print("Loading baseline API (from main branch)...")
old_api = load_git("google.adk", ref="main", search_paths=["src"], allow_inspection=False)
print("Running detection...")
# 1. Standard Griffe Checks (Removals, Parameter changes)
breakages = list(find_breaking_changes(old_api, new_api))
# 2. Custom Return Type Checks (Workaround for Griffe limitation)
custom_errors = check_return_types(old_api, new_api)
found_issues = False
if breakages:
found_issues = True
print(f"::error::Found {len(breakages)} standard breaking changes!")
for breakage in breakages:
print(breakage.explain())
if custom_errors:
found_issues = True
print(f"::error::Found {len(custom_errors)} return type mismatches!")
for error in custom_errors:
print(f"- {error}")
if found_issues:
sys.exit(1)
print("Success: No breaking changes detected.")
except Exception as e:
print(f"::error::Breaking change detection failed: {e}")
sys.exit(1)
EOF
+2 -2
View File
@@ -1,4 +1,4 @@
# Copyright 2026 Google LLC
# Copyright 2025 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -96,7 +96,7 @@ jobs:
echo ""
set +e
FILES_WITH_FORBIDDEN_IMPORT=$(grep -lE '^from.*\bcli\b.*import.*$' $CHANGED_FILES)
FILES_WITH_FORBIDDEN_IMPORT=$(grep -lE '^from.*cli.*import.*$' $CHANGED_FILES)
GREP_EXIT_CODE=$?
set -e
+2 -2
View File
@@ -1,4 +1,4 @@
# Copyright 2026 Google LLC
# Copyright 2025 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -33,7 +33,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: '3.11'
python-version: '3.x'
- name: Install isort
run: |
-74
View File
@@ -1,74 +0,0 @@
name: Mypy New Error Check
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
mypy-diff:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.10', '3.11', '3.12', '3.13',]
steps:
- name: Checkout code
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: Install uv
uses: astral-sh/setup-uv@v7
- name: Generate Baseline (Main)
run: |
# Switch to main branch to generate baseline
git checkout origin/main
git checkout ${{ github.sha }} -- pyproject.toml
# Install dependencies for main
uv venv .venv
source .venv/bin/activate
uv sync --all-extras
# Run mypy, filter for errors only, remove line numbers (file:123: -> file::), and sort
# We ignore exit code (|| true) because we expect errors on main
uv run mypy . | grep "error:" | sed 's/:\([0-9]\+\):/::/g' | sort > main_errors.txt || true
echo "Found $(wc -l < main_errors.txt) errors on main."
- name: Check PR Branch
run: |
# Switch back to the PR commit
git checkout ${{ github.sha }}
# Re-sync dependencies in case the PR changed them
source .venv/bin/activate
uv sync --all-extras
# Run mypy on PR code, apply same processing
uv run mypy . | grep "error:" | sed 's/:\([0-9]\+\):/::/g' | sort > pr_errors.txt || true
echo "Found $(wc -l < pr_errors.txt) errors on PR branch."
- name: Compare and Fail on New Errors
run: |
# 'comm -13' suppresses unique lines in file1 (main) and common lines,
# leaving only lines unique to file2 (PR) -> The new errors.
comm -13 main_errors.txt pr_errors.txt > new_errors.txt
if [ -s new_errors.txt ]; then
echo "::error::The following NEW mypy errors were introduced:"
cat new_errors.txt
exit 1
else
echo "Great job! No new mypy errors introduced."
fi
-32
View File
@@ -1,32 +0,0 @@
name: Mypy Type Check
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
mypy:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.10', '3.11', '3.12', '3.13',]
steps:
- uses: actions/checkout@v6
- name: Install uv
uses: astral-sh/setup-uv@v7
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: uv sync --all-extras
- name: Run mypy
run: uv run mypy . --strict
+2 -2
View File
@@ -1,4 +1,4 @@
# Copyright 2026 Google LLC
# Copyright 2025 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -33,7 +33,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: '3.11'
python-version: '3.x'
- name: Install pyink
run: |
+3 -3
View File
@@ -1,4 +1,4 @@
# Copyright 2026 Google LLC
# Copyright 2025 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -25,7 +25,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
python-version: ["3.10", "3.11", "3.12", "3.13"]
steps:
- name: Checkout code
@@ -37,7 +37,7 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Install the latest version of uv
uses: astral-sh/setup-uv@v7
uses: astral-sh/setup-uv@v6
- name: Install dependencies
run: |
-46
View File
@@ -1,46 +0,0 @@
# Cherry-picks a commit from main to the release/candidate branch.
# Use this to include bug fixes in an in-progress release.
name: "Release: Cherry-pick"
on:
workflow_dispatch:
inputs:
commit_sha:
description: 'Commit SHA to cherry-pick'
required: true
type: string
permissions:
contents: write
actions: write
jobs:
cherry-pick:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: release/candidate
fetch-depth: 0
- name: Configure git
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
- name: Cherry-pick commit
run: |
echo "Cherry-picking ${{ inputs.commit_sha }} to release/candidate"
git cherry-pick ${{ inputs.commit_sha }}
- name: Push changes
run: |
git push origin release/candidate
echo "Successfully cherry-picked commit to release/candidate"
- name: Trigger Release Please
env:
GH_TOKEN: ${{ github.token }}
run: |
gh workflow run release-please.yml --repo ${{ github.repository }}
echo "Triggered Release Please workflow"
-46
View File
@@ -1,46 +0,0 @@
# Starts the release process by creating a release/candidate branch.
# Triggers release-please to generate a changelog PR.
name: "Release: Cut"
on:
workflow_dispatch:
inputs:
commit_sha:
description: 'Commit SHA to cut from (leave empty for latest main)'
required: false
type: string
permissions:
contents: write
actions: write
jobs:
cut-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.commit_sha || 'main' }}
- name: Check for existing release/candidate branch
env:
GH_TOKEN: ${{ github.token }}
run: |
if git ls-remote --exit-code --heads origin release/candidate &>/dev/null; then
echo "Error: release/candidate branch already exists"
echo "Please finalize or delete the existing release candidate before starting a new one"
exit 1
fi
- name: Create and push release/candidate branch
run: |
git checkout -b release/candidate
git push origin release/candidate
echo "Created branch: release/candidate"
- name: Trigger Release Please
env:
GH_TOKEN: ${{ github.token }}
run: |
gh workflow run release-please.yml --repo ${{ github.repository }}
echo "Triggered Release Please workflow"
-66
View File
@@ -1,66 +0,0 @@
# Triggers when release-please PR is merged to release/candidate.
# Creates the final release/v{version} branch and deletes the candidate branch.
name: "Release: Finalize"
on:
pull_request:
types: [closed]
branches:
- release/candidate
permissions:
contents: write
pull-requests: write
jobs:
finalize:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
steps:
- name: Check for release-please PR
id: check
env:
LABELS: ${{ toJson(github.event.pull_request.labels.*.name) }}
run: |
if echo "$LABELS" | grep -q "autorelease: pending"; then
echo "is_release_pr=true" >> $GITHUB_OUTPUT
else
echo "Not a release-please PR, skipping"
echo "is_release_pr=false" >> $GITHUB_OUTPUT
fi
- uses: actions/checkout@v4
if: steps.check.outputs.is_release_pr == 'true'
with:
ref: release/candidate
- name: Extract version from manifest
if: steps.check.outputs.is_release_pr == 'true'
id: version
run: |
VERSION=$(jq -r '.["."]' .github/.release-please-manifest.json)
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "Extracted version: $VERSION"
- name: Create release branch
if: steps.check.outputs.is_release_pr == 'true'
run: |
git checkout -b "release/v${{ steps.version.outputs.version }}"
git push origin "release/v${{ steps.version.outputs.version }}"
echo "Created branch: release/v${{ steps.version.outputs.version }}"
- name: Delete release/candidate branch
if: steps.check.outputs.is_release_pr == 'true'
run: |
git push origin --delete release/candidate
echo "Deleted branch: release/candidate"
- name: Update PR label to tagged
if: steps.check.outputs.is_release_pr == 'true'
env:
GH_TOKEN: ${{ github.token }}
run: |
gh pr edit ${{ github.event.pull_request.number }} \
--remove-label "autorelease: pending" \
--add-label "autorelease: tagged"
echo "Updated PR label to autorelease: tagged"
-30
View File
@@ -1,30 +0,0 @@
# Runs release-please to create/update a PR with version bump and changelog.
# Triggered by pushes to release/candidate or manually.
name: "Release: Please"
on:
push:
branches:
- release/candidate
workflow_dispatch:
permissions:
contents: write
pull-requests: write
jobs:
release-please:
# Skip if this is a release-please PR merge (handled by Release: Finalize)
if: "!startsWith(github.event.head_commit.message, 'chore(release')"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: release/candidate
- uses: googleapis/release-please-action@v4
with:
token: ${{ secrets.RELEASE_PAT }}
config-file: .github/release-please-config.json
manifest-file: .github/.release-please-manifest.json
target-branch: release/candidate
-59
View File
@@ -1,59 +0,0 @@
# Builds and publishes the package to PyPI from a release branch.
# Creates a merge-back PR to sync release changes to main.
name: "Release: Publish to PyPi"
on:
workflow_dispatch:
permissions:
contents: write
pull-requests: write
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Validate branch
run: |
if [[ ! "${{ github.ref_name }}" =~ ^release/v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "Error: Must run from a release/v* branch (e.g., release/v0.3.0)"
exit 1
fi
- name: Extract version
id: version
run: |
VERSION="${{ github.ref_name }}"
VERSION="${VERSION#release/v}"
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "Publishing version: $VERSION"
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v4
with:
version: "latest"
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Build package
run: uv build
- name: Publish to PyPI
env:
UV_PUBLISH_TOKEN: ${{ secrets.PYPI_TOKEN }}
run: uv publish
- name: Create merge-back PR
env:
GH_TOKEN: ${{ secrets.RELEASE_PAT }}
run: |
gh pr create \
--base main \
--head "${{ github.ref_name }}" \
--title "chore: merge release v${{ steps.version.outputs.version }} to main" \
--body "Syncs version bump and CHANGELOG from release v${{ steps.version.outputs.version }} to main."
+1 -2
View File
@@ -1,4 +1,4 @@
# Copyright 2026 Google LLC
# Copyright 2025 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -23,7 +23,6 @@ on:
jobs:
audit-stale-issues:
if: github.repository == 'google/adk-python'
runs-on: ubuntu-latest
timeout-minutes: 60

Some files were not shown because too many files have changed in this diff Show More