backstage icon indicating copy to clipboard operation
backstage copied to clipboard

Split search backend plugin initialization into build and start phases

Open brianphillips opened this issue 9 months ago • 2 comments

Hey, I just made a Pull Request!

As discussed over in #24794, the backend search plugin needs to have two phases during initialization: build and start.

The build phase is synchronous and ensures that the searchIndexService state is initialized before creating the HTTP router. This "build" phase is necessary to ensure the collators are all added to the searchIndexService object before trying to use that list of document types within the zod request schema that is used to validate incoming requests. Prior to this change, the set of types would be empty at initialization time and incoming requests would be rejected due to validation errors.

:heavy_check_mark: Checklist

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

brianphillips avatar May 15 '24 16:05 brianphillips

Changed Packages

Package Name Package Path Changeset Bump Current Version
@backstage/plugin-search-backend-node plugins/search-backend-node patch v1.2.22
@backstage/plugin-search-backend plugins/search-backend patch v1.5.8

backstage-goalie[bot] avatar May 15 '24 16:05 backstage-goalie[bot]

Tested this locally, and works. Also the code looks like what I expected.

CC @drodil @freben

PS: The PR state is weird? No reviewers assigned, no uffizi? Haven't looked at PRs in a bit, no idea if that's normal these days.

Pike avatar May 15 '24 17:05 Pike

Thank you for contributing to Backstage! The changes in this pull request will be part of the 1.28.0 release, scheduled for Tue, 18 Jun 2024.

github-actions[bot] avatar May 16 '24 14:05 github-actions[bot]

Uffizzi Cluster pr-24796 was deleted.

github-actions[bot] avatar May 16 '24 14:05 github-actions[bot]