Skip to content

feat(scaffolder): Allow filtering by status in scaffolderService.listTasks#33122

Merged
freben merged 5 commits intobackstage:masterfrom
johnmcollier:filterstatustasks
Apr 22, 2026
Merged

feat(scaffolder): Allow filtering by status in scaffolderService.listTasks#33122
freben merged 5 commits intobackstage:masterfrom
johnmcollier:filterstatustasks

Conversation

@johnmcollier
Copy link
Copy Markdown
Contributor

Minor follow up PR for #32989

This PR adds an optional status filter to ScaffolderService.listTasks, by exposing the status query parameter already present on the scaffolder API, allowing callers to retrieve tasks of a specific status. I've also updated the list-scaffolder-tasks action accordingly to support this filter.

Hey, I just made a Pull Request!

✔️ Checklist

  • A changeset describing the change and affected packages. (more info)
  • Added or updated documentation
  • Tests for new functionality and regression tests for bug fixes
  • Screenshots attached (for UI changes)
  • All your commits have a Signed-off-by line in the message. (more info)

…sks.

Added optional `status` filter to `ScaffolderService.listTasks`, by exposing the `status` query parameter,  allowing callers to retrieve tasks of a specific status. Also updated the `list-scaffolder-tasks` action to support this parameter.

Signed-off-by: John Collier <jcollier@redhat.com>
@johnmcollier johnmcollier requested review from a team as code owners March 4, 2026 21:28
Copilot AI review requested due to automatic review settings March 4, 2026 21:28
@github-actions github-actions Bot added the area:scaffolder Everything and all things related to the scaffolder project area label Mar 4, 2026
@backstage-goalie
Copy link
Copy Markdown
Contributor

Important

This PR includes changes that affect public-facing API. Please ensure you are adding/updating documentation for new features or behavior.

Changed Packages

Package Name Package Path Changeset Bump Current Version
@backstage/plugin-scaffolder-backend plugins/scaffolder-backend minor v3.2.0-next.1
@backstage/plugin-scaffolder-node plugins/scaffolder-node minor v0.13.0-next.1

@backstage-goalie backstage-goalie Bot added size:medium Medium-sized pull requests receive no change in priority for reviews. waiting-for:review The PR needs a review and will be visible in the review queue unless already assigned an owner. labels Mar 4, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 exposes the existing scaffolder /v2/tasks status query parameter through ScaffolderService.listTasks, and wires that new filter into the list-scaffolder-tasks backend action (including tests and changesets).

Changes:

  • Add optional status filter support to ScaffolderService.listTasks and propagate it as a query param.
  • Extend list-scaffolder-tasks action input schema to accept status and pass it through to the service.
  • Add/adjust unit tests and add changesets for the affected packages.

Reviewed changes

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

Show a summary per file
File Description
plugins/scaffolder-node/src/scaffolderService.ts Adds status to the service request and includes it in the /v2/tasks query string.
plugins/scaffolder-backend/src/actions/listScaffolderTasksAction.ts Adds status to the action input schema and passes it to scaffolderService.listTasks.
plugins/scaffolder-backend/src/actions/listScaffolderTasksAction.test.ts Updates expectations and adds a test covering the new status filter pass-through.
.changeset/gold-friends-end.md Changeset for @backstage/plugin-scaffolder-node documenting the new filter option.
.changeset/fifty-clubs-play.md Changeset for @backstage/plugin-scaffolder-backend documenting the action update (contains a small typo).

Comment thread plugins/scaffolder-node/src/scaffolderService.ts
Comment thread plugins/scaffolder-node/src/scaffolderService.ts Outdated
Comment thread plugins/scaffolder-backend/src/actions/listScaffolderTasksAction.ts Outdated
Comment thread .changeset/fifty-clubs-play.md Outdated
Signed-off-by: John Collier <jcollier@redhat.com>
@johnmcollier johnmcollier changed the title feat(scaffolder): Allow sorting by status in scaffolderService.listTasks feat(scaffolder): Allow filtering by status in scaffolderService.listTasks Mar 5, 2026
Signed-off-by: John Collier <jcollier@redhat.com>
Copilot AI review requested due to automatic review settings March 5, 2026 04:00
.min(0)
.describe('The offset to start from for pagination')
.optional(),
status: z
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I wanted to pass in the ScaffolderTaskStatus enum into the zod schema for the action, but it didn't seem to be supported, so I ended up needing to hard code the statuses here. Not sure if there's a better way to handle this?

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.

Comment thread plugins/scaffolder-node/src/scaffolderService.ts
Comment thread plugins/scaffolder-backend/src/actions/listScaffolderTasksAction.ts Outdated
Comment thread plugins/scaffolder-backend/src/actions/listScaffolderTasksAction.ts Outdated
@drodil
Copy link
Copy Markdown
Contributor

drodil commented Mar 5, 2026

This is great! But should we also add the status filter to the scaffolder UI? Please review the Copilot comments; they actually make some sense.

@johnmcollier
Copy link
Copy Markdown
Contributor Author

johnmcollier commented Mar 5, 2026

@drodil As far as I'm aware, ScaffolderService is only used in the backend, I believe the frontend for listing tasks goes through a different API than the API that's being extended in this PR.

I'll take a look at remaining Copilot comments

Signed-off-by: John Collier <jcollier@redhat.com>
@drodil
Copy link
Copy Markdown
Contributor

drodil commented Mar 5, 2026

@johnmcollier yep that is true, but the service is calling the scaffolder backend router and support for status filtering is not there (TaskBroker list and backend router) (afaik, on phone so hard to check). That's why the scaffolder backend needs support for this filtering as well and while doing that, it would make sense to add the frontend support as well.

Edit: I was wrong, it's here: https://github.com/backstage/backstage/blob/master/plugins%2Fscaffolder-backend%2Fsrc%2Fservice%2Frouter.ts#L626 so never mind, carry on 😁

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 6, 2026

This PR has been automatically marked as stale because it has not had recent activity from the author. It will be closed if no further activity occurs. If the PR was closed and you want it re-opened, let us know and we'll re-open the PR so that you can continue the contribution!

@github-actions github-actions Bot added the stale label Apr 6, 2026
@johnmcollier
Copy link
Copy Markdown
Contributor Author

Not stale

@github-actions github-actions Bot removed the stale label Apr 8, 2026
Comment thread .changeset/gold-friends-end.md Outdated
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
Copilot AI review requested due to automatic review settings April 22, 2026 08:27
@freben freben merged commit 8521de1 into backstage:master Apr 22, 2026
18 of 19 checks passed
@backstage-goalie backstage-goalie Bot removed the waiting-for:review The PR needs a review and will be visible in the review queue unless already assigned an owner. label Apr 22, 2026
@backstage-goalie backstage-goalie Bot added the waiting-for:merge The PR has been approved and is awaiting merge. label Apr 22, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Thank you for contributing to Backstage! The changes in this pull request will be part of the 1.51.0 release, scheduled for Tue, 19 May 2026.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:scaffolder Everything and all things related to the scaffolder project area size:medium Medium-sized pull requests receive no change in priority for reviews. waiting-for:merge The PR has been approved and is awaiting merge.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants