Skip to content

feat: add status filter as array (CM-1236)#4235

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

feat: add status filter as array (CM-1236)#4235
ulemons merged 1 commit into
mainfrom
feat/filter-by-array-of-status

Conversation

@ulemons

@ulemons ulemons commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Summary

filter status by array

Type of change

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

Note

Low Risk
Read-only scatter query filtering in a public API; single-value queries still work via normalization.

Overview
The package scatter endpoint now accepts multiple stewardship statuses in one request instead of a single status value.

Query parsing adds normalizeToArray, so clients can pass repeated params, a comma-separated string, or a lone value; validation requires a non-empty array of known status enums when status is present. listPackagesForScatter builds a s.status = ANY(...) filter and still treats unassigned as including packages with no stewardship row (s.id IS NULL) when that value is in the list.

Reviewed by Cursor Bugbot for commit 37d80d9. 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 14:38

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 the OSSPREY “package scatter” public API to accept multiple stewardship statuses in a single request (while preserving compatibility for single status values by normalizing them to an array). The status filtering is implemented end-to-end: request validation/normalization in the API handler and array-based filtering in the data-access query.

Changes:

  • Update scatter query parsing to normalize status into an array (supports repeated params and comma-separated values) and validate against the known stewardship status enum.
  • Update listPackagesForScatter to accept status?: string[] and apply the filter via s.status = ANY($(status)::text[]), while keeping the special unassigned behavior to include s.id IS NULL.

Reviewed changes

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

File Description
services/libs/data-access-layer/src/osspckgs/api.ts Changes scatter query filtering from single status to status[] using ANY(...), preserving unassigned semantics.
backend/src/api/public/v1/ossprey/packageScatter.ts Adds normalizeToArray + Zod preprocessing so the public endpoint accepts multiple statuses reliably and validates them.

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

@ulemons
ulemons merged commit f99df6a into main Jun 18, 2026
20 checks passed
@ulemons
ulemons deleted the feat/filter-by-array-of-status branch June 18, 2026 14:47
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