Skip to content

Comments

Version Packages (lightspeed)#2283

Open
rhdh-bot wants to merge 1 commit intomainfrom
changesets-release/lightspeed/main
Open

Version Packages (lightspeed)#2283
rhdh-bot wants to merge 1 commit intomainfrom
changesets-release/lightspeed/main

Conversation

@rhdh-bot
Copy link
Collaborator

@rhdh-bot rhdh-bot commented Feb 9, 2026

Releases

@red-hat-developer-hub/backstage-plugin-lightspeed-backend@1.4.0

Minor Changes

  • 18aa761: BREAKING Replaces fetch function with built-in one and refactors source to fit the change. This change comes from ADR014 that now recommends the use of the global built-in fetch function since Node v20.

    The changes are contained for the lightspeed-backend plugin, the node-fetch direct dependency is removed from package.json and makes the following changes to the router.ts source:

    import { MiddlewareFactory } from '@backstage/backend-defaults/rootHttpRouter';
    import { NotAllowedError } from '@backstage/errors';
    import { createPermissionIntegrationRouter } from '@backstage/plugin-permission-node';
    
    import express, { Router } from 'express';
    import { createProxyMiddleware } from 'http-proxy-middleware';
    -import fetch from 'node-fetch';
    
    import {
      lightspeedChatCreatePermission,
      lightspeedChatDeletePermission,
      lightspeedChatReadPermission,
      lightspeedPermissions,
    } from '@red-hat-developer-hub/backstage-plugin-lightspeed-common';
    
    +import { Readable } from 'node:stream';
    +
    import { userPermissionAuthorization } from './permission';
    import {
      DEFAULT_HISTORY_LENGTH,
      QueryRequestBody,
      RouterOptions,
    } from './types';
    import { validateCompletionsRequest } from './validation';

    Response piping has changed for the result of the built-in fetch:

    if (!fetchResponse.ok) {
      // Read the error body
      const errorBody = await fetchResponse.json();
      const errormsg = `Error from lightspeed-core server: ${errorBody.error?.message || errorBody?.detail?.cause || 'Unknown error'}`;
      logger.error(errormsg);
    
      // Return a 500 status for any upstream error
      response.status(500).json({
        error: errormsg,
      });
    +
    +  return
    }
    
    // Pipe the response back to the original response
    -fetchResponse.body.pipe(response);
    +if (fetchResponse.body) {
    +  const nodeStream = Readable.fromWeb(fetchResponse.body as any);
    +  nodeStream.pipe(response);
    +}

Patch Changes

  • 442ccf5: Updated dependency msw to 2.12.9.
  • b1417ce: Updated dependency msw to 2.12.8.
    • @red-hat-developer-hub/backstage-plugin-lightspeed-common@1.4.0

@red-hat-developer-hub/backstage-plugin-lightspeed@1.4.0

Patch Changes

  • b6f1568: updated plugin readme
    • @red-hat-developer-hub/backstage-plugin-lightspeed-common@1.4.0

@red-hat-developer-hub/backstage-plugin-lightspeed-common@1.4.0

backend@0.0.32

Patch Changes

  • Updated dependencies [18aa761]
  • Updated dependencies [442ccf5]
  • Updated dependencies [b1417ce]
    • @red-hat-developer-hub/backstage-plugin-lightspeed-backend@1.4.0

@github-actions github-actions bot force-pushed the changesets-release/lightspeed/main branch 3 times, most recently from 70eb2e9 to a83d393 Compare February 16, 2026 08:34
@github-actions github-actions bot force-pushed the changesets-release/lightspeed/main branch 2 times, most recently from 06c07a7 to f530cb4 Compare February 18, 2026 17:48
@github-actions github-actions bot force-pushed the changesets-release/lightspeed/main branch from f530cb4 to 646a9ca Compare February 23, 2026 22:01
@sonarqubecloud
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant