Skip to content

Commit b78c014

Browse files
authored
Merge branch 'main' into docs/fix-type-pyproject
2 parents 1dd2dd8 + d4b2a8b commit b78c014

File tree

674 files changed

+84050
-11572
lines changed

Some content is hidden

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

674 files changed

+84050
-11572
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,12 @@ assignees: ''
1414
A clear and concise description of what the bug is.
1515

1616
**To Reproduce**
17+
Please share a minimal code and data to reproduce your problem.
1718
Steps to reproduce the behavior:
1819
1. Install '...'
1920
2. Run '....'
2021
3. Open '....'
21-
4. See error
22+
4. Provie error or stacktrace
2223

2324
**Expected behavior**
2425
A clear and concise description of what you expected to happen.
@@ -27,12 +28,13 @@ A clear and concise description of what you expected to happen.
2728
If applicable, add screenshots to help explain your problem.
2829

2930
**Desktop (please complete the following information):**
30-
- OS: [e.g. iOS]
31+
- OS: [e.g. macOS, Linux, Windows]
3132
- Python version(python -V):
3233
- ADK version(pip show google-adk):
3334

3435
**Model Information:**
35-
For example, which model is being used.
36+
- Are you using LiteLLM: Yes/No
37+
- Which model is being used(e.g. gemini-2.5-pro)
3638

3739
**Additional context**
3840
Add any other context about the problem 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._
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/[email protected]
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

.github/workflows/check-file-contents.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ jobs:
8989
- name: Check for import from cli package in certain changed Python files
9090
run: |
9191
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/.*|tests/.*|contributing/samples/' || true)
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)
9393
if [ -n "$CHANGED_FILES" ]; then
9494
echo "Changed Python files to check:"
9595
echo "$CHANGED_FILES"
Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
name: Copybara PR Handler
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
workflow_dispatch:
8+
inputs:
9+
pr_number:
10+
description: 'PR number to close (for testing)'
11+
required: true
12+
type: string
13+
commit_sha:
14+
description: 'Commit SHA reference (optional, for testing)'
15+
required: false
16+
type: string
17+
18+
jobs:
19+
close-imported-pr:
20+
runs-on: ubuntu-latest
21+
permissions:
22+
pull-requests: write
23+
issues: write
24+
contents: read
25+
26+
steps:
27+
- name: Check for Copybara commits and close PRs
28+
uses: actions/github-script@v7
29+
with:
30+
github-token: ${{ secrets.ADK_TRIAGE_AGENT }}
31+
script: |
32+
// Check if this is a manual test run
33+
const isManualRun = context.eventName === 'workflow_dispatch';
34+
35+
let prsToClose = [];
36+
37+
if (isManualRun) {
38+
// Manual testing mode
39+
const prNumber = parseInt(context.payload.inputs.pr_number);
40+
const commitSha = context.payload.inputs.commit_sha || context.sha.substring(0, 7);
41+
42+
console.log('=== MANUAL TEST MODE ===');
43+
console.log(`Testing with PR #${prNumber}, commit ${commitSha}`);
44+
45+
prsToClose.push({ prNumber, commitSha });
46+
} else {
47+
// Normal mode: process commits from push event
48+
const commits = context.payload.commits || [];
49+
console.log(`Found ${commits.length} commit(s) in this push`);
50+
51+
// Process each commit
52+
for (const commit of commits) {
53+
const sha = commit.id;
54+
const committer = commit.committer.name;
55+
const message = commit.message;
56+
57+
console.log(`\n--- Processing commit ${sha.substring(0, 7)} ---`);
58+
console.log(`Committer: ${committer}`);
59+
60+
// Check if this is a Copybara commit
61+
if (committer !== 'Copybara-Service') {
62+
console.log('Not a Copybara commit, skipping');
63+
continue;
64+
}
65+
66+
// Extract PR number from commit message
67+
// Pattern: "Merge https://github.com/google/adk-python/pull/3333"
68+
const prMatch = message.match(/Merge https:\/\/github\.com\/google\/adk-python\/pull\/(\d+)/);
69+
70+
if (!prMatch) {
71+
console.log('No PR number found in Copybara commit message');
72+
continue;
73+
}
74+
75+
const prNumber = parseInt(prMatch[1]);
76+
const commitSha = sha.substring(0, 7);
77+
78+
prsToClose.push({ prNumber, commitSha });
79+
}
80+
}
81+
82+
// Process PRs to close
83+
for (const { prNumber, commitSha } of prsToClose) {
84+
console.log(`\n--- Processing PR #${prNumber} ---`);
85+
86+
// Get PR details to check if it's open
87+
let pr;
88+
try {
89+
pr = await github.rest.pulls.get({
90+
owner: context.repo.owner,
91+
repo: context.repo.repo,
92+
pull_number: prNumber
93+
});
94+
} catch (error) {
95+
console.log(`PR #${prNumber} not found or inaccessible:`, error.message);
96+
continue;
97+
}
98+
99+
// Only close if PR is still open
100+
if (pr.data.state !== 'open') {
101+
console.log(`PR #${prNumber} is already ${pr.data.state}, skipping`);
102+
continue;
103+
}
104+
105+
const author = pr.data.user.login;
106+
107+
try {
108+
// Add comment with commit reference
109+
await github.rest.issues.createComment({
110+
owner: context.repo.owner,
111+
repo: context.repo.repo,
112+
issue_number: prNumber,
113+
body: `Thank you @${author} for your contribution! 🎉\n\nYour changes have been successfully imported and merged via Copybara in commit ${commitSha}.\n\nClosing this PR as the changes are now in the main branch.`
114+
});
115+
116+
// Close the PR
117+
await github.rest.pulls.update({
118+
owner: context.repo.owner,
119+
repo: context.repo.repo,
120+
pull_number: prNumber,
121+
state: 'closed'
122+
});
123+
124+
console.log(`Successfully closed PR #${prNumber}`);
125+
} catch (error) {
126+
console.log(`Error closing PR #${prNumber}:`, error.message);
127+
}
128+
}
129+
130+
if (isManualRun) {
131+
console.log('\n=== TEST COMPLETED ===');
132+
} else {
133+
console.log('\n--- Finished processing all commits ---');
134+
}

.github/workflows/discussion_answering.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,14 @@ name: ADK Answering Agent for Discussions
33
on:
44
discussion:
55
types: [created]
6+
discussion_comment:
7+
types: [created]
68

79
jobs:
810
agent-answer-questions:
9-
if: github.event.discussion.category.name == 'Q&A'
11+
if: >-
12+
(github.event_name == 'discussion' && github.event.discussion.category.name == 'Q&A') ||
13+
(github.event_name == 'discussion_comment' && contains(github.event.comment.body, '@adk-bot') && github.event.sender.login != 'adk-bot')
1014
runs-on: ubuntu-latest
1115

1216
steps:
@@ -41,6 +45,10 @@ jobs:
4145
OWNER: 'google'
4246
REPO: 'adk-python'
4347
INTERACTIVE: 0
44-
DISCUSSION_NUMBER: ${{ github.event.discussion.number }}
4548
PYTHONPATH: contributing/samples
46-
run: python -m adk_answering_agent.main
49+
run: |
50+
# Write discussion data to temporary file to avoid secret masking issues
51+
cat > /tmp/discussion.json << 'EOF'
52+
${{ toJson(github.event.discussion) }}
53+
EOF
54+
python -m adk_answering_agent.main --discussion-file /tmp/discussion.json

.github/workflows/pr-triage.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,16 @@ name: ADK Pull Request Triaging Agent
33
on:
44
pull_request_target:
55
types: [opened, reopened, edited]
6+
workflow_dispatch:
7+
inputs:
8+
pr_number:
9+
description: 'The Pull Request number to triage'
10+
required: true
11+
type: 'string'
612

713
jobs:
814
agent-triage-pull-request:
15+
if: github.event_name == 'workflow_dispatch' || !contains(github.event.pull_request.labels.*.name, 'google-contributor')
916
runs-on: ubuntu-latest
1017
permissions:
1118
pull-requests: write
@@ -32,7 +39,7 @@ jobs:
3239
GOOGLE_GENAI_USE_VERTEXAI: 0
3340
OWNER: 'google'
3441
REPO: 'adk-python'
35-
PULL_REQUEST_NUMBER: ${{ github.event.pull_request.number }}
42+
PULL_REQUEST_NUMBER: ${{ github.event.pull_request.number || github.event.inputs.pr_number }}
3643
INTERACTIVE: ${{ vars.PR_TRIAGE_INTERACTIVE }}
3744
PYTHONPATH: contributing/samples
3845
run: python -m adk_pr_triaging_agent.main

.github/workflows/triage.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ name: ADK Issue Triaging Agent
33
on:
44
issues:
55
types: [opened, reopened]
6-
schedule:
7-
- cron: '0 */6 * * *' # every 6h
86

97
jobs:
108
agent-triage-issues:

.gitignore

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,3 +98,20 @@ Thumbs.db
9898
*.bak
9999
*.tmp
100100
*.temp
101+
102+
# AI Coding Tools - Project-specific configs
103+
# Developers should symlink or copy AGENTS.md and add their own overrides locally
104+
.claude/
105+
CLAUDE.md
106+
.cursor/
107+
.cursorrules
108+
.cursorignore
109+
.windsurfrules
110+
.aider*
111+
.continue/
112+
.codeium/
113+
.githubnext/
114+
.roo/
115+
.rooignore
116+
.bolt/
117+
.v0/

0 commit comments

Comments
 (0)