Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 39 additions & 11 deletions .github/workflows/analyze-releases-for-adk-docs-updates.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# 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.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: Analyze New Release for ADK Docs Updates

on:
Expand Down Expand Up @@ -45,14 +59,16 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install requests google-adk
pip install requests "google-adk[db]"

- name: Restore session DB from cache
if: ${{ github.event.inputs.resume == 'true' }}
uses: actions/cache/restore@v4
with:
path: contributing/samples/adk_documentation/adk_release_analyzer/sessions.db
key: analyzer-session-db
path: contributing/samples/adk_team/adk_documentation/adk_release_analyzer/sessions.db
key: analyzer-session-db-${{ github.run_id }}-${{ github.run_attempt }}
restore-keys: |
analyzer-session-db-

- name: Run Analyzing Script
env:
Expand All @@ -64,16 +80,28 @@ jobs:
DOC_REPO: 'adk-docs'
CODE_REPO: 'adk-python'
INTERACTIVE: 0
PYTHONPATH: contributing/samples/adk_documentation
run: >-
python -m adk_release_analyzer.main
${{ github.event.inputs.resume == 'true' && '--resume' || '' }}
${{ github.event.inputs.start_tag && format('--start-tag {0}', github.event.inputs.start_tag) || '' }}
${{ github.event.inputs.end_tag && format('--end-tag {0}', github.event.inputs.end_tag) || '' }}
PYTHONPATH: contributing/samples/adk_team
ANALYZER_RESUME: ${{ github.event.inputs.resume }}
ANALYZER_START_TAG: ${{ github.event.inputs.start_tag }}
ANALYZER_END_TAG: ${{ github.event.inputs.end_tag }}
shell: bash
run: |
set -euo pipefail
args=()
if [[ "${ANALYZER_RESUME:-false}" == "true" ]]; then
args+=(--resume)
fi
if [[ -n "${ANALYZER_START_TAG:-}" ]]; then
args+=(--start-tag "$ANALYZER_START_TAG")
fi
if [[ -n "${ANALYZER_END_TAG:-}" ]]; then
args+=(--end-tag "$ANALYZER_END_TAG")
fi
python -m adk_documentation.adk_release_analyzer.main "${args[@]}"

- name: Save session DB to cache
if: always()
uses: actions/cache/save@v4
with:
path: contributing/samples/adk_documentation/adk_release_analyzer/sessions.db
key: analyzer-session-db
path: contributing/samples/adk_team/adk_documentation/adk_release_analyzer/sessions.db
key: analyzer-session-db-${{ github.run_id }}-${{ github.run_attempt }}
29 changes: 29 additions & 0 deletions .github/workflows/block-merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Copyright 2026 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: Do Not Merge on GitHub

on:
pull_request:
types: [opened, reopened, synchronize]

jobs:
block-merge:
name: maintainers will submit via Copybara
runs-on: ubuntu-latest
steps:
- name: Explain why merging is blocked
run: |
echo "::error title=GitHub merge is disabled::Do NOT merge this pull request on GitHub. A maintainer will land the change internally, and Copybara will sync it back to this repository automatically."
exit 1
37 changes: 33 additions & 4 deletions .github/workflows/copybara-pr-handler.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# 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.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: Copybara PR Handler

on:
Expand All @@ -17,6 +31,7 @@ on:

jobs:
close-imported-pr:
if: github.repository == 'google/adk-python'
runs-on: ubuntu-latest
permissions:
pull-requests: write
Expand Down Expand Up @@ -57,15 +72,21 @@ jobs:
console.log(`\n--- Processing commit ${sha.substring(0, 7)} ---`);
console.log(`Committer: ${committer}`);

// Check if this is a Copybara commit
if (committer !== 'Copybara-Service') {
// Check if this is a Copybara commit or has a pull request reference
const prRegex = /Merges?:?\s+(?:https:\/\/github\.com\/google\/adk-python\/pull\/|#)(\d+)/i;
const isCopybara = committer === 'Copybara-Service' ||
commit.author?.email === 'genai-sdk-bot@google.com' ||
message.includes('GitOrigin-RevId:') ||
message.includes('PiperOrigin-RevId:') ||
prRegex.test(message);

if (!isCopybara) {
console.log('Not a Copybara commit, skipping');
continue;
}

// Extract PR number from commit message
// Pattern: "Merge https://github.com/google/adk-python/pull/3333"
const prMatch = message.match(/Merge https:\/\/github\.com\/google\/adk-python\/pull\/(\d+)/);
const prMatch = message.match(prRegex);

if (!prMatch) {
console.log('No PR number found in Copybara commit message');
Expand Down Expand Up @@ -113,6 +134,14 @@ jobs:
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.`
});

// Add 'merged' label to the PR
await github.rest.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: prNumber,
labels: ['merged']
});

// Close the PR
await github.rest.pulls.update({
owner: context.repo.owner,
Expand Down
16 changes: 15 additions & 1 deletion .github/workflows/discussion_answering.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# 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.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: ADK Answering Agent for Discussions

on:
Expand Down Expand Up @@ -48,7 +62,7 @@ jobs:
OWNER: 'google'
REPO: 'adk-python'
INTERACTIVE: 0
PYTHONPATH: contributing/samples
PYTHONPATH: contributing/samples/adk_team
run: |
# Write discussion data to temporary file to avoid secret masking issues
cat > /tmp/discussion.json << 'EOF'
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/issue-monitor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ on:

jobs:
sweep-spam:
if: github.repository == 'google/adk-python'
runs-on: ubuntu-latest
timeout-minutes: 120
permissions:
Expand Down Expand Up @@ -58,6 +59,6 @@ jobs:
REPO: ${{ github.event.repository.name }}
CONCURRENCY_LIMIT: 3
INITIAL_FULL_SCAN: ${{ github.event.inputs.full_scan == 'true' }}
LLM_MODEL_NAME: "gemini-2.5-flash"
PYTHONPATH: contributing/samples
LLM_MODEL_NAME: "gemini-3.5-flash"
PYTHONPATH: contributing/samples/adk_team
run: python -m adk_issue_monitoring_agent.main
14 changes: 14 additions & 0 deletions .github/workflows/mypy.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# Copyright 2026 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: Mypy Type Check

on:
Expand Down
22 changes: 20 additions & 2 deletions .github/workflows/pr-triage.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# 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.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: ADK Pull Request Triaging Agent

on:
Expand All @@ -12,7 +26,11 @@ on:

jobs:
agent-triage-pull-request:
if: github.event_name == 'workflow_dispatch' || !contains(github.event.pull_request.labels.*.name, 'google-contributor')
if: >-
github.event_name == 'workflow_dispatch' || (
github.event.pull_request.head.repo.full_name == github.repository &&
!contains(github.event.pull_request.labels.*.name, 'google-contributor')
)
runs-on: ubuntu-latest
permissions:
pull-requests: write
Expand Down Expand Up @@ -41,5 +59,5 @@ jobs:
REPO: 'adk-python'
PULL_REQUEST_NUMBER: ${{ github.event.pull_request.number || github.event.inputs.pr_number }}
INTERACTIVE: ${{ vars.PR_TRIAGE_INTERACTIVE }}
PYTHONPATH: contributing/samples
PYTHONPATH: contributing/samples/adk_team
run: python -m adk_pr_triaging_agent.main
14 changes: 14 additions & 0 deletions .github/workflows/release-cherry-pick.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# Copyright 2026 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Step 3 (optional): Cherry-picks a commit from main to the release/candidate branch.
# Use between step 1 and step 4 to include bug fixes in an in-progress release.
# Note: Does NOT auto-trigger release-please to preserve manual changelog edits.
Expand Down
14 changes: 14 additions & 0 deletions .github/workflows/release-cut.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# Copyright 2026 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Step 1: Starts the release process by creating a release/candidate branch.
# Generates a changelog PR for review (step 2).
name: "Release: Cut"
Expand Down
14 changes: 14 additions & 0 deletions .github/workflows/release-finalize.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# Copyright 2026 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Step 4: Triggers when the changelog PR is merged to release/candidate.
# Records last-release-sha and renames release/candidate to release/v{version}.
name: "Release: Finalize"
Expand Down
14 changes: 14 additions & 0 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# Copyright 2026 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Runs release-please to create/update a PR with version bump and changelog.
# Triggered only by workflow_dispatch (from release-cut.yml).
# Does NOT auto-run on push to preserve manual changelog edits after cherry-picks.
Expand Down
18 changes: 16 additions & 2 deletions .github/workflows/release-publish.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# Copyright 2026 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Step 6: Builds and publishes the package to PyPI from a release/v{version} branch.
# Creates a merge-back PR (step 7) to sync release changes to main.
name: "Release: Publish to PyPi"
Expand Down Expand Up @@ -31,12 +45,12 @@ jobs:
- uses: actions/checkout@v6

- name: Install uv
uses: astral-sh/setup-uv@v4
uses: astral-sh/setup-uv@v7
with:
version: "latest"

- name: Set up Python
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: "3.11"

Expand Down
Loading
Loading