Scope MCP work proof by repo#349
Conversation
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthroughThe PR extends the ChangesRepository selector for work proof submission
🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly Related PRs
Suggested Reviewers
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds support for scoping submit_work_proof lookups by repo when selecting a bounty via issue_number.
Changes:
- Add optional
reposelector argument handling (validation + query filter) for MCPsubmit_work_proofwhen usingissue_number. - Update MCP tool description to mention
repoand output format. - Expand tests to cover repo-scoped selection and invalid repo selector inputs.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| tests/test_api_mcp.py | Adds coverage for repo-scoped issue_number lookups and new invalid selector cases. |
| app/mcp.py | Updates MCP tool metadata description to reflect new selector behavior. |
| app/main.py | Implements optional repo selector parsing and applies it to the issue_number bounty query. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if repo is None: | ||
| return None | ||
| if len(repo) > 200: | ||
| raise ValueError("repo is too long") |
| "Return submission instructions, optionally for a bounty_id or issue_number " | ||
| "and repo, with text or json format" |
| issue_query = select(Bounty).where( | ||
| Bounty.issue_number == positive_int_arg("issue_number") | ||
| ) | ||
| if repo_selector is not None: | ||
| issue_query = issue_query.where(func.lower(Bounty.repo) == repo_selector) | ||
| bounties = session.scalars(issue_query.order_by(Bounty.id.desc()).limit(2)).all() |
|
Superseded by #351, which keeps the repo-scoped MCP guidance change in one focused PR. |
Refs #315
Summary
submit_work_proofcallers to passrepowithissue_numberso duplicate issue numbers across repositories resolve to the intended bounty.bounty_idbehavior and generic guidance unchanged while rejecting unsupportedreposelector combinations.Tests
python -m pytest tests/test_api_mcp.py -qpython -m ruff format --check app/main.py app/mcp.py tests/test_api_mcp.pypython -m ruff check app/main.py app/mcp.py tests/test_api_mcp.pySummary by CodeRabbit