-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Split search backend plugin initialization into init and start phases #24796
Split search backend plugin initialization into init and start phases #24796
Conversation
Fixes backstage#24794. The build process takes place synchronously to the plugin initialization rather than at startup so that the HTTP router has the relevant types available to validate incoming requests. Signed-off-by: Brian Phillips <28457+brianphillips@users.noreply.github.com>
Signed-off-by: Brian Phillips <28457+brianphillips@users.noreply.github.com>
Changed Packages
|
Signed-off-by: Brian Phillips <28457+brianphillips@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! 🎉
Just API design nits
@backstage/discoverability-maintainers could you have a look too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm + agree with @Rugvip on his naming nits.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This makes sense to me, but I like the suggestion from @Rugvip about using init or initialize instead of build, so would be nice to get that updated!
Signed-off-by: Brian Phillips <28457+brianphillips@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thank you! 🎉
Co-authored-by: Emma Indal <emma.indahl@gmail.com> Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this @brianphillips, left one small nit but it's not blocking
Co-authored-by: Andre Wanlin <67169551+awanlin@users.noreply.github.com> Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Thank you for contributing to Backstage! The changes in this pull request will be part of the |
Uffizzi Cluster |
Signed-off-by: blam <ben@blam.sh>
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 thesearchIndexService
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.✔️ Checklist
Signed-off-by
line in the message. (more info)