diff --git a/.github/workflows/triage.yml b/.github/workflows/triage.yml index ff1afaac98..52805d3539 100644 --- a/.github/workflows/triage.yml +++ b/.github/workflows/triage.yml @@ -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 diff --git a/contributing/samples/adk_triaging_agent/agent.py b/contributing/samples/adk_triaging_agent/agent.py index 4ea3facc03..c47bbb6a46 100644 --- a/contributing/samples/adk_triaging_agent/agent.py +++ b/contributing/samples/adk_triaging_agent/agent.py @@ -42,6 +42,9 @@ "workflow": "DeanChensj", } + +LABEL_TO_GTECH = ["klateefa", "llalitkumarrr", "surajksharma07"] + LABEL_GUIDELINES = """ Label rubric and disambiguation rules: - "documentation": Tutorials, README content, reference docs, or samples. @@ -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] @@ -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 @@ -177,6 +180,40 @@ 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" + ) + try: + response = post_request(assignee_url, assignee_payload) + 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. @@ -259,7 +296,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: @@ -271,8 +308,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. @@ -282,19 +319,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, ], ) diff --git a/contributing/samples/adk_triaging_agent/main.py b/contributing/samples/adk_triaging_agent/main.py index 2d65cfd67d..fcdac832ac 100644 --- a/contributing/samples/adk_triaging_agent/main.py +++ b/contributing/samples/adk_triaging_agent/main.py @@ -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( diff --git a/pyproject.toml b/pyproject.toml index 2789bcf82a..44e692ea7f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -48,7 +48,7 @@ dependencies = [ "graphviz>=0.20.2, <1.0.0", # Graphviz for graph rendering "httpx>=0.27.0, <1.0.0", # HTTP client library "jsonschema>=4.23.0, <5.0.0", # Agent Builder config validation - "mcp>=1.23.0, <2.0.0", # For MCP Toolset + "mcp>=1.24.0, <2.0.0", # For MCP Toolset "opentelemetry-api>=1.36.0, <1.39.0", # OpenTelemetry - keep below 1.39.0 due to current agent_engines exporter constraints. "opentelemetry-exporter-gcp-logging>=1.9.0a0, <2.0.0", "opentelemetry-exporter-gcp-monitoring>=1.9.0a0, <2.0.0",