You've already forked adk-python
mirror of
https://github.com/encounter/adk-python.git
synced 2026-07-09 18:19:28 -07:00
Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| b8644ef32c | |||
| ace3e5a3a5 | |||
| 37179a6e1f | |||
| d8ded07eb3 | |||
| a09dd4d31f | |||
| 71999b0ef7 | |||
| 3d6d6132cd | |||
| 78e4d81579 |
@@ -1,3 +0,0 @@
|
|||||||
{
|
|
||||||
".": "1.24.1"
|
|
||||||
}
|
|
||||||
@@ -7,69 +7,34 @@ assignees: ''
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## đź”´ Required Information
|
** Please make sure you read the contribution guide and file the issues in the right place. **
|
||||||
*Please ensure all items in this section are completed to allow for efficient
|
[Contribution guide.](https://google.github.io/adk-docs/contributing-guide/)
|
||||||
triaging. Requests without complete information may be rejected / deprioritized.
|
|
||||||
If an item is not applicable to you - please mark it as N/A*
|
|
||||||
|
|
||||||
**Describe the Bug:**
|
**Describe the bug**
|
||||||
A clear and concise description of what the bug is.
|
A clear and concise description of what the bug is.
|
||||||
|
|
||||||
**Steps to Reproduce:**
|
**To Reproduce**
|
||||||
Please provide a numbered list of steps to reproduce the behavior:
|
Please share a minimal code and data to reproduce your problem.
|
||||||
|
Steps to reproduce the behavior:
|
||||||
1. Install '...'
|
1. Install '...'
|
||||||
2. Run '....'
|
2. Run '....'
|
||||||
3. Open '....'
|
3. Open '....'
|
||||||
4. Provide error or stacktrace
|
4. Provie error or stacktrace
|
||||||
|
|
||||||
**Expected Behavior:**
|
**Expected behavior**
|
||||||
A clear and concise description of what you expected to happen.
|
A clear and concise description of what you expected to happen.
|
||||||
|
|
||||||
**Observed Behavior:**
|
**Screenshots**
|
||||||
What actually happened? Include error messages or crash stack traces here.
|
If applicable, add screenshots to help explain your problem.
|
||||||
|
|
||||||
**Environment Details:**
|
**Desktop (please complete the following information):**
|
||||||
|
- OS: [e.g. macOS, Linux, Windows]
|
||||||
- ADK Library Version (pip show google-adk):
|
- Python version(python -V):
|
||||||
- Desktop OS:** [e.g., macOS, Linux, Windows]
|
- ADK version(pip show google-adk):
|
||||||
- Python Version (python -V):
|
|
||||||
|
|
||||||
**Model Information:**
|
|
||||||
|
|
||||||
|
**Model Information:**
|
||||||
- Are you using LiteLLM: Yes/No
|
- 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)
|
||||||
|
|
||||||
---
|
**Additional context**
|
||||||
|
|
||||||
## 🟡 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:**
|
|
||||||
Add any other context about the problem here.
|
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
|
|
||||||
|
|||||||
@@ -10,39 +10,14 @@ assignees: ''
|
|||||||
** Please make sure you read the contribution guide and file the issues in the right place. **
|
** 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/)
|
[Contribution guide.](https://google.github.io/adk-docs/contributing-guide/)
|
||||||
|
|
||||||
## đź”´ Required Information
|
**Is your feature request related to a problem? Please describe.**
|
||||||
*Please ensure all items in this section are completed to allow for efficient
|
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
||||||
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 specific problem?
|
**Describe the solution you'd like**
|
||||||
Please describe the problem you are trying to solve. (Ex: "I'm always frustrated
|
A clear and concise description of what you want to happen.
|
||||||
when I have to manually handle X...")
|
|
||||||
|
|
||||||
### Describe the Solution You'd Like
|
**Describe alternatives you've considered**
|
||||||
A clear and concise description of the feature or API change you want.
|
A clear and concise description of any alternative solutions or features you've considered.
|
||||||
Be specific about input/outputs if this involves an API change.
|
|
||||||
|
|
||||||
### Impact on your work
|
**Additional context**
|
||||||
How does this feature impact your work and what are you trying to achieve?
|
Add any other context or screenshots about the feature request here.
|
||||||
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.
|
|
||||||
|
|||||||
@@ -1,52 +0,0 @@
|
|||||||
**Please ensure you have read the [contribution guide](https://github.com/google/adk-python/blob/main/CONTRIBUTING.md) before creating a pull request.**
|
|
||||||
|
|
||||||
### Link to Issue or Description of Change
|
|
||||||
|
|
||||||
**1. Link to an existing issue (if applicable):**
|
|
||||||
|
|
||||||
- Closes: #_issue_number_
|
|
||||||
- Related: #_issue_number_
|
|
||||||
|
|
||||||
**2. Or, if no issue exists, describe the change:**
|
|
||||||
|
|
||||||
_If applicable, please follow the issue templates to provide as much detail as
|
|
||||||
possible._
|
|
||||||
|
|
||||||
**Problem:**
|
|
||||||
_A clear and concise description of what the problem is._
|
|
||||||
|
|
||||||
**Solution:**
|
|
||||||
_A clear and concise description of what you want to happen and why you choose
|
|
||||||
this solution._
|
|
||||||
|
|
||||||
### Testing Plan
|
|
||||||
|
|
||||||
_Please describe the tests that you ran to verify your changes. This is required
|
|
||||||
for all PRs that are not small documentation or typo fixes._
|
|
||||||
|
|
||||||
**Unit Tests:**
|
|
||||||
|
|
||||||
- [ ] I have added or updated unit tests for my change.
|
|
||||||
- [ ] All unit tests pass locally.
|
|
||||||
|
|
||||||
_Please include a summary of passed `pytest` results._
|
|
||||||
|
|
||||||
**Manual End-to-End (E2E) Tests:**
|
|
||||||
|
|
||||||
_Please provide instructions on how to manually test your changes, including any
|
|
||||||
necessary setup or configuration. Please provide logs or screenshots to help
|
|
||||||
reviewers better understand the fix._
|
|
||||||
|
|
||||||
### Checklist
|
|
||||||
|
|
||||||
- [ ] I have read the [CONTRIBUTING.md](https://github.com/google/adk-python/blob/main/CONTRIBUTING.md) document.
|
|
||||||
- [ ] I have performed a self-review of my own code.
|
|
||||||
- [ ] I have commented my code, particularly in hard-to-understand areas.
|
|
||||||
- [ ] I have added tests that prove my fix is effective or that my feature works.
|
|
||||||
- [ ] New and existing unit tests pass locally with my changes.
|
|
||||||
- [ ] I have manually tested my changes end-to-end.
|
|
||||||
- [ ] Any dependent changes have been merged and published in downstream modules.
|
|
||||||
|
|
||||||
### Additional context
|
|
||||||
|
|
||||||
_Add any other context or screenshots about the feature request here._
|
|
||||||
@@ -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}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
releaseType: python
|
||||||
|
handleGHRelease: true
|
||||||
|
bumpMinorPreMajor: false
|
||||||
|
extraFiles:
|
||||||
|
- src/google/adk/version.py
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
enabled: true
|
||||||
@@ -16,15 +16,15 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Set up Python
|
- name: Set up Python
|
||||||
uses: actions/setup-python@v6
|
uses: actions/setup-python@v5
|
||||||
with:
|
with:
|
||||||
python-version: '3.11'
|
python-version: '3.11'
|
||||||
|
|
||||||
- name: Load adk-bot SSH Private Key
|
- name: Load adk-bot SSH Private Key
|
||||||
uses: webfactory/ssh-agent@v0.9.1
|
uses: webfactory/ssh-agent@v0.9.0
|
||||||
with:
|
with:
|
||||||
ssh-private-key: ${{ secrets.ADK_BOT_SSH_PRIVATE_KEY }}
|
ssh-private-key: ${{ secrets.ADK_BOT_SSH_PRIVATE_KEY }}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# Copyright 2026 Google LLC
|
# Copyright 2025 Google LLC
|
||||||
#
|
#
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# you may not use this file except in compliance with the License.
|
# you may not use this file except in compliance with the License.
|
||||||
@@ -24,7 +24,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout Code
|
- name: Checkout Code
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 2
|
fetch-depth: 2
|
||||||
|
|
||||||
@@ -89,14 +89,14 @@ jobs:
|
|||||||
- name: Check for import from cli package in certain changed Python files
|
- name: Check for import from cli package in certain changed Python files
|
||||||
run: |
|
run: |
|
||||||
git fetch origin ${{ github.base_ref }}
|
git fetch origin ${{ github.base_ref }}
|
||||||
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)
|
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)
|
||||||
if [ -n "$CHANGED_FILES" ]; then
|
if [ -n "$CHANGED_FILES" ]; then
|
||||||
echo "Changed Python files to check:"
|
echo "Changed Python files to check:"
|
||||||
echo "$CHANGED_FILES"
|
echo "$CHANGED_FILES"
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
set +e
|
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=$?
|
GREP_EXIT_CODE=$?
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
|||||||
@@ -1,134 +0,0 @@
|
|||||||
name: Copybara PR Handler
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
workflow_dispatch:
|
|
||||||
inputs:
|
|
||||||
pr_number:
|
|
||||||
description: 'PR number to close (for testing)'
|
|
||||||
required: true
|
|
||||||
type: string
|
|
||||||
commit_sha:
|
|
||||||
description: 'Commit SHA reference (optional, for testing)'
|
|
||||||
required: false
|
|
||||||
type: string
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
close-imported-pr:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
permissions:
|
|
||||||
pull-requests: write
|
|
||||||
issues: write
|
|
||||||
contents: read
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Check for Copybara commits and close PRs
|
|
||||||
uses: actions/github-script@v8
|
|
||||||
with:
|
|
||||||
github-token: ${{ secrets.ADK_TRIAGE_AGENT }}
|
|
||||||
script: |
|
|
||||||
// Check if this is a manual test run
|
|
||||||
const isManualRun = context.eventName === 'workflow_dispatch';
|
|
||||||
|
|
||||||
let prsToClose = [];
|
|
||||||
|
|
||||||
if (isManualRun) {
|
|
||||||
// Manual testing mode
|
|
||||||
const prNumber = parseInt(context.payload.inputs.pr_number);
|
|
||||||
const commitSha = context.payload.inputs.commit_sha || context.sha.substring(0, 7);
|
|
||||||
|
|
||||||
console.log('=== MANUAL TEST MODE ===');
|
|
||||||
console.log(`Testing with PR #${prNumber}, commit ${commitSha}`);
|
|
||||||
|
|
||||||
prsToClose.push({ prNumber, commitSha });
|
|
||||||
} else {
|
|
||||||
// Normal mode: process commits from push event
|
|
||||||
const commits = context.payload.commits || [];
|
|
||||||
console.log(`Found ${commits.length} commit(s) in this push`);
|
|
||||||
|
|
||||||
// Process each commit
|
|
||||||
for (const commit of commits) {
|
|
||||||
const sha = commit.id;
|
|
||||||
const committer = commit.committer.name;
|
|
||||||
const message = commit.message;
|
|
||||||
|
|
||||||
console.log(`\n--- Processing commit ${sha.substring(0, 7)} ---`);
|
|
||||||
console.log(`Committer: ${committer}`);
|
|
||||||
|
|
||||||
// Check if this is a Copybara commit
|
|
||||||
if (committer !== 'Copybara-Service') {
|
|
||||||
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+)/);
|
|
||||||
|
|
||||||
if (!prMatch) {
|
|
||||||
console.log('No PR number found in Copybara commit message');
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
const prNumber = parseInt(prMatch[1]);
|
|
||||||
const commitSha = sha.substring(0, 7);
|
|
||||||
|
|
||||||
prsToClose.push({ prNumber, commitSha });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Process PRs to close
|
|
||||||
for (const { prNumber, commitSha } of prsToClose) {
|
|
||||||
console.log(`\n--- Processing PR #${prNumber} ---`);
|
|
||||||
|
|
||||||
// Get PR details to check if it's open
|
|
||||||
let pr;
|
|
||||||
try {
|
|
||||||
pr = await github.rest.pulls.get({
|
|
||||||
owner: context.repo.owner,
|
|
||||||
repo: context.repo.repo,
|
|
||||||
pull_number: prNumber
|
|
||||||
});
|
|
||||||
} catch (error) {
|
|
||||||
console.log(`PR #${prNumber} not found or inaccessible:`, error.message);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Only close if PR is still open
|
|
||||||
if (pr.data.state !== 'open') {
|
|
||||||
console.log(`PR #${prNumber} is already ${pr.data.state}, skipping`);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
const author = pr.data.user.login;
|
|
||||||
|
|
||||||
try {
|
|
||||||
// Add comment with commit reference
|
|
||||||
await github.rest.issues.createComment({
|
|
||||||
owner: context.repo.owner,
|
|
||||||
repo: context.repo.repo,
|
|
||||||
issue_number: prNumber,
|
|
||||||
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.`
|
|
||||||
});
|
|
||||||
|
|
||||||
// Close the PR
|
|
||||||
await github.rest.pulls.update({
|
|
||||||
owner: context.repo.owner,
|
|
||||||
repo: context.repo.repo,
|
|
||||||
pull_number: prNumber,
|
|
||||||
state: 'closed'
|
|
||||||
});
|
|
||||||
|
|
||||||
console.log(`Successfully closed PR #${prNumber}`);
|
|
||||||
} catch (error) {
|
|
||||||
console.log(`Error closing PR #${prNumber}:`, error.message);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isManualRun) {
|
|
||||||
console.log('\n=== TEST COMPLETED ===');
|
|
||||||
} else {
|
|
||||||
console.log('\n--- Finished processing all commits ---');
|
|
||||||
}
|
|
||||||
@@ -15,16 +15,16 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Set up Python
|
- name: Set up Python
|
||||||
uses: actions/setup-python@v6
|
uses: actions/setup-python@v5
|
||||||
with:
|
with:
|
||||||
python-version: '3.11'
|
python-version: '3.11'
|
||||||
|
|
||||||
- name: Authenticate to Google Cloud
|
- name: Authenticate to Google Cloud
|
||||||
id: auth
|
id: auth
|
||||||
uses: 'google-github-actions/auth@v3'
|
uses: 'google-github-actions/auth@v2'
|
||||||
with:
|
with:
|
||||||
credentials_json: '${{ secrets.ADK_GCP_SA_KEY }}'
|
credentials_json: '${{ secrets.ADK_GCP_SA_KEY }}'
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# Copyright 2026 Google LLC
|
# Copyright 2025 Google LLC
|
||||||
#
|
#
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# you may not use this file except in compliance with the License.
|
# you may not use this file except in compliance with the License.
|
||||||
@@ -26,14 +26,14 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 2
|
fetch-depth: 2
|
||||||
|
|
||||||
- name: Set up Python
|
- name: Set up Python
|
||||||
uses: actions/setup-python@v6
|
uses: actions/setup-python@v5
|
||||||
with:
|
with:
|
||||||
python-version: '3.11'
|
python-version: '3.x'
|
||||||
|
|
||||||
- name: Install isort
|
- name: Install isort
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
@@ -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
|
|
||||||
@@ -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
|
|
||||||
@@ -20,10 +20,10 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Set up Python
|
- name: Set up Python
|
||||||
uses: actions/setup-python@v6
|
uses: actions/setup-python@v5
|
||||||
with:
|
with:
|
||||||
python-version: '3.11'
|
python-version: '3.11'
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# Copyright 2026 Google LLC
|
# Copyright 2025 Google LLC
|
||||||
#
|
#
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# you may not use this file except in compliance with the License.
|
# you may not use this file except in compliance with the License.
|
||||||
@@ -26,14 +26,14 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 2
|
fetch-depth: 2
|
||||||
|
|
||||||
- name: Set up Python
|
- name: Set up Python
|
||||||
uses: actions/setup-python@v6
|
uses: actions/setup-python@v5
|
||||||
with:
|
with:
|
||||||
python-version: '3.11'
|
python-version: '3.x'
|
||||||
|
|
||||||
- name: Install pyink
|
- name: Install pyink
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# Copyright 2026 Google LLC
|
# Copyright 2025 Google LLC
|
||||||
#
|
#
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# you may not use this file except in compliance with the License.
|
# you may not use this file except in compliance with the License.
|
||||||
@@ -25,19 +25,19 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
|
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Set up Python ${{ matrix.python-version }}
|
- name: Set up Python ${{ matrix.python-version }}
|
||||||
uses: actions/setup-python@v6
|
uses: actions/setup-python@v5
|
||||||
with:
|
with:
|
||||||
python-version: ${{ matrix.python-version }}
|
python-version: ${{ matrix.python-version }}
|
||||||
|
|
||||||
- name: Install the latest version of uv
|
- name: Install the latest version of uv
|
||||||
uses: astral-sh/setup-uv@v7
|
uses: astral-sh/setup-uv@v6
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
@@ -48,6 +48,14 @@ jobs:
|
|||||||
- name: Run unit tests with pytest
|
- name: Run unit tests with pytest
|
||||||
run: |
|
run: |
|
||||||
source .venv/bin/activate
|
source .venv/bin/activate
|
||||||
pytest tests/unittests \
|
if [[ "${{ matrix.python-version }}" == "3.9" ]]; then
|
||||||
--ignore=tests/unittests/artifacts/test_artifact_service.py \
|
pytest tests/unittests \
|
||||||
--ignore=tests/unittests/tools/google_api_tool/test_googleapi_to_openapi_converter.py
|
--ignore=tests/unittests/a2a \
|
||||||
|
--ignore=tests/unittests/tools/mcp_tool \
|
||||||
|
--ignore=tests/unittests/artifacts/test_artifact_service.py \
|
||||||
|
--ignore=tests/unittests/tools/google_api_tool/test_googleapi_to_openapi_converter.py
|
||||||
|
else
|
||||||
|
pytest tests/unittests \
|
||||||
|
--ignore=tests/unittests/artifacts/test_artifact_service.py \
|
||||||
|
--ignore=tests/unittests/tools/google_api_tool/test_googleapi_to_openapi_converter.py
|
||||||
|
fi
|
||||||
@@ -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"
|
|
||||||
@@ -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"
|
|
||||||
@@ -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"
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user