-
Notifications
You must be signed in to change notification settings - Fork 149
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
feat(backend): add service factories by default #1881
base: main
Are you sure you want to change the base?
Conversation
The image is available at: |
The image is available at: |
The image is available at: |
/test e2e-tests |
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.
Shouldn't we do something more general than that, for all the default services added in the createdBackend()
method ?
With environment variables like:
ENABLE_OVERRIDING_SERVICE_ (serviceFactoryName being the service factory name mentioned in the list of default services: https://github.com/backstage/backstage/blob/master/packages/backend-defaults/src/CreateBackend.ts#L37)
I can look at doing that, certainly. I didn't see the same customization options offered for some of the other services when I was looking through them in preparation for this, so I opted to keep the scope for this much more narrow. But I'll take another look. Thanks! |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
I like the last commit: 4a76ffa Would it be possible to add a unit test that would simply extract the upstream source file based on the |
The image is available at: |
Cool!
yeah good call, lemme look into that. |
The image is available at: |
The image is available at: |
The image is available at: |
8051f90
to
8db2907
Compare
The image is available at: |
@gashcrumb: The following test failed, say
Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
This change explicitely adds the default service factories to the backend statically to prevent dynamic plugins from being able to override them by default. It's possible to override each statically added service factory via an environment variable derived from the service factory ID. So for example to add a "core.rootHttpService" service factory configuration from a dynamic plugin, set ENABLE_CORE_ROOTHTTPSERVICE_OVERRIDE to "true". This change also adds a logger to the backend main. Finally, a unit test has been added that checks the installed backend-defaults value for the defaultServiceFactories list against what this change adds to catch future regressions. Signed-off-by: Stan Lewis <[email protected]>
8db2907
to
c84e65d
Compare
Quality Gate passedIssues Measures |
The image is available at: |
Description
This change explicitely adds the default service factories to the backend statically to prevent dynamic plugins from being able to override them by default. It's possible to override each statically added service factory via an environment variable derived from the service factory ID. So for example to add a "core.rootHttpService" service factory configuration from a dynamic plugin, set ENABLE_CORE_ROOTHTTPSERVICE_OVERRIDE to "true". This change also adds a logger to the backend main. Finally, a unit test has been added that checks the installed backend-defaults value for the defaultServiceFactories list against what this change adds to catch future regressions.
Which issue(s) does this PR fix
PR acceptance criteria
Please make sure that the following steps are complete:
How to test changes / Special notes to the reviewer
It's enough to just check that this doesn't break anything, however an example exists here that has a plugin that can be used to try this out. I'll add some documentation to the dynamic plugins docs in a later PR, we've a plan to refactor those a bit.