Skip to content

Commit b57cf9f

Browse files
authored
Merge branch 'google:main' into placeholder
2 parents 095f2b6 + e3caf79 commit b57cf9f

1,194 files changed

Lines changed: 248661 additions & 0 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.

.gemini/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"contextFileName": "AGENTS.md"
3+
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
** Please make sure you read the contribution guide and file the issues in the right place. **
11+
[Contribution guide.](https://google.github.io/adk-docs/contributing-guide/)
12+
13+
**Describe the bug**
14+
A clear and concise description of what the bug is.
15+
16+
**To Reproduce**
17+
Please share a minimal code and data to reproduce your problem.
18+
Steps to reproduce the behavior:
19+
1. Install '...'
20+
2. Run '....'
21+
3. Open '....'
22+
4. Provide error or stacktrace
23+
24+
**Expected behavior**
25+
A clear and concise description of what you expected to happen.
26+
27+
**Screenshots**
28+
If applicable, add screenshots to help explain your problem.
29+
30+
**Desktop (please complete the following information):**
31+
- OS: [e.g. macOS, Linux, Windows]
32+
- Python version(python -V):
33+
- ADK version(pip show google-adk):
34+
35+
**Model Information:**
36+
- Are you using LiteLLM: Yes/No
37+
- Which model is being used(e.g. gemini-2.5-pro)
38+
39+
**Additional context**
40+
Add any other context about the problem here.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
** Please make sure you read the contribution guide and file the issues in the right place. **
11+
[Contribution guide.](https://google.github.io/adk-docs/contributing-guide/)
12+
13+
**Is your feature request related to a problem? Please describe.**
14+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
15+
16+
**Describe the solution you'd like**
17+
A clear and concise description of what you want to happen.
18+
19+
**Describe alternatives you've considered**
20+
A clear and concise description of any alternative solutions or features you've considered.
21+
22+
**Additional context**
23+
Add any other context or screenshots about the feature request here.

.github/pull_request_template.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
**Please ensure you have read the [contribution guide](https://github.com/google/adk-python/blob/main/CONTRIBUTING.md) before creating a pull request.**
2+
3+
### Link to Issue or Description of Change
4+
5+
**1. Link to an existing issue (if applicable):**
6+
7+
- Closes: #_issue_number_
8+
- Related: #_issue_number_
9+
10+
**2. Or, if no issue exists, describe the change:**
11+
12+
_If applicable, please follow the issue templates to provide as much detail as
13+
possible._
14+
15+
**Problem:**
16+
_A clear and concise description of what the problem is._
17+
18+
**Solution:**
19+
_A clear and concise description of what you want to happen and why you choose
20+
this solution._
21+
22+
### Testing Plan
23+
24+
_Please describe the tests that you ran to verify your changes. This is required
25+
for all PRs that are not small documentation or typo fixes._
26+
27+
**Unit Tests:**
28+
29+
- [ ] I have added or updated unit tests for my change.
30+
- [ ] All unit tests pass locally.
31+
32+
_Please include a summary of passed `pytest` results._
33+
34+
**Manual End-to-End (E2E) Tests:**
35+
36+
_Please provide instructions on how to manually test your changes, including any
37+
necessary setup or configuration. Please provide logs or screenshots to help
38+
reviewers better understand the fix._
39+
40+
### Checklist
41+
42+
- [ ] I have read the [CONTRIBUTING.md](https://github.com/google/adk-python/blob/main/CONTRIBUTING.md) document.
43+
- [ ] I have performed a self-review of my own code.
44+
- [ ] I have commented my code, particularly in hard-to-understand areas.
45+
- [ ] I have added tests that prove my fix is effective or that my feature works.
46+
- [ ] New and existing unit tests pass locally with my changes.
47+
- [ ] I have manually tested my changes end-to-end.
48+
- [ ] Any dependent changes have been merged and published in downstream modules.
49+
50+
### Additional context
51+
52+
_Add any other context or screenshots about the feature request here._

.github/release-please.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
releaseType: python
2+
handleGHRelease: true
3+
bumpMinorPreMajor: false
4+
extraFiles:
5+
- src/google/adk/version.py

.github/release-trigger.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
enabled: true
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Analyze New Release for ADK Docs Updates
2+
3+
on:
4+
# Runs on every new release.
5+
release:
6+
types: [published]
7+
# Manual trigger for testing and retrying.
8+
workflow_dispatch:
9+
10+
jobs:
11+
analyze-new-release-for-adk-docs-updates:
12+
runs-on: ubuntu-latest
13+
permissions:
14+
contents: read
15+
issues: write
16+
17+
steps:
18+
- name: Checkout repository
19+
uses: actions/checkout@v4
20+
21+
- name: Set up Python
22+
uses: actions/setup-python@v5
23+
with:
24+
python-version: '3.11'
25+
26+
- name: Load adk-bot SSH Private Key
27+
uses: webfactory/ssh-agent@v0.9.0
28+
with:
29+
ssh-private-key: ${{ secrets.ADK_BOT_SSH_PRIVATE_KEY }}
30+
31+
- name: Install dependencies
32+
run: |
33+
python -m pip install --upgrade pip
34+
pip install requests google-adk
35+
36+
- name: Run Analyzing Script
37+
env:
38+
GITHUB_TOKEN: ${{ secrets.ADK_TRIAGE_AGENT }}
39+
GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }}
40+
GOOGLE_GENAI_USE_VERTEXAI: 0
41+
DOC_OWNER: 'google'
42+
CODE_OWNER: 'google'
43+
DOC_REPO: 'adk-docs'
44+
CODE_REPO: 'adk-python'
45+
INTERACTIVE: 0
46+
PYTHONPATH: contributing/samples/adk_documentation
47+
run: python -m adk_release_analyzer.main
Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
# Copyright 2025 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: "Check file contents"
16+
17+
on:
18+
pull_request:
19+
paths:
20+
- '**.py'
21+
22+
jobs:
23+
check-file-contents:
24+
runs-on: ubuntu-latest
25+
steps:
26+
- name: Checkout Code
27+
uses: actions/checkout@v4
28+
with:
29+
fetch-depth: 2
30+
31+
- name: Check for logger pattern in all changed Python files
32+
run: |
33+
git fetch origin ${{ github.base_ref }}
34+
CHANGED_FILES=$(git diff --diff-filter=ACMR --name-only origin/${{ github.base_ref }}...HEAD | grep -E '\.py$' || true)
35+
if [ -n "$CHANGED_FILES" ]; then
36+
echo "Changed Python files to check:"
37+
echo "$CHANGED_FILES"
38+
echo ""
39+
40+
# Check for 'logger = logging.getLogger(__name__)' in changed .py files.
41+
# The grep command will exit with a non-zero status code if the pattern is not found.
42+
# We invert the exit code with ! so the step succeeds if the pattern is NOT found.
43+
set +e
44+
FILES_WITH_FORBIDDEN_LOGGER=$(grep -lE 'logger = logging\.getLogger\(__name__\)' $CHANGED_FILES)
45+
GREP_EXIT_CODE=$?
46+
set -e
47+
48+
# grep exits with 0 if matches are found, 1 if no matches are found.
49+
# A non-zero exit code other than 1 indicates an error.
50+
if [ $GREP_EXIT_CODE -eq 0 ]; then
51+
echo "❌ Found forbidden use of 'logger = logging.getLogger(__name__)'. Please use 'logger = logging.getLogger('google_adk.' + __name__)' instead."
52+
echo "The following files contain the forbidden pattern:"
53+
echo "$FILES_WITH_FORBIDDEN_LOGGER"
54+
exit 1
55+
elif [ $GREP_EXIT_CODE -eq 1 ]; then
56+
echo "✅ No instances of 'logger = logging.getLogger(__name__)' found in changed Python files."
57+
fi
58+
else
59+
echo "✅ No relevant Python files found."
60+
fi
61+
62+
- name: Check for import pattern in certain changed Python files
63+
run: |
64+
git fetch origin ${{ github.base_ref }}
65+
CHANGED_FILES=$(git diff --diff-filter=ACMR --name-only origin/${{ github.base_ref }}...HEAD | grep -E '\.py$' | grep -v -E '__init__.py$|version.py$|tests/.*|contributing/samples/' || true)
66+
if [ -n "$CHANGED_FILES" ]; then
67+
echo "Changed Python files to check:"
68+
echo "$CHANGED_FILES"
69+
echo ""
70+
71+
# Use grep -L to find files that DO NOT contain the pattern.
72+
# This command will output a list of non-compliant files.
73+
FILES_MISSING_IMPORT=$(grep -L 'from __future__ import annotations' $CHANGED_FILES || true)
74+
75+
# Check if the list of non-compliant files is empty
76+
if [ -z "$FILES_MISSING_IMPORT" ]; then
77+
echo "✅ All modified Python files include 'from __future__ import annotations'."
78+
exit 0
79+
else
80+
echo "❌ The following files are missing 'from __future__ import annotations':"
81+
echo "$FILES_MISSING_IMPORT"
82+
echo "This import is required to allow forward references in type annotations without quotes."
83+
exit 1
84+
fi
85+
else
86+
echo "✅ No relevant Python files found."
87+
fi
88+
89+
- name: Check for import from cli package in certain changed Python files
90+
run: |
91+
git fetch origin ${{ github.base_ref }}
92+
CHANGED_FILES=$(git diff --diff-filter=ACMR --name-only origin/${{ github.base_ref }}...HEAD | grep -E '\.py$' | grep -v -E 'cli/.*|src/google/adk/tools/apihub_tool/apihub_toolset.py|tests/.*|contributing/samples/' || true)
93+
if [ -n "$CHANGED_FILES" ]; then
94+
echo "Changed Python files to check:"
95+
echo "$CHANGED_FILES"
96+
echo ""
97+
98+
set +e
99+
FILES_WITH_FORBIDDEN_IMPORT=$(grep -lE '^from.*cli.*import.*$' $CHANGED_FILES)
100+
GREP_EXIT_CODE=$?
101+
set -e
102+
103+
if [[ $GREP_EXIT_CODE -eq 0 ]]; then
104+
echo "❌ Do not import from the cli package outside of the cli package. If you need to reuse the code elsewhere, please move the code outside of the cli package."
105+
echo "The following files contain the forbidden pattern:"
106+
echo "$FILES_WITH_FORBIDDEN_IMPORT"
107+
exit 1
108+
else
109+
echo "✅ No instances of importing from the cli package found in relevant changed Python files."
110+
fi
111+
else
112+
echo "✅ No relevant Python files found."
113+
fi

0 commit comments

Comments
 (0)