Skip to content
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

chore: Update dependency @backstage/backend-plugin-api to v0.7.0 #71

Merged
merged 1 commit into from
Aug 15, 2024

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Aug 14, 2024

Mend Renovate

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
@backstage/backend-plugin-api (source) 0.6.18 -> 0.7.0 age adoption passing confidence

Release Notes

backstage/backstage (@​backstage/backend-plugin-api)

v0.7.0

Compare Source

Minor Changes
  • 36f91e8: BREAKING: The PermissionsService no longer supports passing the deprecated token option, and the request options are now required.
Patch Changes
  • 53ced70: Added a new Root Health Service which adds new endpoints for health checks.

  • 083eaf9: Fix bug where ISO durations could no longer be used for schedules

  • 062c01c: Deprecated the ability to define options for service factories through createServiceFactory. In the future all service factories will return a plain ServiceFactory object, rather than allowing users to pass options to the factory. To allow for customization of a service implementation one can instead export one or a few building blocks that allows for simple re-implementation of the service instead.

    For example, instead of:

    export const fooServiceFactory = createServiceFactory<FooService>(
      (options?: { bar: string }) => ({
        service: fooServiceRef,
        deps: { logger: coreServices.logger },
        factory({ logger }) {
          return {
            // Implementation of the foo service using the `bar` option.
          };
        },
      }),
    );

    We instead encourage service implementations to provide an easy to use API for re-implementing the service for advanced use-cases:

    /** @&#8203;public */
    export class DefaultFooService implements FooService {
      static create(options: { bar: string; logger: LoggerService }) {
        return new DefaultFooService(options.logger, options.bar ?? 'default');
      }
    
      private constructor(
        private readonly logger: string,
        private readonly bar: string,
      ) {}
    
      // The rest of the implementation
    }

    A user that wishes to customize the service can then easily do so by defining their own factory:

    export const customFooServiceFactory = createServiceFactory<FooService>({
      service: fooServiceRef,
      deps: { logger: coreServices.logger },
      factory({ logger }) {
        return DefaultFooService.create({ logger, bar: 'baz' });
      },
    });

    This is of course more verbose than the previous solution where the factory could be customized through fooServiceFactory({ bar: 'baz' }), but this is a simplified which in practice should be using static configuration instead.

    In cases where the old options patterns significantly improves the usability of the service factory, the old pattern can still be implemented like this:

    const fooServiceFactoryWithOptions = (options?: { bar: string }) =>
      createServiceFactory<FooService>({
        service: fooServiceRef,
        deps: { logger: coreServices.logger },
        factory({ logger }) {
          return {
            // Implementation of the foo service using the `bar` option.
          };
        },
      });
    
    export const fooServiceFactory = Object.assign(
      fooServiceFactoryWithOptions,
      fooServiceFactoryWithOptions(),
    );

    This change is being made because the ability to define an options callback encourages bad design of services factories. When possible, a service should be configurable through static configuration, and the existence of options may discourage that. More importantly though, the existing options do not work well with the dependency injection system of services, which is a problem for callbacks an other more advanced options. This lead to a bad pattern where only a few explicit dependencies where made available in callbacks, rather than providing an API that allowed simple re-implementation of the service with full access to dependency injection.

    A separate benefit of this change is that it simplifies the TypeScript types in a way that allows TypeScript to provide a much better error message when a service factory doesn't properly implement the service interface.

  • fe47a3e: All service config types were renamed to option types in order to standardize frontend and backend create* function signatures:

    • The ServiceRefConfig type was renamed toServiceRefOptions;
    • The RootServiceFactoryConfig type was renamed to RootServiceFactoryOptions;
    • The PluginServiceFactoryConfig type was renamed to PluginServiceFactoryOptions
  • Updated dependencies

v0.6.21

Compare Source

Patch Changes

v0.6.20

Compare Source

v0.6.19

Compare Source

Patch Changes
  • 78a0b08: DEPRECATION: You should no longer do a function call on backend features when adding them to backends. The support for doing that is deprecated, and you should remove all trailing () parentheses after plugins and modules where you add them to your backend or test backends (e.g. when using startTestBackend).

    The background for this is that createBackendPlugin and createBackendModule function now effectively return a BackendFeature rather than a () => BackendFeature. This is part of the cleanup efforts for New Backend System 1.0. In the short run this is non-breaking because the feature type has been given a callback signature that returns itself. But we strongly recommend that you remove all now-redundant calls made to feature objects, because that callback signature will be removed in a future release.

    Service factories are still callbacks at this point.

    Example change:

     await startTestBackend({
       features: [
         eventsServiceFactory(), // service - stays unchanged
    -    catalogModuleBitbucketCloudEntityProvider(), // module - remove parentheses
    +    catalogModuleBitbucketCloudEntityProvider,
  • 9bdc3e8: In tests, return null rather than throwing an error when trying to get the ExtensionPoint.T property, so that tests asserting the property are not easily broken.

  • 9e63318: Added an optional accessRestrictions to external access service tokens and service principals in general, such that you can limit their access to certain plugins or permissions.

  • 3aa3fc7: Marked the TokenManagerService and IdentityService types as deprecated

  • b2ee7f3: Deprecated all of the UrlReader related type names and replaced them with prefixed versions. Please update your imports.

    • ReadTreeOptions was renamed to UrlReaderServiceReadTreeOptions
    • ReadTreeResponse was renamed to UrlReaderServiceReadTreeResponse
    • ReadTreeResponseDirOptions was renamed to UrlReaderServiceReadTreeResponseDirOptions
    • ReadTreeResponseFile was renamed to UrlReaderServiceReadTreeResponseFile
    • ReadUrlResponse was renamed to UrlReaderServiceReadUrlResponse
    • ReadUrlOptions was renamed to UrlReaderServiceReadUrlOptions
    • SearchOptions was renamed to UrlReaderServiceSearchOptions
    • SearchResponse was renamed to UrlReaderServiceSearchResponse
    • SearchResponseFile was renamed to UrlReaderServiceSearchResponseFile
  • 9539a0b: Improved coreServices doc comments

  • 6551b3d: Moved the declaration of the SchedulerService here, along with prefixed versions of all of the types it depends on, from @backstage/backend-tasks

  • 0665b7e: Renamed BackendPluginConfig, BackendModuleConfig, and ExtensionPointConfig respectively to CreateBackendPluginOptions, CreateBackendModuleOptions, and CreateExtensionPointOptions to standardize frontend and backend factories signatures.

  • 1779188: Start using the isDatabaseConflictError helper from the @backstage/backend-plugin-api package in order to avoid dependency with the soon to deprecate @backstage/backend-common package.

  • Updated dependencies


Configuration

📅 Schedule: Branch creation - "after 10pm every weekday,before 5am every weekday,every weekend" (UTC), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate renovate bot added dependencies Pull requests that update a dependency file renovate labels Aug 14, 2024
@renovate renovate bot force-pushed the renovate_backstage-backend-plugin-api-0.x branch 4 times, most recently from f57f709 to bcb2f7b Compare August 15, 2024 07:28
@renovate renovate bot force-pushed the renovate_backstage-backend-plugin-api-0.x branch from bcb2f7b to 11de0c5 Compare August 15, 2024 07:34
@skrolikiewicz skrolikiewicz merged commit 67a6e5c into main Aug 15, 2024
3 checks passed
@skrolikiewicz skrolikiewicz deleted the renovate_backstage-backend-plugin-api-0.x branch August 15, 2024 07:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file renovate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant