Skip to content

[OBT-419] Project phase listings return the full journey phase set - #135

Open
levigtri wants to merge 1 commit into
levigft/obt-418-us-201-backend-journeys-phase-categories-and-per-projectfrom
levigft/obt-419-backend-project-phase-listings-must-return-the-projects-full
Open

[OBT-419] Project phase listings return the full journey phase set#135
levigtri wants to merge 1 commit into
levigft/obt-418-us-201-backend-journeys-phase-categories-and-per-projectfrom
levigft/obt-419-backend-project-phase-listings-must-return-the-projects-full

Conversation

@levigtri

@levigtri levigtri commented Aug 2, 2026

Copy link
Copy Markdown
Member

Summary

  • GET /api/projects/{id}/phases, GET /api/projects/{id}/phases-with-deps and GET /api/phases?project_id= selected only project_phases rows, which under the journeys semantics (OBT-418) are upserted on the first status change — so phases the platform admin registered on the journey but never touched simply vanished from per-project listings (map popup, console phase lists), and recorded statuses looked incomplete.
  • list_project_phases_with_details now resolves the project's journey and returns its full phase set (ordered by sort_order, then created_at), left-joining project_phases so untouched phases report not_started while recorded statuses are preserved.
  • list_project_phases_with_deps reuses that listing and builds the dependency map over the full set.
  • list_phases(project_id=...) resolves through the project's journey the same way.
  • Projects with journey_id = NULL keep the legacy behavior (attached rows only).

Closes OBT-419. Stacked on #132 (OBT-418) — base is that branch, not main.

Test plan

  • New tests/test_journeys/test_project_phase_listing_api.py: full journey set with not_started defaults, statuses preserved for touched phases, deps map over the full set, no-journey fallback, GET /phases?project_id= resolving through the journey.
  • Existing suites re-run per-file: tests/test_journeys/*, tests/test_phase_service.py.
  • ruff check, ruff format --check and mypy clean on the touched files.

🤖 Generated with Claude Code

GET /projects/{id}/phases, /phases-with-deps and GET /phases?project_id=
selected only project_phases rows, which are upserted on the first status
change, so untouched phases vanished from per-project listings. Resolve
the project's journey and return its full phase set with statuses
defaulting to not_started; projects without a journey keep the attached
rows.

Co-Authored-By: Claude Fable 5 <[email protected]>
@linear-code

linear-code Bot commented Aug 2, 2026

Copy link
Copy Markdown

OBT-419

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