Skip to content

test: record a TeamIteration clear on a team-only child under a scheduled parent - #27

Merged
man8 merged 2 commits into
mainfrom
record-teamiteration-clear-team-only-child
Oct 6, 2026
Merged

man8 merged 2 commits into
mainfrom
record-teamiteration-clear-team-only-child

Conversation

@man8

@man8 man8 commented Oct 6, 2026 •

Copy link
Copy Markdown
Owner

Summary

Records the TeamIteration configuration the existing cascade cassette left open, and asserts what TargetProcess did with it. The parent UserStory is scheduled into its team's sprint. The child Task is created with the same Team and no TeamIteration key at all, so any sprint the child shows can only have come from the parent.

What the recording shows:

  • The child inherited the parent's sprint at creation. The create echo already carries it, and the read that follows does too.
  • The explicit null landed. clear_team_iteration returned the verifying re-read instead of raising TeamIterationCascadeError. An independent re-read afterwards carries "TeamIteration": null, with the key present and null. The test asserts that through the model's set fields, so the "a field the re-read does not carry counts as cleared" lenience is not what passed it.

No issue on this repository tracks this; the recording is evidence for a design question about the documented cascade, which this pull request deliberately does not settle.

Changes

  • tests/integration/test_live_readwrite.py: test_clear_team_iteration_lands_on_a_team_only_child_that_inherited_the_parent_sprint, plus a small _read_after_delete helper. Every observation is captured first: the create echo, the read before, the clear's outcome (returned or raised), the read after, and both delete re-reads. Assertions run only once the cleanup is recorded, so an unexpected outcome cannot cut a recorded run short.
  • tests/integration/cassettes/test_live_readwrite/test_clear_team_iteration_lands_on_a_team_only_child_that_inherited_the_parent_sprint.yaml: the recording, 13 interactions, written by the conftest hooks and not hand-edited. Entity Ids are kept as recorded, per the cassette convention.

Testing

  • uv run ruff check ., uv run ruff format --check .: pass.
  • uv run mypy --strict src: pass.
  • uv run pytest -q --cov=targetprocess_py --cov-fail-under=90, offline: 1507 passed, 99.17% coverage.
  • uv run pre-commit run --all-files at both the pre-commit and pre-push stages: pass.
  • scripts/check_internal_refs.py: pass. jscpd: no clone involving the changed file.
  • Redaction scan of the new cassette:
    • zero occurrences of each of these: the recording host other than the placeholder, the token, authorization, cookie, and any access_token value other than REDACTED;
    • all 72 identity fields are Sanitised <Field> placeholders.
  • The record run deleted both entities it created, and each delete is verified by a recorded 404 re-read.

Context

  • Supersedes test: record a TeamIteration clear on a team-only child under a scheduled parent #25, re-opened from the same branch so it can take a review.
  • Deliberately unchanged: TeamIterationCascadeError, its docstring, SPEC.md and docs/USAGE.md. Together with the existing cassette, this recording means neither configuration tried has reproduced the documented cascade. Whether that narrows the documented behaviour is a design decision this test does not make.
  • Re-recording needs a team linked to the sandbox project, as for the existing cascade test.

Checklist

  • uv run ruff check . and uv run ruff format --check . pass
  • uv run mypy --strict src passes
  • uv run pytest -q passes and coverage stays at or above 90%
  • uv run pre-commit run --all-files --hook-stage pre-commit passes
  • uv run pre-commit run --all-files --hook-stage pre-push passes
  • New public functions, methods, and classes have docstrings
  • No real credentials, tokens, or PII are added to the diff
  • TODO/FIXME/HACK/XXX markers name an issue (e.g. TODO(#123))

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Tests
    • Added integration coverage for tasks created under scheduled stories, including inherited iteration details, clearing the iteration, and verifying the cleared state across reads.
    • Added checks confirming the task and story are deleted successfully, and that later requests for them return not found.

man8-octoflow Bot and others added 2 commits October 6, 2026 13:56
…uled parent

Records the configuration the existing TeamIteration cassette left open: a
parent UserStory scheduled into its team's sprint, and a child Task created
with the same Team but no TeamIteration key at all.

TargetProcess gave the child the parent's sprint at creation - the create
echo already carries it - and then honoured the explicit null:
clear_team_iteration returned the verifying re-read instead of raising, and
an independent re-read carries the TeamIteration key present and null.

The test captures every observation and records the cleanup and both 404
re-reads before asserting anything, so an unexpected outcome cannot cut a
recorded run short. Library, SPEC.md and docs are unchanged.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: man8/targetprocess-py/.coderabbit.yaml
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 0c2766d5-c464-404f-be47-6664d2f91a2e
📥 Commits

Reviewing files that changed from the base of the PR and between 6de1b5a and 5d679d1.

📒 Files selected for processing (2)
  • tests/integration/cassettes/test_live_readwrite/test_clear_team_iteration_lands_on_a_team_only_child_that_inherited_the_parent_sprint.yaml
  • tests/integration/test_live_readwrite.py

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The integration suite adds a test that clears a child Task’s inherited TeamIteration. It checks the clear result, subsequent reads and deletion responses. A cassette records the related HTTP requests.

Changes

Team iteration clearing

Layer / File(s) Summary
Clear and verify inherited TeamIteration
tests/integration/test_live_readwrite.py, tests/integration/cassettes/test_live_readwrite/test_clear_team_iteration_lands_on_a_team_only_child_that_inherited_the_parent_sprint.yaml
The test creates a scheduled parent UserStory and a team-only child Task. It checks sprint inheritance, clearing the TeamIteration, subsequent reads, and NotFoundError after deletion. The cassette records the corresponding HTTP interactions.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Other

Merge Risk: ⚪ Minimal · up to 5d679

The new test records the team-only child scenario, and no actionable issue remains that should delay merging.

🚥 Pre-merge checks | ✅ 7
✅ Passed checks (7 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely identifies the recorded TeamIteration-clear scenario.
Description check ✅ Passed The description includes the required sections, explains that no issue tracks this work, reports testing, and marks every checklist item complete.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Docstring Coverage (Non-Test) ✅ Passed The PR changes only two files under tests/integration/: a cassette and test_live_readwrite.py. The custom check excludes test-directory code and YAML. Therefore, no in-scope public Python or JS/TS…
Checklist Complete ✅ Passed The PR description contains one gating task list, under “Checklist”. All eight items are ticked with [x]. No post-merge or post-deploy section is present, and no unticked items remain.
No Committed Superpowers Artefacts ✅ Passed The pull request adds a cassette under tests/integration/cassettes/ and modifies tests/integration/test_live_readwrite.py. The added-file check found no new files under docs/superpowers/ or `doc…
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
✨ Simplify code
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@man8

man8 commented Oct 6, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@man8
man8 merged commit ae756fb into main Oct 6, 2026
16 checks passed
@man8
man8 deleted the record-teamiteration-clear-team-only-child branch October 6, 2026 14:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant