Skip to content

feat: add status filter (CM-1236)#4233

Merged
ulemons merged 1 commit into
mainfrom
feat/filter-scatter-by-status
Jun 18, 2026
Merged

feat: add status filter (CM-1236)#4233
ulemons merged 1 commit into
mainfrom
feat/filter-scatter-by-status

Conversation

@ulemons

@ulemons ulemons commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds an optional ?status= filter to GET /api/v1/akrites/packages/scatter, allowing the OSSPREY Risk Matrix UI to request scatter points filtered by stewardship status server-side. When called without the parameter, behavior is identical to before.

Type of change

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

JIRA-1236


Note

Low Risk
Backward-compatible read-only query change that mirrors existing list-packages status filtering; no auth or write-path changes.

Overview
Adds an optional ?status= query parameter to the package scatter endpoint so the Risk Matrix can load points filtered by stewardship status on the server instead of client-side.

STEWARDSHIP_STATUS_VALUES is exported from package types and reused for scatter validation and the existing packages list query schema (replacing a duplicate local enum). listPackagesForScatter accepts { status } and applies a WHERE clause aligned with package list behavior: unassigned includes packages with no stewardship row or explicit unassigned status; other values filter on s.status. Omitting status leaves scatter results unchanged.

Reviewed by Cursor Bugbot for commit 9acdff2. 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 18, 2026
Copilot AI review requested due to automatic review settings June 18, 2026 12:33
@ulemons ulemons changed the title feat: add status filter feat: add status filter (CM-1236) Jun 18, 2026

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

Adds server-side stewardship status filtering to the packages scatter endpoint used by the OSSPREY Risk Matrix, while centralizing the stewardship status enum values for reuse in request validation.

Changes:

  • Added optional ?status= validation and forwarding in packageScatterHandler.
  • Updated listPackagesForScatter in the data-access layer to apply a status-dependent SQL filter (including special handling for unassigned).
  • Exported STEWARDSHIP_STATUS_VALUES from package types and reused it in the packages list query schema.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
services/libs/data-access-layer/src/osspckgs/api.ts Adds an optional status filter to the scatter query in the DAL.
backend/src/api/public/v1/packages/types.ts Introduces STEWARDSHIP_STATUS_VALUES as the single source of truth for status values.
backend/src/api/public/v1/packages/listPackages.ts Reuses STEWARDSHIP_STATUS_VALUES in the list endpoint query validation schema.
backend/src/api/public/v1/ossprey/packageScatter.ts Adds Zod validation for ?status= and passes it through to the DAL scatter query.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread services/libs/data-access-layer/src/osspckgs/api.ts
Comment thread backend/src/api/public/v1/ossprey/packageScatter.ts
@ulemons
ulemons merged commit 8239f9d into main Jun 18, 2026
22 checks passed
@ulemons
ulemons deleted the feat/filter-scatter-by-status branch June 18, 2026 12:43
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