fix: add resolution path#4215
Conversation
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
There was a problem hiding this comment.
Pull request overview
This PR extends OSSPREY stewardship data to include a persisted escalation resolutionPath and a free-text statusNote, wiring them through the DB schema, data-access layer queries, and the public OpenAPI + package detail response shape.
Changes:
- Add
resolution_pathandstatus_notecolumns tostewardshipsand expose them in DAL record mappings and queries. - Populate/clear these fields during
escalateStewardship,updateStewardshipStatus, andopenStewardshipByPurl. - Surface the new fields via
getPackageDetailByPurland include them in the public packages API response + OpenAPI specs.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| services/libs/data-access-layer/src/osspckgs/stewardships.ts | Adds new fields to stewardship records and updates open/escalate/update-status SQL to write/read them. |
| services/libs/data-access-layer/src/osspckgs/api.ts | Includes stewardship resolution_path / status_note in package detail query output. |
| backend/src/osspckgs/migrations/V1781300000__stewardship-status-path-note.sql | Adds the new columns to the stewardships table. |
| backend/src/api/public/v1/stewardships/openapi.yaml | Documents resolutionPath and statusNote, and makes steward name nullable. |
| backend/src/api/public/v1/packages/openapi.yaml | Documents new stewardship fields in package detail and updates steward schema to allow nullable name. |
| backend/src/api/public/v1/packages/getPackage.ts | Returns resolutionPath and statusNote in the package response payload. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| ON CONFLICT (package_id) DO UPDATE | ||
| SET status = 'open', | ||
| opened_at = COALESCE(stewardships.opened_at, NOW()), | ||
| opened_at = NOW(), | ||
| last_status_at = NOW(), | ||
| inactive_reason = NULL, |
| SET status = $(status), | ||
| last_status_at = NOW(), | ||
| inactive_reason = CASE WHEN $(status) = 'inactive' THEN $(inactiveReason) ELSE NULL END, | ||
| inactive_reason = CASE WHEN $(status) = 'inactive' THEN $(inactiveReason) ELSE inactive_reason END, | ||
| resolution_path = NULL, | ||
| status_note = $(statusNote), |
| resolutionPath: | ||
| type: | ||
| - string | ||
| - 'null' | ||
| description: Set on `escalated` status. Null for all other statuses. |
|
Your PR title doesn't contain a Jira issue key. Consider adding it for better traceability. Example:
Projects:
Please add a Jira issue key to your PR title. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 3 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 23eb372. Configure here.
| stewardshipId, | ||
| status: data.status, | ||
| inactiveReason: data.inactiveReason ?? null, | ||
| statusNote: data.notes ?? null, |
There was a problem hiding this comment.
Status note cleared without notes
Medium Severity
In updateStewardshipStatus, status_note is always set from optional notes, so a status change without notes writes NULL and removes an existing note (e.g. after escalate).
Reviewed by Cursor Bugbot for commit 23eb372. Configure here.
| ON CONFLICT (package_id) DO UPDATE | ||
| SET status = 'open', | ||
| opened_at = COALESCE(stewardships.opened_at, NOW()), | ||
| opened_at = NOW(), |
There was a problem hiding this comment.
Reopen resets original opened_at
Medium Severity
The stewardship upsert now sets opened_at to NOW() on conflict instead of keeping the first open time, so reopening or repeated open calls overwrite when the package was originally opened.
Reviewed by Cursor Bugbot for commit 23eb372. Configure here.
| SET status = $(status), | ||
| last_status_at = NOW(), | ||
| inactive_reason = CASE WHEN $(status) = 'inactive' THEN $(inactiveReason) ELSE NULL END, | ||
| inactive_reason = CASE WHEN $(status) = 'inactive' THEN $(inactiveReason) ELSE inactive_reason END, |
There was a problem hiding this comment.
Inactive reason kept after reactivation
Medium Severity
updateStewardshipStatus leaves inactive_reason unchanged when the new status is not inactive, so moving back to active can still return a stale inactive reason on a non-inactive stewardship.
Reviewed by Cursor Bugbot for commit 23eb372. Configure here.


Summary
Changes
Type of change
JIRA ticket
Note
Medium Risk
Schema migration and stewardship state-transition semantics changed (re-open resets opened_at; inactive_reason preserved when leaving inactive). API contract updates are additive but affect clients reading stewardship data.
Overview
Adds
resolution_pathandstatus_noteonstewardships(migration + DAL) so escalation resolution paths and free-text notes are stored on the row, not only in activity metadata. Escalate sets both; update status writesstatus_noteand clearsresolution_path; open for stewardship clears both and now always resetsopened_atto the current time on re-open.GET package detail returns
stewardship.resolutionPathandstewardship.statusNotefrom the package detail query. Public OpenAPI is updated for those fields, drops “always unassigned in v1” stewardship copy, and aligns Steward / StewardRecord with optional nullable name and Auth0 userId docs.Reviewed by Cursor Bugbot for commit 23eb372. Bugbot is set up for automated code reviews on this repo. Configure here.