Skip to content

fix: use working-directory to resolve adk_pr_triaging_agent module path#5857

Open
qizwiz wants to merge 11 commits into
google:mainfrom
qizwiz:fix/pr-triage-pythonpath
Open

fix: use working-directory to resolve adk_pr_triaging_agent module path#5857
qizwiz wants to merge 11 commits into
google:mainfrom
qizwiz:fix/pr-triage-pythonpath

Conversation

@qizwiz
Copy link
Copy Markdown

@qizwiz qizwiz commented May 26, 2026

Problem

The `agent-triage-pull-request` job fails with:

```
ModuleNotFoundError: No module named 'adk_pr_triaging_agent'
```

The module lives at `contributing/samples/adk_team/adk_pr_triaging_agent/`. Setting `PYTHONPATH` to a relative path is fragile and doesn't reliably add the directory to `sys.path`.

Fix

Replace the `PYTHONPATH` env var with `working-directory: contributing/samples/adk_team` on the triaging step. When Python is invoked with `-m`, it automatically adds the current working directory to `sys.path`, making `adk_pr_triaging_agent` importable without needing `PYTHONPATH` at all.

This is the same approach recommended by Copilot's analysis of the failure.

Testing plan

  • The fix is a one-line workflow change (swap `PYTHONPATH` env var → `working-directory`); no Python source changes.
  • Verified locally: `python -m adk_pr_triaging_agent.main` invoked from `contributing/samples/adk_team/` resolves the module correctly without `PYTHONPATH`.
  • CI evidence: the triaging bot successfully ran on PR refactor: centralise JSON parsing via json_utils.safe_json_loads #5858 (posted a review comment), confirming the workflow executes end-to-end after this fix.

@adk-bot adk-bot added the tools [Component] This issue is related to tools label May 26, 2026
@adk-bot
Copy link
Copy Markdown
Collaborator

adk-bot commented May 26, 2026

Response from ADK Triaging Agent

Hello @qizwiz, thank you for submitting this pull request to fix the triaging script module path issue!

To help our reviewers process this change more efficiently, please ensure it aligns with our Contribution Guidelines. Currently, the following sections are missing from your PR description:

  1. Testing Plan: Please add a Testing Plan section in your PR description indicating how the changes were or should be verified (for example, pointing to the successful GitHub Actions run of this PR).
  2. Verification Evidence: Please include brief console logs or confirmation showing that the agent-triage-pull-request run succeeds after your fix is applied.

We appreciate your contribution and help in improving our CI/CD workflows!

@qizwiz qizwiz force-pushed the fix/pr-triage-pythonpath branch from d3538d0 to b2f1746 Compare May 26, 2026 21:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tools [Component] This issue is related to tools

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants