Skip to content

Commit 8874a36

Browse files
authored
Merge branch 'main' into fix/issue_2001_support_impersonated_credential
2 parents 61c42db + de6ebdd commit 8874a36

59 files changed

Lines changed: 2338 additions & 608 deletions

Some content is hidden

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

.github/workflows/pr-triage.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: ADK Pull Request Triaging Agent
2+
3+
on:
4+
pull_request:
5+
types: [opened, reopened, edited]
6+
7+
jobs:
8+
agent-triage-pull-request:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
pull-requests: write
12+
contents: read
13+
14+
steps:
15+
- name: Checkout repository
16+
uses: actions/checkout@v4
17+
18+
- name: Set up Python
19+
uses: actions/setup-python@v5
20+
with:
21+
python-version: '3.11'
22+
23+
- name: Install dependencies
24+
run: |
25+
python -m pip install --upgrade pip
26+
pip install requests google-adk
27+
28+
- name: Run Triaging Script
29+
env:
30+
GITHUB_TOKEN: ${{ secrets.ADK_TRIAGE_AGENT }}
31+
GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }}
32+
GOOGLE_GENAI_USE_VERTEXAI: 0
33+
OWNER: 'google'
34+
REPO: 'adk-python'
35+
PULL_REQUEST_NUMBER: ${{ github.event.pull_request.number }}
36+
INTERACTIVE: ${{ secrets.PR_TRIAGE_INTERACTIVE }}
37+
PYTHONPATH: contributing/samples
38+
run: python -m adk_pr_triaging_agent.main

CONTRIBUTING.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,3 +210,7 @@ All submissions, including submissions by project members, require review. We
210210
use GitHub pull requests for this purpose. Consult
211211
[GitHub Help](https://help.github.com/articles/about-pull-requests/) for more
212212
information on using pull requests.
213+
214+
# Vibe Coding
215+
216+
If you want to contribute by leveraging viber coding, the AGENTS.md (https://github.com/google/adk-python/tree/main/AGENTS.md) could be used as context to your LLM.

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,10 @@ We welcome contributions from the community! Whether it's bug reports, feature r
138138
- [General contribution guideline and flow](https://google.github.io/adk-docs/contributing-guide/).
139139
- Then if you want to contribute code, please read [Code Contributing Guidelines](./CONTRIBUTING.md) to get started.
140140

141+
## Vibe Coding
142+
143+
If you are to develop agent via vibe coding the [llms.txt](./llms.txt) and the [llms-full.txt](./llms-full.txt) can be used as context to LLM. While the former one is a summarized one and the later one has the full information in case your LLM has big enough context window.
144+
141145
## 📄 License
142146

143147
This project is licensed under the Apache 2.0 License - see the [LICENSE](LICENSE) file for details.
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# ADK Pull Request Triaging Assistant
2+
3+
The ADK Pull Request (PR) Triaging Assistant is a Python-based agent designed to help manage and triage GitHub pull requests for the `google/adk-python` repository. It uses a large language model to analyze new and unlabelled pull requests, recommend appropriate labels, assign a reviewer, and check contribution guides based on a predefined set of rules.
4+
5+
This agent can be operated in two distinct modes:
6+
7+
* an interactive mode for local use
8+
* a fully automated GitHub Actions workflow.
9+
10+
---
11+
12+
## Interactive Mode
13+
14+
This mode allows you to run the agent locally to review its recommendations in real-time before any changes are made to your repository's pull requests.
15+
16+
### Features
17+
* **Web Interface**: The agent's interactive mode can be rendered in a web browser using the ADK's `adk web` command.
18+
* **User Approval**: In interactive mode, the agent is instructed to ask for your confirmation before applying a label or posting a comment to a GitHub pull request.
19+
20+
### Running in Interactive Mode
21+
To run the agent in interactive mode, first set the required environment variables. Then, execute the following command in your terminal:
22+
23+
```bash
24+
adk web
25+
```
26+
This will start a local server and provide a URL to access the agent's web interface in your browser.
27+
28+
---
29+
30+
## GitHub Workflow Mode
31+
32+
For automated, hands-off PR triaging, the agent can be integrated directly into your repository's CI/CD pipeline using a GitHub Actions workflow.
33+
34+
### Workflow Triggers
35+
The GitHub workflow is configured to run on specific triggers:
36+
37+
* **Pull Request Events**: The workflow executes automatically whenever a new PR is `opened` or an existing one is `reopened` or `edited`.
38+
39+
### Automated Labeling
40+
When running as part of the GitHub workflow, the agent operates non-interactively. It identifies and applies the best label or posts a comment directly without requiring user approval. This behavior is configured by setting the `INTERACTIVE` environment variable to `0` in the workflow file.
41+
42+
### Workflow Configuration
43+
The workflow is defined in a YAML file (`.github/workflows/pr-triage.yml`). This file contains the steps to check out the code, set up the Python environment, install dependencies, and run the triaging script with the necessary environment variables and secrets.
44+
45+
---
46+
47+
## Setup and Configuration
48+
49+
Whether running in interactive or workflow mode, the agent requires the following setup.
50+
51+
### Dependencies
52+
The agent requires the following Python libraries.
53+
54+
```bash
55+
pip install --upgrade pip
56+
pip install google-adk
57+
```
58+
59+
### Environment Variables
60+
The following environment variables are required for the agent to connect to the necessary services.
61+
62+
* `GITHUB_TOKEN`: **(Required)** A GitHub Personal Access Token with `pull_requests:write` permissions. Needed for both interactive and workflow modes.
63+
* `GOOGLE_API_KEY`: **(Required)** Your API key for the Gemini API. Needed for both interactive and workflow modes.
64+
* `OWNER`: The GitHub organization or username that owns the repository (e.g., `google`). Needed for both modes.
65+
* `REPO`: The name of the GitHub repository (e.g., `adk-python`). Needed for both modes.
66+
* `INTERACTIVE`: Controls the agent's interaction mode. For the automated workflow, this is set to `0`. For interactive mode, it should be set to `1` or left unset.
67+
68+
For local execution in interactive mode, you can place these variables in a `.env` file in the project's root directory. For the GitHub workflow, they should be configured as repository secrets.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
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+
from . import agent

0 commit comments

Comments
 (0)