fix: epilogue nits -- pagination, test rename, docs, CI #12
No reviewers
Labels
No labels
domain:backend
domain:devops
domain:frontend
status:approved
status:in-progress
status:needs-fix
status:qa
test:label-a
test:label-b
test:set-label
type:bug
type:devops
type:feature
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
ldraney/forgejo-mcp!12
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "11-epilogue-nits-pagination-test-rename-doc"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Addresses all 4 QA nits from PR #10 review: set_label pagination bug, test file naming, missing documentation for the comment_on_issue/comment_on_pr distinction, and missing pytest CI step.
Changes
src/forgejo_mcp/tools/workflows.py-- Paginateset_labelthrough all repo labels (page-by-page with page_size=50) instead of fetching only the first 100. Added docstrings tocomment_on_issueandcomment_on_prdocumenting they share the same Forgejo API endpoint.tests/test_new_tools.py->tests/test_label_comment_repo.py-- Renamed to descriptive filename matching the tools it tests.tests/test_set_label_pagination.py-- New unit tests (4 cases) verifying pagination works with mocked 150+ labels, single-page repos, missing labels after full pagination, and empty repos.README.md-- Updated tool list to reflect all current MCP tools. Added section documentingcomment_on_issuevscomment_on_prshared endpoint..woodpecker.yml-- Replaced lint-only step with combined test step that installs the package, runs ruff lint+format on src/ and tests/, then runs pytest. Matches the CI pattern used in basketball-api and pal-e-docs.Test Plan
ruff check src/ tests/passesruff format --check src/ tests/passespytest tests/ -v-- 4 unit tests pass, 8 integration tests correctly skipped (no Forgejo creds)Review Checklist
Related
plan-pal-e-agency(traceability)Closes #11
Self-Review: LGTM
Verified all 5 acceptance criteria from issue #11 against the diff:
page/limitparams correctly iterates through all repo labels. Breaks on empty batch or partial page. No off-by-one risk.test_new_tools.py->test_label_comment_repo.py), 100% similarity.comment_on_issueandcomment_on_prdocstrings explain the shared Forgejo API endpoint. README has a dedicated subsection.tests/too), pytest. Matches platform CI pattern. Publish step preserved.Additional cleanup: removed duplicate header comments in
.woodpecker.yml, updated step syntax to list-of-maps format.No issues found. Ready for human review.
PR #12 Review
BLOCKERS
1. Woodpecker step-level
whenis redundant and may cause issuesThe
teststep has its ownwhenclause:This duplicates the top-level
whenfilter. While Woodpecker should handle this gracefully (innerwhennarrows the outer), it is unnecessary duplication. Thepublishstep correctly uses a narrowerwhen(push + main only), which makes sense. Theteststep'swhenis identical to the top-level and adds no value. Not a merge blocker, but worth noting -- see NITS.No blockers found. All four acceptance criteria from issue #11 are met.
NITS
1. Redundant
whenon theteststep (.woodpecker.ymlline 14-15)The top-level
whenalready gates on[push, pull_request]. The step-levelwhenrepeats this. Thepublishstep's narrowerwhen(push + main) is the correct pattern for step-level filtering. Consider removing the redundantwhenfrom theteststep for clarity.2. Old duplicate comment lines removed -- good cleanup
The original
.woodpecker.ymlhad three identical# Woodpecker CI pipeline for forgejo-mcpcomment lines. The PR correctly reduces this to one. Noted as positive.3.
test_single_page_no_extra_callsusesreturn_valueinstead ofside_effect(test_set_label_pagination.pyline 60)The test uses
client.issue_list_labels.return_value = labelswhich means the mock returns the same list for every call, including the hypothetical second call that the code does NOT make. This still validates the assertion (call_count == 1) correctly, but usingside_effect = [labels]would be marginally more precise -- it would raiseStopIterationif a second call were accidentally made. Not blocking.4. Integration test in
test_label_comment_repo.pyline 29 still useslimit=100The renamed integration test file still has
forgejo_client.issue_list_labels(forgejo_username, repo_name, limit=100)for its own label setup. This is fine -- the integration test calls the SDK directly for test setup, not through the MCP tool. The MCP tool itself now paginates correctly. Just flagging for awareness that the integration test's setup code takes a different approach than the tool.SOP COMPLIANCE
11-epilogue-nits-pagination-test-rename-docreferences issue #11plan-pal-e-agencyreferencedCloses #11-- present at the bottom of the body.envfiles committed -- verified cleanASSESSMENT
Pagination fix is correct. The
while Trueloop withpage_size = 50andlen(batch) < page_sizebreak condition properly handles multi-page label sets. The four unit tests cover the key scenarios: multi-page success (150 labels), single-page optimization, label-not-found after full pagination, and empty repo.Test rename is clean.
test_new_tools.py->test_label_comment_repo.pywithsimilarity index 100%. No broken imports anywhere in the codebase.Documentation is accurate. Both docstrings and the README correctly explain the shared Forgejo API endpoint. The README tool list now reflects all 14 current tools.
CI step correctly installs
.[dev](which includes pytest + ruff perpyproject.toml), runs ruff lint and format checks on bothsrc/andtests/, then runs pytest. Uses a venv in/tmp/venvto avoid polluting the workspace.VERDICT: APPROVED