You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: contributing/samples/adk_triaging_agent/README.md
+36-8Lines changed: 36 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,18 +1,39 @@
1
1
# ADK Issue Triaging Assistant
2
2
3
-
The ADK Issue Triaging Assistant is a Python-based agent designed to help manage and triage GitHub issues for the `google/adk-python` repository. It uses a large language model to analyze new and unlabelled issues, recommend appropriate labels based on a predefined set of rules, and apply them.
3
+
The ADK Issue Triaging Assistant is a Python-based agent designed to help manage and triage GitHub issues for the `google/adk-python` repository. It uses a large language model to analyze issues, recommend appropriate component labels, set issue types, and assign owners based on predefined rules.
4
4
5
5
This agent can be operated in two distinct modes: an interactive mode for local use or as a fully automated GitHub Actions workflow.
6
6
7
7
---
8
8
9
+
## Triaging Workflow
10
+
11
+
The agent performs different actions based on the issue state:
12
+
13
+
| Condition | Actions |
14
+
|-----------|---------|
15
+
| Issue without component label | Add component label + Set issue type (Bug/Feature) |
16
+
| Issue with "planned" label but no assignee | Assign owner based on component label |
17
+
| Issue with "planned" label AND no component label | Add component label + Set type + Assign owner |
18
+
19
+
### Component Labels
20
+
The agent can assign the following component labels, each mapped to an owner:
Based on the issue content, the agent will set the issue type to:
25
+
-**Bug**: For bug reports
26
+
-**Feature**: For feature requests
27
+
28
+
---
29
+
9
30
## Interactive Mode
10
31
11
32
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 issues.
12
33
13
34
### Features
14
35
***Web Interface**: The agent's interactive mode can be rendered in a web browser using the ADK's `adk web` command.
15
-
***User Approval**: In interactive mode, the agent is instructed to ask for your confirmation before applying a label to a GitHub issue.
36
+
***User Approval**: In interactive mode, the agent is instructed to ask for your confirmation before applying labels or assigning owners.
16
37
17
38
### Running in Interactive Mode
18
39
To run the agent in interactive mode, first set the required environment variables. Then, execute the following command in your terminal:
@@ -31,12 +52,19 @@ For automated, hands-off issue triaging, the agent can be integrated directly in
31
52
### Workflow Triggers
32
53
The GitHub workflow is configured to run on specific triggers:
33
54
34
-
1.**Issue Events**: The workflow executes automatically whenever a new issue is `opened` or an existing one is `reopened`.
55
+
1.**New Issues (`opened`)**: When a new issue is created, the agent adds an appropriate component label and sets the issue type.
56
+
57
+
2.**Planned Label Added (`labeled` with "planned")**: When an issue is labeled as "planned", the agent assigns an owner based on the component label. If the issue doesn't have a component label yet, the agent will also add one.
58
+
59
+
3.**Scheduled Runs**: The workflow runs every 6 hours to process any issues that need triaging (either missing component labels or missing assignees for "planned" issues).
35
60
36
-
2.**Scheduled Runs**: The workflow also runs on a recurring schedule (every 6 hours) to process any unlabelled issues that may have been missed.
61
+
### Automated Actions
62
+
When running as part of the GitHub workflow, the agent operates non-interactively:
63
+
-**Component Labeling**: Automatically applies the most appropriate component label
64
+
-**Issue Type Setting**: Sets the issue type to Bug or Feature based on content
65
+
-**Owner Assignment**: Only assigns owners for issues marked as "planned"
37
66
38
-
### Automated Labeling
39
-
When running as part of the GitHub workflow, the agent operates non-interactively. It identifies the best label and applies it directly without requiring user approval. This behavior is configured by setting the `INTERACTIVE` environment variable to `0` in the workflow file.
67
+
This behavior is configured by setting the `INTERACTIVE` environment variable to `0` in the workflow file.
40
68
41
69
### Workflow Configuration
42
70
The workflow is defined in a YAML file (`.github/workflows/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.
@@ -60,8 +88,8 @@ The following environment variables are required for the agent to connect to the
60
88
61
89
*`GITHUB_TOKEN`: **(Required)** A GitHub Personal Access Token with `issues:write` permissions. Needed for both interactive and workflow modes.
62
90
*`GOOGLE_API_KEY`: **(Required)** Your API key for the Gemini API. Needed for both interactive and workflow modes.
63
-
*`OWNER`: The GitHub organization or username that owns the repository (e.g., `google`). Needed for both modes.
64
-
*`REPO`: The name of the GitHub repository (e.g., `adk-python`). Needed for both modes.
91
+
*`OWNER`: The GitHub organization or username that owns the repository (e.g., `google`). In the workflow, this is automatically set from the repository context.
92
+
*`REPO`: The name of the GitHub repository (e.g., `adk-python`). In the workflow, this is automatically set from the repository context.
65
93
*`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.
66
94
67
95
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.
0 commit comments