Repository navigation
Improve E2E test local setup and set User-Agent on all HTTP requests - #526
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a global YMIR_USER_AGENT constant and configures various aiohttp and HTTP clients across the codebase to include this header. It also updates documentation and docker-compose configurations to facilitate local E2E testing with mock Jira data. The reviewer feedback suggests enforcing request timeouts on several newly modified aiohttp.ClientSession instances to prevent requests from hanging indefinitely, and recommends extending the User-Agent header to requests.Session in http_utils.py for completeness.
| aiohttp.ClientSession(headers={"User-Agent": YMIR_USER_AGENT}) as session, | ||
| session.get(url) as response, |
There was a problem hiding this comment.
lol, all comments are about timeouts, why?
Signed-off-by: Tomas Tomecek <ttomecek@redhat.com> Assisted-by: Claude
…rable Add JIRA_MOCK_FILES_HOST env var support to compose.yaml so the testing-jiras jiras/ directory can be mounted directly into the container without copying files. Document the full local setup in CONTRIBUTING.md and update the data/README.md. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
14a0bd1 to
f4f9896
Compare
| artifacts_urls = tool_input.artifacts_urls | ||
| target_path = tool_input.target_path | ||
| async with aiohttp.ClientSession(timeout=AIOHTTP_TIMEOUT) as session: | ||
| async with aiohttp.ClientSession( |
There was a problem hiding this comment.
nice! Should we also add instructions to the agents to include the User-Agent when doing curl and similar requests? 👀
There was a problem hiding this comment.
oh yeah, that's an excellent point!
Add YMIR_USER_AGENT constant and apply it everywhere aiohttp is used so requests to upstream servers like thekelleys.org.uk are not rejected as bots. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Hardcode DRY_RUN=true in run-triage-agent-e2e-tests Makefile target (mock Jira is writable; without it the agent writes comments back to fixture files, corrupting subsequent runs) - Simplify CONTRIBUTING.md run commands and explain why DRY_RUN is needed - Clarify that testing-jiras is only needed for initial clone, not during runs - Set User-Agent on requests.Session in supervisor/http_utils.py - Add -A "redhat-ymir-agent" to curl commands in backport agent prompt Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
167bbad
f4f9896 to
167bbad
Compare
Summary
JIRA_MOCK_FILES_HOSTenv var incompose.yaml, so thetesting-jiras/jiras/directory can be mounted directly into themcp-gatewaycontainer without copying filesCONTRIBUTING.md(symlinks for mock repos,JIRA_MOCK_FILES_HOSTfor Jira fixtures)User-Agent: redhat-ymir-agenton all outgoingaiohttpHTTP requests to prevent upstream servers (e.g.thekelleys.org.ukfor dnsmasq) from rejecting requests as botsTest plan
make run-triage-agent-e2e-tests DRY_RUN=truelocally withJIRA_MOCK_FILES_HOSTset to verify tests passmake check-in-container🤖 Generated with Claude Code