Skip to content

fix: add resolution path#4215

Open
ulemons wants to merge 1 commit into
feat/steward-admin-actions-apifrom
feat/resolution-path-status-note
Open

fix: add resolution path#4215
ulemons wants to merge 1 commit into
feat/steward-admin-actions-apifrom
feat/resolution-path-status-note

Conversation

@ulemons

@ulemons ulemons commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Summary

Changes

Type of change

  • Bug fix
  • New feature
  • Refactor / cleanup
  • Performance improvement
  • Chore / dependency update
  • Documentation

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_path and status_note on stewardships (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 writes status_note and clears resolution_path; open for stewardship clears both and now always resets opened_at to the current time on re-open.

GET package detail returns stewardship.resolutionPath and stewardship.statusNote from 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.

Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
@ulemons ulemons self-assigned this Jun 15, 2026
Copilot AI review requested due to automatic review settings June 15, 2026 15:25

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_path and status_note columns to stewardships and expose them in DAL record mappings and queries.
  • Populate/clear these fields during escalateStewardship, updateStewardshipStatus, and openStewardshipByPurl.
  • Surface the new fields via getPackageDetailByPurl and 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.

Comment on lines 158 to 162
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,
Comment on lines 366 to +370
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),
Comment on lines +440 to +444
resolutionPath:
type:
- string
- 'null'
description: Set on `escalated` status. Null for all other statuses.
@ulemons ulemons marked this pull request as ready for review June 15, 2026 16:07
@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Jira Issue Key Missing

Your PR title doesn't contain a Jira issue key. Consider adding it for better traceability.

Example:

  • feat: add user authentication (CM-123)
  • feat: add user authentication (IN-123)

Projects:

  • CM: Community Data Platform
  • IN: Insights

Please add a Jira issue key to your PR title.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 3 potential issues.

Fix All in Cursor

❌ 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,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Fix in Cursor Fix in Web

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(),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Fix in Cursor Fix in Web

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,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 23eb372. Configure here.

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.

2 participants