BE-PR-010: deprecate feat_task_id — retain column, read-only compat
- Updated model docstring with full deprecation strategy - Updated column comment to mark as deprecated (BE-PR-010) - Updated schema/router comments for deprecation clarity - Added deprecation doc: docs/BE-PR-010-feat-task-id-deprecation.md - feat_task_id superseded by Task.source_proposal_id (BE-PR-008)
This commit is contained in:
62
docs/BE-PR-010-feat-task-id-deprecation.md
Normal file
62
docs/BE-PR-010-feat-task-id-deprecation.md
Normal file
@@ -0,0 +1,62 @@
|
||||
# BE-PR-010: `feat_task_id` Deprecation & Compatibility Strategy
|
||||
|
||||
> Date: 2026-03-30
|
||||
|
||||
## Background
|
||||
|
||||
The `feat_task_id` column on the `proposes` table was used by the **old** Proposal
|
||||
Accept flow to store the ID of the single `story/feature` task generated when a
|
||||
Proposal was accepted.
|
||||
|
||||
With the new Essential-based Accept flow (BE-PR-007 / BE-PR-008), accepting a
|
||||
Proposal now generates **multiple** story tasks (one per Essential), tracked via:
|
||||
- `Task.source_proposal_id` → FK back to the Proposal
|
||||
- `Task.source_essential_id` → FK back to the specific Essential
|
||||
|
||||
This makes `feat_task_id` obsolete.
|
||||
|
||||
## Decision: Retain Column, Deprecate Semantics
|
||||
|
||||
| Aspect | Decision |
|
||||
|--------|----------|
|
||||
| DB column | **Retained** — no schema migration required now |
|
||||
| Existing data | Legacy rows with a non-NULL `feat_task_id` continue to expose the value via API |
|
||||
| New writes | **Prohibited** — new accept flow does NOT write `feat_task_id` |
|
||||
| API response | Field still present in `ProposalResponse` for backward compat |
|
||||
| Client guidance | Use `generated_tasks` on the Proposal detail endpoint instead |
|
||||
| Future removal | Column will be dropped in a future migration once all clients have migrated |
|
||||
|
||||
## Read Compatibility
|
||||
|
||||
- `GET /projects/{id}/proposals` — returns `feat_task_id` (may be `null`)
|
||||
- `GET /projects/{id}/proposals/{id}` — returns `feat_task_id` + `generated_tasks[]`
|
||||
- `PATCH /projects/{id}/proposals/{id}` — `feat_task_id` in request body is silently ignored
|
||||
|
||||
## Migration Path for Clients
|
||||
|
||||
### Backend consumers
|
||||
Use `Proposal.generated_tasks` relationship (or query `Task` by `source_proposal_id`).
|
||||
|
||||
### Frontend
|
||||
Replace `propose.feat_task_id` references with the `generated_tasks` array from
|
||||
the detail endpoint. The detail page should list all generated tasks, not just one.
|
||||
|
||||
### CLI
|
||||
CLI does not reference `feat_task_id`. No changes needed.
|
||||
|
||||
## Files Changed
|
||||
|
||||
| File | Change |
|
||||
|------|--------|
|
||||
| `app/models/proposal.py` | Updated docstring & column comment with deprecation notice |
|
||||
| `app/schemas/schemas.py` | Marked `feat_task_id` field as deprecated |
|
||||
| `app/api/routers/proposals.py` | Updated comments; field still serialized read-only |
|
||||
| `tests/test_propose.py` | Updated accept tests to assert `feat_task_id is None` |
|
||||
|
||||
## Frontend References (to be updated in FE-PR-002+)
|
||||
|
||||
- `src/types/index.ts:139` — `feat_task_id: string | null`
|
||||
- `src/pages/ProposeDetailPage.tsx:145,180-181` — displays feat_task_id
|
||||
- `src/pages/ProposesPage.tsx:83` — displays feat_task_id in list
|
||||
|
||||
These will be addressed when the frontend Proposal/Essential tasks are implemented.
|
||||
Reference in New Issue
Block a user