Skip to content

Commit 96bba4f

Browse files
DeanChensjcopybara-github
authored andcommitted
chore: Delete CHANGELOG-v2.md
Co-authored-by: Shangjie Chen <deanchen@google.com> PiperOrigin-RevId: 929252352
1 parent 66730e9 commit 96bba4f

4 files changed

Lines changed: 334 additions & 14 deletions

File tree

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
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: ADK Issue Triage & Analysis
16+
17+
on:
18+
issues:
19+
types: [opened]
20+
issue_comment:
21+
types: [created]
22+
workflow_dispatch:
23+
inputs:
24+
issue_url:
25+
description: 'The URL of the GitHub issue to analyze'
26+
required: true
27+
type: string
28+
29+
jobs:
30+
issue-analyze:
31+
if: >-
32+
github.repository == 'google/adk-python' && (
33+
github.event_name == 'issues' ||
34+
github.event_name == 'workflow_dispatch' ||
35+
(github.event_name == 'issue_comment' &&
36+
startsWith(github.event.comment.body, '/adk-issue-analyze') && (
37+
github.event.comment.author_association == 'OWNER' ||
38+
github.event.comment.author_association == 'MEMBER' ||
39+
github.event.comment.author_association == 'COLLABORATOR'
40+
))
41+
)
42+
runs-on: ubuntu-latest
43+
permissions:
44+
issues: write
45+
contents: read
46+
47+
steps:
48+
- name: Checkout repository
49+
uses: actions/checkout@v6
50+
51+
- name: Set up Python
52+
uses: actions/setup-python@v6
53+
with:
54+
python-version: '3.11'
55+
56+
- name: Authenticate to Google Cloud
57+
id: auth
58+
uses: 'google-github-actions/auth@v3'
59+
with:
60+
credentials_json: '${{ secrets.ADK_GCP_SA_KEY }}'
61+
62+
- name: Install Google Antigravity SDK
63+
run: pip install google-antigravity
64+
65+
- name: Run Antigravity Triage
66+
env:
67+
GITHUB_TOKEN: ${{ secrets.ADK_TRIAGE_AGENT }}
68+
GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }}
69+
run: |
70+
python scripts/run_antigravity.py "/adk-issue-analyze ${{ github.event.issue.html_url || inputs.issue_url }}" > triage_report.md
71+
cat triage_report.md
72+
73+
- name: Post Triage Report as Comment
74+
env:
75+
GITHUB_TOKEN: ${{ secrets.ADK_TRIAGE_AGENT }}
76+
run: |
77+
gh issue comment "${{ github.event.issue.html_url || inputs.issue_url }}" --body-file triage_report.md

.github/workflows/issue-fix.yml

Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
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: ADK Issue Fix Implementation
16+
17+
on:
18+
issue_comment:
19+
types: [created]
20+
workflow_dispatch:
21+
inputs:
22+
issue_url:
23+
description: 'The URL of the GitHub issue to fix'
24+
required: true
25+
type: string
26+
27+
jobs:
28+
issue-fix:
29+
if: >-
30+
github.repository == 'google/adk-python' && (
31+
github.event_name == 'workflow_dispatch' ||
32+
(github.event_name == 'issue_comment' &&
33+
!github.event.issue.pull_request &&
34+
startsWith(github.event.comment.body, '/adk-issue-fix') && (
35+
github.event.comment.author_association == 'OWNER' ||
36+
github.event.comment.author_association == 'MEMBER' ||
37+
github.event.comment.author_association == 'COLLABORATOR'
38+
))
39+
)
40+
runs-on: ubuntu-latest
41+
permissions:
42+
issues: write
43+
contents: write
44+
pull-requests: write
45+
46+
steps:
47+
- name: Checkout repository
48+
uses: actions/checkout@v6
49+
with:
50+
token: ${{ secrets.ADK_TRIAGE_AGENT }}
51+
fetch-depth: 0
52+
53+
- name: Set up Python
54+
uses: actions/setup-python@v6
55+
with:
56+
python-version: '3.11'
57+
58+
- name: Authenticate to Google Cloud
59+
id: auth
60+
uses: 'google-github-actions/auth@v3'
61+
with:
62+
credentials_json: '${{ secrets.ADK_GCP_SA_KEY }}'
63+
64+
- name: Install Google Antigravity SDK
65+
run: pip install google-antigravity
66+
67+
- name: Run Antigravity Fix
68+
env:
69+
GITHUB_TOKEN: ${{ secrets.ADK_TRIAGE_AGENT }}
70+
GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }}
71+
run: |
72+
python scripts/run_antigravity.py "/adk-issue-fix ${{ github.event.issue.html_url || inputs.issue_url }}"
73+
74+
- name: Check for changes and create Pull Request
75+
env:
76+
GITHUB_TOKEN: ${{ secrets.ADK_TRIAGE_AGENT }}
77+
GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }}
78+
run: |
79+
if [ -n "$(git status --porcelain)" ]; then
80+
echo "Changes detected in workspace. Committing and creating Pull Request..."
81+
82+
# Setup git configs
83+
git config --local user.name "adk-bot"
84+
git config --local user.email "adk-bot@google.com"
85+
86+
# Extract issue number and export it for python
87+
ISSUE_URL="${{ github.event.issue.html_url || inputs.issue_url }}"
88+
export ISSUE_NUMBER=$(echo "$ISSUE_URL" | grep -oP '/issues/\K[0-9]+')
89+
90+
# Determine branch name to push
91+
CURRENT_BRANCH=$(git branch --show-current)
92+
EXPECTED_BRANCH="fix/issue-${ISSUE_NUMBER}"
93+
if [ "$CURRENT_BRANCH" != "$EXPECTED_BRANCH" ]; then
94+
echo "Error: Current branch is '$CURRENT_BRANCH', but expected '$EXPECTED_BRANCH'."
95+
echo "The Antigravity Agent was expected to create and checkout '$EXPECTED_BRANCH'."
96+
exit 1
97+
fi
98+
BRANCH_NAME="$CURRENT_BRANCH"
99+
100+
# Run Antigravity to stage and commit changes with autogenerated message
101+
python scripts/run_antigravity.py "Analyze the unstaged changes in the workspace, stage all of them, and commit them using git. Generate a highly precise conventional commit message based on the diff."
102+
103+
# Append the closes tag using Python to avoid relying on LLM formatting
104+
python -c "import os, subprocess; msg = subprocess.check_output(['git', 'log', '-1', '--pretty=%B'], text=True); tag = 'closes https://github.com/google/adk-python/issues/' + os.environ['ISSUE_NUMBER']; subprocess.run(['git', 'commit', '--amend', '-m', msg.strip() + '\n\n' + tag], check=True) if tag not in msg else None"
105+
106+
# Retrieve the username of the authenticated user
107+
BOT_USER=$(gh api user --jq .login)
108+
echo "Authenticated bot user is $BOT_USER"
109+
110+
# Ensure the fork exists
111+
gh repo fork google/adk-python --clone=false || true
112+
113+
# Push the branch to the bot fork
114+
git remote add fork "https://x-access-token:${{ secrets.ADK_TRIAGE_AGENT }}@github.com/${BOT_USER}/adk-python.git"
115+
git push fork "$BRANCH_NAME" --force
116+
117+
# Retrieve the commit message of the last commit
118+
COMMIT_MSG=$(git log -1 --pretty=%B)
119+
120+
# Create PR from the bot fork to the main repository
121+
gh pr create \
122+
--repo google/adk-python \
123+
--title "fix(issue): fix issue #${ISSUE_NUMBER}" \
124+
--body "$COMMIT_MSG" \
125+
--head "${BOT_USER}:$BRANCH_NAME" \
126+
--base "main"
127+
else
128+
echo "No changes made by the agent. Skipping PR creation."
129+
fi

.github/workflows/pr-analyze.yml

Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
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: ADK Pull Request Triage & Analysis
16+
17+
on:
18+
pull_request_target:
19+
types: [opened, synchronize, reopened]
20+
issue_comment:
21+
types: [created]
22+
status:
23+
workflow_dispatch:
24+
inputs:
25+
pr_number:
26+
description: 'The Pull Request number to analyze'
27+
required: true
28+
type: string
29+
30+
jobs:
31+
pr-analyze:
32+
if: >-
33+
github.repository == 'google/adk-python' && (
34+
github.event_name == 'pull_request_target' ||
35+
github.event_name == 'workflow_dispatch' ||
36+
(github.event_name == 'status' &&
37+
github.event.context == 'cla/google' &&
38+
github.event.state == 'success') ||
39+
(github.event_name == 'issue_comment' &&
40+
github.event.issue.pull_request != null &&
41+
startsWith(github.event.comment.body, '/adk-pr-analyze') && (
42+
github.event.comment.author_association == 'OWNER' ||
43+
github.event.comment.author_association == 'MEMBER' ||
44+
github.event.comment.author_association == 'COLLABORATOR'
45+
))
46+
)
47+
runs-on: ubuntu-latest
48+
permissions:
49+
pull-requests: write
50+
issues: write
51+
contents: read
52+
53+
steps:
54+
- name: Checkout repository
55+
uses: actions/checkout@v6
56+
57+
- name: Set up Python
58+
uses: actions/setup-python@v6
59+
with:
60+
python-version: '3.11'
61+
62+
- name: Check CLA Status
63+
id: check-cla
64+
env:
65+
GITHUB_TOKEN: ${{ secrets.ADK_TRIAGE_AGENT }}
66+
run: |
67+
if [ "${{ github.event_name }}" = "status" ]; then
68+
echo "Resolving PR number for commit ${{ github.event.sha }}"
69+
PR_NUM=$(gh api repos/${{ github.repository }}/commits/${{ github.event.sha }}/pulls --jq '.[] | select(.state=="open") | .number' | head -n 1)
70+
if [ -z "$PR_NUM" ]; then
71+
echo "No open PR found for commit ${{ github.event.sha }}. Skipping."
72+
echo "signed=false" >> $GITHUB_OUTPUT
73+
exit 0
74+
fi
75+
else
76+
PR_NUM="${{ github.event.pull_request.number || github.event.issue.number || inputs.pr_number }}"
77+
fi
78+
79+
echo "PR_NUM=$PR_NUM" >> $GITHUB_ENV
80+
echo "Checking CLA status for PR #$PR_NUM"
81+
82+
# Run triage_pr.py to check CLA status and pull request data
83+
set +e
84+
python .agents/skills/adk-pr-analyze/scripts/triage_pr.py "$PR_NUM" --skip-update > pr_info.txt 2>&1
85+
exit_code=$?
86+
set -e
87+
88+
cat pr_info.txt
89+
90+
if [ $exit_code -eq 2 ]; then
91+
echo "❌ Google CLA is NOT signed. Skipping analysis."
92+
echo "signed=false" >> $GITHUB_OUTPUT
93+
elif [ $exit_code -eq 0 ] || [ $exit_code -eq 3 ]; then
94+
# exit code 0: CLA signed, assigned to current user
95+
# exit code 3: CLA signed, but assignment block (which is expected on automated action runs)
96+
echo "✅ Google CLA is signed."
97+
echo "signed=true" >> $GITHUB_OUTPUT
98+
else
99+
echo "❌ Verification script failed with unexpected exit code $exit_code."
100+
exit $exit_code
101+
fi
102+
103+
- name: Authenticate to Google Cloud
104+
if: steps.check-cla.outputs.signed == 'true'
105+
id: auth
106+
uses: 'google-github-actions/auth@v3'
107+
with:
108+
credentials_json: '${{ secrets.ADK_GCP_SA_KEY }}'
109+
110+
- name: Install Google Antigravity SDK
111+
if: steps.check-cla.outputs.signed == 'true'
112+
run: pip install google-antigravity
113+
114+
- name: Run Antigravity Triage & Analysis
115+
if: steps.check-cla.outputs.signed == 'true'
116+
env:
117+
GITHUB_TOKEN: ${{ secrets.ADK_TRIAGE_AGENT }}
118+
GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }}
119+
run: |
120+
python scripts/run_antigravity.py "/adk-pr-analyze $PR_NUM" > triage_report.md
121+
cat triage_report.md
122+
123+
- name: Post Triage Report as Comment
124+
if: steps.check-cla.outputs.signed == 'true'
125+
env:
126+
GITHUB_TOKEN: ${{ secrets.ADK_TRIAGE_AGENT }}
127+
run: |
128+
gh issue comment "$PR_NUM" --repo google/adk-python --body-file triage_report.md

CHANGELOG-v2.md

Lines changed: 0 additions & 14 deletions
This file was deleted.

0 commit comments

Comments
 (0)