[OBT-419] Project phase listings return the full journey phase set - #135
Conversation
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]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
GET /api/projects/{id}/phases,GET /api/projects/{id}/phases-with-depsandGET /api/phases?project_id=selected onlyproject_phasesrows, 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_detailsnow resolves the project's journey and returns its full phase set (ordered bysort_order, thencreated_at), left-joiningproject_phasesso untouched phases reportnot_startedwhile recorded statuses are preserved.list_project_phases_with_depsreuses that listing and builds the dependency map over the full set.list_phases(project_id=...)resolves through the project's journey the same way.journey_id = NULLkeep the legacy behavior (attached rows only).Closes OBT-419. Stacked on #132 (OBT-418) — base is that branch, not
main.Test plan
tests/test_journeys/test_project_phase_listing_api.py: full journey set withnot_starteddefaults, statuses preserved for touched phases, deps map over the full set, no-journey fallback,GET /phases?project_id=resolving through the journey.tests/test_journeys/*,tests/test_phase_service.py.ruff check,ruff format --checkandmypyclean on the touched files.🤖 Generated with Claude Code