feat: warn on active bounty attempts#385
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe submission quality gate now verifies active attempt reservations by fetching attempts from the MergeWork API, emitting pass/warn checks, enriching live context with attempts and verification flags, handling API failures with warnings, and showing per-attempt summaries in output; docs updated. ChangesActive Attempts Quality Gate
Estimated code review effort🎯 4 (Complex) | ⏱️ ~40 minutes Possibly related issues
Possibly related PRs
Suggested labels
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
carpedkm
left a comment
There was a problem hiding this comment.
Reviewed PR #385 at head 6a6f599 for Bounty #384 / review round #340.
Files inspected: scripts/submission_quality_gate.py, tests/test_submission_quality_gate.py, and docs/agent-guide.md.
I checked that the live path now carries the internal bounty id from the bounties API into a read-only /api/v1/bounties/{id}/attempts lookup, normalizes only safe public attempt fields, degrades attempts API failures into advisory warnings, and keeps the existing payability, maintainer-activity, evidence, multi-reference, and similar-open-PR checks intact. The public endpoint behavior matches the implementation assumption: /api/v1/bounties/59/attempts currently returns an attempts envelope, and running the gate against this PR body reports pass with no active attempts and no similar open PR warning.
Validation run locally:
./.venv/bin/python -m pytest tests/test_submission_quality_gate.py -q-> 21 passed./.venv/bin/python -m pytest -q-> 357 passed./.venv/bin/python -m ruff check scripts/submission_quality_gate.py tests/test_submission_quality_gate.py-> passed./.venv/bin/python -m ruff format --check scripts/submission_quality_gate.py tests/test_submission_quality_gate.py-> passed./.venv/bin/python -m mypy app-> success./.venv/bin/python scripts/docs_smoke.py-> docs smoke okgit diff --check origin/main...HEAD-> clean
No blockers found. One non-blocking note: I did not treat ruff format --check docs/agent-guide.md as applicable because ruff requires preview mode for Markdown; ruff check docs/agent-guide.md reports no Python files, as expected.
Strict accounting: review submitted only; no payment or acceptance counted until maintainer proof appears.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@scripts/submission_quality_gate.py`:
- Around line 527-537: When api_bounty.get("id") is missing or not an int,
currently the code skips setting active_attempts and active_attempts_verified
which hides unverified state; update the branch that handles non-integer
bounty_id so that you explicitly set bounties[-1]["active_attempts"] = [],
bounties[-1]["active_attempts_verified"] = False and append a descriptive
warning to load_warnings (similar to the except block) mentioning
issue['number'] and that the id was missing/invalid, instead of doing nothing;
this mirrors the behavior in the RuntimeError handler and ensures downstream
checks see the attempts as unverified (refer to bounty_id, api_bounty, bounties,
active_attempts, active_attempts_verified, _load_api_attempts, load_warnings,
issue).
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 32085230-4098-446f-bf5c-1410e70114e5
📒 Files selected for processing (3)
docs/agent-guide.mdscripts/submission_quality_gate.pytests/test_submission_quality_gate.py
aiautotool
left a comment
There was a problem hiding this comment.
Reviewed the active-attempt warning implementation against bounty #384. No blockers found.
Evidence checked:
scripts/submission_quality_gate.pykeeps the attempts lookup read-only viaGET /api/v1/bounties/{id}/attemptsand catches API/JSON/URL failures as advisory warnings instead of failing the gate.- Existing payability and maintainer-activity checks remain in the same evaluation path before summary/evidence checks, so closed/exhausted bounty behavior is preserved.
- JSON/text output includes only safe attempt fields: submitter, source URL, status, and expiry.
- Fixture coverage includes no attempts, one attempt, multiple attempts, unavailable attempts API, and closed/exhausted behavior.
Local validation from a clean PR worktree:
/Users/vkct/Documents/Codex/2026-05-26/s-d-ng-ki-n-th/mergework/.venv/bin/python -m pytest tests/test_submission_quality_gate.py -q-> 21 passed/Users/vkct/Documents/Codex/2026-05-26/s-d-ng-ki-n-th/mergework/.venv/bin/python scripts/docs_smoke.py-> docs smoke ok/Users/vkct/Documents/Codex/2026-05-26/s-d-ng-ki-n-th/mergework/.venv/bin/python -m ruff check scripts/submission_quality_gate.py tests/test_submission_quality_gate.py-> passed/Users/vkct/Documents/Codex/2026-05-26/s-d-ng-ki-n-th/mergework/.venv/bin/python -m ruff format --check scripts/submission_quality_gate.py tests/test_submission_quality_gate.py-> passedgit diff --check origin/main...HEAD-> passed
|
Follow-up for CodeRabbit discussion r3301745939: pushed Validation after the fix:
|
Summary
Add read-only active-attempt warnings to the submission quality gate.
Refs #384
Changes
/api/v1/bounties/{id}/attemptsfor the referenced bounty in live mode.Validation
./.venv/bin/python -m pytest tests/test_submission_quality_gate.py -q— 22 passed./.venv/bin/python scripts/docs_smoke.py— docs smoke ok./.venv/bin/python -m ruff format --check scripts/submission_quality_gate.py tests/test_submission_quality_gate.py— passed./.venv/bin/python -m ruff check scripts/submission_quality_gate.py tests/test_submission_quality_gate.py— passed./.venv/bin/python -m mypy app— passedgit diff --check— passedSummary by CodeRabbit
New Features
Documentation
Tests