Skip to content

scaffolder-backend-module-regex - add search and extract functionality#8655

Draft
22367rh wants to merge 10 commits intobackstage:mainfrom
22367rh:scaffold-regex-search
Draft

scaffolder-backend-module-regex - add search and extract functionality#8655
22367rh wants to merge 10 commits intobackstage:mainfrom
22367rh:scaffold-regex-search

Conversation

@22367rh
Copy link
Copy Markdown
Contributor

@22367rh 22367rh commented Apr 19, 2026

Hey, I just made a Pull Request!

I have added the ability for scaffold actions to be able to process an array of objects in order to extract values using a provided regex search pattern from one of the properties and store the matches as a new property on each object in the array.

✔️ 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
  • All your commits have a Signed-off-by line in the message. (more info)

Signed-off-by: Robin Hilton <22367rh@gmail.com>
@backstage-goalie
Copy link
Copy Markdown
Contributor

Changed Packages

Package Name Package Path Changeset Bump Current Version
@backstage-community/plugin-scaffolder-backend-module-regex workspaces/scaffolder-backend-module-regex/plugins/regex-actions minor v2.15.0

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

Adds a new regex:search scaffolder action to the scaffolder-backend-module-regex package, enabling regex-based extraction of matches from a specified property across an array of JSON objects and returning enriched objects for downstream template steps.

Changes:

  • Registers a new regex:search action alongside the existing regex:replace action.
  • Implements regex:search action logic, examples, and Jest tests.
  • Updates package docs, API report, and adds a changeset for a minor release.

Reviewed changes

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

Show a summary per file
File Description
workspaces/scaffolder-backend-module-regex/plugins/regex-actions/src/module.ts Registers the new createSearchAction with the scaffolder extension point.
workspaces/scaffolder-backend-module-regex/plugins/regex-actions/src/actions/regex/search.ts Introduces the regex:search action schema + handler implementation.
workspaces/scaffolder-backend-module-regex/plugins/regex-actions/src/actions/regex/search.test.ts Adds unit tests for the new action behavior.
workspaces/scaffolder-backend-module-regex/plugins/regex-actions/src/actions/regex/search.example.ts Adds scaffolder YAML examples for regex:search.
workspaces/scaffolder-backend-module-regex/plugins/regex-actions/src/actions/regex/index.ts Exports createSearchAction from the regex actions barrel.
workspaces/scaffolder-backend-module-regex/plugins/regex-actions/report.api.md Updates API extractor output to include the new public export.
workspaces/scaffolder-backend-module-regex/plugins/regex-actions/README.md Documents the new action and its inputs/outputs.
workspaces/scaffolder-backend-module-regex/.changeset/smooth-cooks-vanish.md Declares a minor version bump for the added action.

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

22367rh added 3 commits April 20, 2026 11:11
Signed-off-by: Robin Hilton <22367rh@gmail.com>
Signed-off-by: Robin Hilton <22367rh@gmail.com>
Signed-off-by: Robin Hilton <22367rh@gmail.com>
Copy link
Copy Markdown
Member

@vinzscam vinzscam left a comment

Choose a reason for hiding this comment

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

What's the concrete scaffolder workflow that needs this? The examples (extracting emails from bios, chaining searches for domains) don't look related to scaffolder.

Scaffolder inputs are usually simple values from a form. If you already have an array of objects mid-template, it came from an upstream action, which should return data shaped correctly rather than needing regex post-processing downstream.

@22367rh
Copy link
Copy Markdown
Contributor Author

22367rh commented Apr 20, 2026

What's the concrete scaffolder workflow that needs this? The examples (extracting emails from bios, chaining searches for domains) don't look related to scaffolder.

Scaffolder inputs are usually simple values from a form. If you already have an array of objects mid-template, it came from an upstream action, which should return data shaped correctly rather than needing regex post-processing downstream.

My exact use case is to extra Jira Ids from the output of backstage/backstage#33939 which would be the upstream action in my real world scenario.

After which the modified object array will be used to trigger further steps downstream.

…ith the output of backstage/backstage#33939

Signed-off-by: Robin Hilton <22367rh@gmail.com>
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 3 comments.


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

Copilot AI review requested due to automatic review settings April 21, 2026 19:52
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 5 comments.


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

…ns/src/actions/regex/search.test.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Robin Hilton <22367rh@gmail.com>
Copilot AI review requested due to automatic review settings April 22, 2026 00:45
…ns/src/actions/regex/search.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Robin Hilton <22367rh@gmail.com>
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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Signed-off-by: Robin Hilton <22367rh@gmail.com>
@22367rh 22367rh marked this pull request as draft April 22, 2026 10:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants