feat: add status filter (CM-1236)#4233
Merged
Merged
Conversation
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Contributor
There was a problem hiding this comment.
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 inpackageScatterHandler. - Updated
listPackagesForScatterin the data-access layer to apply a status-dependent SQL filter (including special handling forunassigned). - Exported
STEWARDSHIP_STATUS_VALUESfrom 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.
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
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
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_VALUESis exported from package types and reused for scatter validation and the existing packages list query schema (replacing a duplicate local enum).listPackagesForScatteraccepts{ status }and applies a WHERE clause aligned with package list behavior:unassignedincludes packages with no stewardship row or explicit unassigned status; other values filter ons.status. Omittingstatusleaves scatter results unchanged.Reviewed by Cursor Bugbot for commit 9acdff2. Bugbot is set up for automated code reviews on this repo. Configure here.