fix: remove redundant CI when clause + use side_effect in pagination test #14
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!14
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "13-epilogue-nits-ci-when-test-style"
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
Remove redundant step-level
whenfilter from CI test step and switch pagination test mock fromreturn_valuetoside_effectfor stricter enforcement and consistency.Changes
.woodpecker.yml-- Removed the step-levelwhen: event: [push, pull_request]on the test step. The pipeline-levelwhen(line 2-3) already restricts all steps to these events, making the step-level filter redundant.tests/test_set_label_pagination.py-- Changedtest_single_page_no_extra_callsto useside_effect=[labels]instead ofreturn_value=labels. This is semantically superior:side_effectwith a list raisesStopIterationif the mock is called more times than expected, enforcing the single-call assertion. Also consistent with the other three tests in the same class.Test Plan
pytest tests/ -v-- all 4 unit tests pass, 8 integration tests skip (expected without creds)ruff checkandruff format --checkboth passReview Checklist
whenclause removed from test step in .woodpecker.ymlside_effectfor semantic correctnesslimit=100nit reviewed -- integration tests only, not actionable (skipped per issue guidance)Related
plan-pal-e-agency(traceability)Self-Review: PASS
Diff reviewed: 2 files, +2/-4 lines.
.woodpecker.yml-- Redundant step-levelwhenremoved. Pipeline-levelwhenstill governs. Publish step retains its ownwhen(branch filter), which is distinct and necessary. Correct.tests/test_set_label_pagination.py--return_valuechanged toside_effect=[labels]. Wrapping in a list is correct: first call returns the full labels list, extra calls raiseStopIteration. Consistent with other pagination tests in the class.Tests: 4/4 unit tests pass. 8 integration tests skip (expected). Ruff clean.
No findings. Ready for merge review.
PR #14 Review
BLOCKERS
None.
NITS
test_empty_repo_labelsstill usesreturn_value(line 101 oftest_set_label_pagination.py). The PR description says the change makestest_single_page_no_extra_calls"consistent with the other three tests in the same class," buttest_empty_repo_labelsstill usesreturn_value = []rather thanside_effect. This is defensible (the empty list triggers theif not batch: breakpath on the first call, soside_effectadds no enforcement value there), but the consistency claim in the PR description is slightly overstated. Non-blocking -- the existing code is correct.SOP COMPLIANCE
13-epilogue-nits-ci-when-test-stylereferences issue #13)plan-pal-e-agency)Closes #13present in PR bodyCode Review Notes
.woodpecker.yml: The pipeline-levelwhen(line 2-3) already restricts all steps to[push, pull_request]. The removed step-levelwhenwas genuinely redundant. The publish step'swhen(push + main) is correctly preserved since it adds branch filtering.test_set_label_pagination.py:side_effect=[labels]is semantically correct. It exhausts the list after one call, so a second call toissue_list_labelswould raiseStopIteration-- stricter enforcement of the "single call" assertion on line 72. The comment update is accurate.VERDICT: APPROVED