Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
5abd6c6
Updated agent.py and triage workflow for auto assignment.
llalitkumarrr Mar 20, 2026
c93019a
Auto assignment to gtech team and merge remote updates
llalitkumarrr Mar 20, 2026
ae8149d
Fix print statement syntax in main.py
llalitkumarrr Mar 23, 2026
cc9709a
Change REPO environment variable to use secrets
llalitkumarrr Mar 23, 2026
82313fc
Fix print statement syntax in main.py
llalitkumarrr Mar 23, 2026
4e1e01c
Update GitHub token in triage workflow
llalitkumarrr Mar 23, 2026
604e37a
Updated main.py for need owner.
llalitkumarrr Mar 23, 2026
fdeeeeb
Change owner assignment function in agent.py
llalitkumarrr Mar 23, 2026
68efdd6
Reorder GTech owners and update variable names
llalitkumarrr Mar 23, 2026
b1d117c
Simplify owner assignment instruction in agent.py
llalitkumarrr Mar 23, 2026
075e3f6
Refactor triaging agent comments for clarity
llalitkumarrr Mar 23, 2026
d8a93c4
Update agent.py
llalitkumarrr Mar 23, 2026
4656868
Fix print statement formatting for assignee message
llalitkumarrr Mar 23, 2026
f25de60
Update agent.py
llalitkumarrr Mar 23, 2026
9a794c3
Clean up debug prints in agent.py
llalitkumarrr Mar 23, 2026
c6a9a2c
Remove print statement from main.py
llalitkumarrr Mar 23, 2026
e12ee41
Merge branch 'google:main' into main
llalitkumarrr Mar 23, 2026
eaa2e51
Update triage workflow
llalitkumarrr Mar 23, 2026
399f176
Remove commented out needs_owner assignment
llalitkumarrr Mar 23, 2026
5978ce2
Refactor print statements and clean up code
llalitkumarrr Mar 23, 2026
688f688
Update repository condition in triage workflow
llalitkumarrr Mar 23, 2026
28c3ee7
Clean up formatting in add_label_to_issue function
llalitkumarrr Mar 23, 2026
d5f0ae3
Fix errors in agent.py
llalitkumarrr Mar 23, 2026
ff7a846
Add 'sanketpatil06' to LABEL_TO_GTECH list
llalitkumarrr Mar 30, 2026
c582bd0
Add assignee payload for GitHub issue assignment
llalitkumarrr Apr 6, 2026
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
3 changes: 1 addition & 2 deletions .github/workflows/triage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ jobs:
if: >-
github.repository == 'google/adk-python' && (
github.event_name == 'schedule' ||
github.event.action == 'opened' ||
github.event.label.name == 'planned'
github.event.action == 'opened'
)
permissions:
issues: write
Expand Down
59 changes: 48 additions & 11 deletions contributing/samples/adk_triaging_agent/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@
"workflow": "DeanChensj",
}


LABEL_TO_GTECH = ["klateefa", "llalitkumarrr", "surajksharma07", "sanketpatil06"]

LABEL_GUIDELINES = """
Label rubric and disambiguation rules:
- "documentation": Tutorials, README content, reference docs, or samples.
Expand Down Expand Up @@ -121,15 +124,16 @@ def list_untriaged_issues(issue_count: int) -> dict[str, Any]:

existing_component_labels = issue_labels & component_labels
has_component = bool(existing_component_labels)
has_planned = "planned" in issue_labels
# has_planned = "planned" in issue_labels

# Determine what actions are needed
needs_component_label = not has_component
needs_owner = has_planned and not assignees
# needs_owner = has_planned and not assignees
needs_owner = not assignees

# Include issue if it needs any action
if needs_component_label or needs_owner:
issue["has_planned_label"] = has_planned
# issue["has_planned_label"] = has_planned
issue["has_component_label"] = has_component
issue["existing_component_label"] = (
list(existing_component_labels)[0]
Expand All @@ -146,7 +150,6 @@ def list_untriaged_issues(issue_count: int) -> dict[str, Any]:

def add_label_to_issue(issue_number: int, label: str) -> dict[str, Any]:
"""Add the specified component label to the given issue number.

Args:
issue_number: issue number of the GitHub issue.
label: label to assign
Expand Down Expand Up @@ -177,6 +180,41 @@ def add_label_to_issue(issue_number: int, label: str) -> dict[str, Any]:
}


def assign_gtech_owner_to_issue(issue_number: int) -> dict[str, Any]:
"""Assign an owner from the GTech team to the given issue number.
This is go to option irrespective of component label or planned label, as long as the issue needs an owner.

All unassigned issues will be considered for GTech ownership. Unassigned issues will seperated in two categories: issues with type "Bug" and issues with type "Feature". Then bug issues and feature issues will be equally assigned to the Gtech members in such a way that every day all members get equal number of bug and feature issues.

Args:
issue_number: issue number of the GitHub issue.

Returns:
The status of this request, with the assigned owner when successful.
"""
print(f"Attempting to assign GTech owner to issue #{issue_number}")
gtech_assignee = LABEL_TO_GTECH[issue_number % len(LABEL_TO_GTECH)]
if not gtech_assignee:
return {
"status": "warning",
"message": f"No gtech_assignee found, will add any assignee",
}
assignee_url = (
f"{GITHUB_BASE_URL}/repos/{OWNER}/{REPO}/issues/{issue_number}/assignees"
)
assignee_payload = {"assignees": [gtech_assignee]}
try:
response = post_request(assignee_url, assignee_payload)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

assignee_payload doesn't seem to be defined, should it be gtech_assignee?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @xuanyang15 ,

You are right it should be gtech_assignee, I have made the update. Could you please let me know if anything else is required before we can merge this? Thank you.

except requests.exceptions.RequestException as e:
return error_response(f"Error: {e}")

return {
"status": "success",
"message": response,
"assigned_owner": gtech_assignee,
}


def add_owner_to_issue(issue_number: int, label: str) -> dict[str, Any]:
"""Assign an owner to the issue based on the component label.

Expand Down Expand Up @@ -259,7 +297,7 @@ def change_issue_type(issue_number: int, issue_type: str) -> dict[str, Any]:

Each issue will have flags indicating what actions are needed:
- `needs_component_label`: true if the issue needs a component label
- `needs_owner`: true if the issue needs an owner assigned (has 'planned' label but no assignee)
- `needs_owner`: true if the issue needs an owner assigned

For each issue, perform ONLY the required actions based on the flags:

Expand All @@ -271,8 +309,8 @@ def change_issue_type(issue_number: int, issue_type: str) -> dict[str, Any]:
- Otherwise → do not change the issue type

2. **If `needs_owner` is true**:
- Use `add_owner_to_issue` to assign an owner based on the component label
- Note: If the issue already has a component label (`has_component_label: true`), use that existing label to determine the owner
- Use `assign_gtech_owner_to_issue` to assign an owner.


Do NOT add a component label if `needs_component_label` is false.
Do NOT assign an owner if `needs_owner` is false.
Expand All @@ -282,19 +320,18 @@ def change_issue_type(issue_number: int, issue_type: str) -> dict[str, Any]:
placeholders (never output text like "[fill in later]").
- Justify the chosen label with a short explanation referencing the issue
details.
- Mention the assigned owner only when you actually assign one (i.e., when
the issue has the 'planned' label).
- Mention the assigned owner only when you actually assign one.
- If no label is applied, clearly state why.

Present the following in an easy to read format highlighting issue number and your label.
- the issue summary in a few sentence
- your label recommendation and justification
- the owner of the label if you assign the issue to an owner (only for planned issues)
- the owner, if you assign the issue to an owner
""",
tools=[
list_untriaged_issues,
add_label_to_issue,
add_owner_to_issue,
assign_gtech_owner_to_issue,
change_issue_type,
],
)
2 changes: 1 addition & 1 deletion contributing/samples/adk_triaging_agent/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ async def fetch_specific_issue_details(issue_number: int):

# Determine what actions are needed
needs_component_label = not has_component
needs_owner = has_planned and not has_assignee
needs_owner = not has_assignee

if needs_component_label or needs_owner:
print(
Expand Down
Loading