Skip to content

Commit

Permalink
Merge branch 'main' into sc-24202-wiz-snags
Browse files Browse the repository at this point in the history
  • Loading branch information
Irma12 authored Dec 6, 2024
2 parents 28b756a + 2e3cbf3 commit 0f076ce
Show file tree
Hide file tree
Showing 55 changed files with 228 additions and 68 deletions.
17 changes: 17 additions & 0 deletions packages/backend/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
# backend

## 2.3.0

### Minor Changes

- 8915f83: We are making the logger compatible with Backstage's LoggerService and winston's Logger so that Roadie can be used with newer and older versions of Backstage.

### Patch Changes

- Updated dependencies [8915f83]
- @roadiehq/scaffolder-backend-module-http-request@5.2.0
- @roadiehq/backstage-plugin-argo-cd-backend@3.3.0
- @roadiehq/rag-ai-backend-embeddings-openai@0.4.0
- @roadiehq/catalog-backend-module-aws@5.3.0
- @roadiehq/backstage-plugin-aws-auth@0.5.0
- @roadiehq/backstage-plugin-aws-backend@1.3.0
- @roadiehq/rag-ai-backend@1.3.0

## 2.2.0

### Minor Changes
Expand Down
16 changes: 8 additions & 8 deletions packages/backend/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "backend",
"version": "2.2.0",
"version": "2.3.0",
"main": "dist/index.cjs.js",
"types": "src/index.ts",
"private": true,
Expand Down Expand Up @@ -41,20 +41,20 @@
"@langchain/core": "^0.2.27",
"@langchain/openai": "^0.2.7",
"@octokit/rest": "^19.0.3",
"@roadiehq/backstage-plugin-argo-cd-backend": "3.2.3",
"@roadiehq/backstage-plugin-argo-cd-backend": "3.3.0",
"@roadiehq/plugin-wiz-backend": "^1.0.0",
"@roadiehq/backstage-plugin-aws-auth": "^0.4.26",
"@roadiehq/backstage-plugin-aws-backend": "^1.2.0",
"@roadiehq/catalog-backend-module-aws": "^5.2.0",
"@roadiehq/backstage-plugin-aws-auth": "^0.5.0",
"@roadiehq/backstage-plugin-aws-backend": "^1.3.0",
"@roadiehq/catalog-backend-module-aws": "^5.3.0",
"@roadiehq/catalog-backend-module-okta": "^1.0.3",
"@roadiehq/rag-ai-backend": "^1.2.0",
"@roadiehq/rag-ai-backend": "^1.3.0",
"@roadiehq/rag-ai-backend-embeddings-aws": "^1.0.0",
"@roadiehq/rag-ai-backend-embeddings-openai": "^0.3.0",
"@roadiehq/rag-ai-backend-embeddings-openai": "^0.4.0",
"@roadiehq/rag-ai-backend-retrieval-augmenter": "^1.0.4",
"@roadiehq/rag-ai-storage-pgvector": "^1.0.2",
"@roadiehq/catalog-backend-module-gravatar": "^1.0.5",
"@roadiehq/scaffolder-backend-module-aws": "^2.4.26",
"@roadiehq/scaffolder-backend-module-http-request": "^5.0.0",
"@roadiehq/scaffolder-backend-module-http-request": "^5.2.0",
"@roadiehq/scaffolder-backend-module-utils": "^3.0.0",
"app": "^1.1.8",
"better-sqlite3": "^9.0.0",
Expand Down
6 changes: 5 additions & 1 deletion packages/backend/src/plugins/proxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,15 @@
import { createRouter } from '@backstage/plugin-proxy-backend';
import { Router } from 'express';
import { PluginEnvironment } from '../types';
import { loggerToWinstonLogger } from '@backstage/backend-common';
import { Logger } from 'winston';

export default async function createPlugin({
logger,
config,
discovery,
}: PluginEnvironment): Promise<Router> {
return await createRouter({ logger, config, discovery });
const winstonLogger =
logger instanceof Logger ? logger : loggerToWinstonLogger(logger);
return await createRouter({ logger: winstonLogger, config, discovery });
}
7 changes: 6 additions & 1 deletion packages/backend/src/plugins/scaffolder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import {
ContainerRunner,
DockerContainerRunner,
loggerToWinstonLogger,
} from '@backstage/backend-common';
import { CatalogClient } from '@backstage/catalog-client';
import { TemplateAction } from '@backstage/plugin-scaffolder-node';
Expand Down Expand Up @@ -49,6 +50,7 @@ import { ScmIntegrations } from '@backstage/integration';
import { Config } from '@backstage/config';
import { DiscoveryApi } from '@backstage/plugin-permission-common';
import { UrlReaderService } from '@backstage/backend-plugin-api';
import { Logger } from 'winston';

export const createActions = (options: {
reader: UrlReaderService;
Expand Down Expand Up @@ -98,8 +100,11 @@ export default async function createPlugin({

const catalogClient = new CatalogClient({ discoveryApi: discovery });

const winstonLogger =
logger instanceof Logger ? logger : loggerToWinstonLogger(logger);

return await createRouter({
logger,
logger: winstonLogger,
config,
database,
catalogClient,
Expand Down
7 changes: 6 additions & 1 deletion packages/backend/src/plugins/techdocs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ import {
Preparers,
Publisher,
} from '@backstage/plugin-techdocs-backend';
import { Logger } from 'winston';
import { loggerToWinstonLogger } from '@backstage/backend-common';
import Docker from 'dockerode';
import { Router } from 'express';
import { PluginEnvironment } from '../types';
Expand Down Expand Up @@ -58,11 +60,14 @@ export default async function createPlugin({
// checks if the publisher is working and logs the result
await publisher.getReadiness();

const winstonLogger =
logger instanceof Logger ? logger : loggerToWinstonLogger(logger);

return await createRouter({
preparers,
generators,
publisher,
logger,
logger: winstonLogger,
config,
discovery,
cache,
Expand Down
3 changes: 2 additions & 1 deletion packages/backend/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
* limitations under the License.
*/
import { Logger } from 'winston';
import { LoggerService } from '@backstage/backend-plugin-api';
import { Config } from '@backstage/config';
import {
PluginCacheManager,
Expand All @@ -26,7 +27,7 @@ import { PluginTaskScheduler } from '@backstage/backend-tasks';
import { UrlReaderService } from '@backstage/backend-plugin-api';

export type PluginEnvironment = {
logger: Logger;
logger: Logger | LoggerService;
cache: PluginCacheManager;
database: PluginDatabaseManager;
config: Config;
Expand Down
6 changes: 6 additions & 0 deletions plugins/backend/backstage-aws-backend/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @roadiehq/backstage-plugin-aws-backend

## 1.3.0

### Minor Changes

- 8915f83: We are making the logger compatible with Backstage's LoggerService and winston's Logger so that Roadie can be used with newer and older versions of Backstage.

## 1.2.0

### Minor Changes
Expand Down
3 changes: 2 additions & 1 deletion plugins/backend/backstage-aws-backend/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@roadiehq/backstage-plugin-aws-backend",
"version": "1.2.0",
"version": "1.3.0",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
Expand Down Expand Up @@ -38,6 +38,7 @@
},
"dependencies": {
"@backstage/backend-common": "^0.25.0",
"@backstage/backend-plugin-api": "^1.0.1",
"@backstage/catalog-client": "^1.8.0",
"@backstage/config": "^1.3.0",
"@types/express": "^4.17.6",
Expand Down
3 changes: 2 additions & 1 deletion plugins/backend/backstage-aws-backend/src/service/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,13 @@ import { Config } from '@backstage/config';
import express, { Request } from 'express';
import Router from 'express-promise-router';
import { Logger } from 'winston';
import { LoggerService } from '@backstage/backend-plugin-api';
import { CloudControl } from '@aws-sdk/client-cloudcontrol';
import { fromTemporaryCredentials } from '@aws-sdk/credential-providers';
import { Account } from '../types';

export interface RouterOptions {
logger: Logger;
logger: Logger | LoggerService;
config: Config;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,13 @@ import {
} from '@backstage/backend-common';
import { Server } from 'http';
import { Logger } from 'winston';
import { LoggerService } from '@backstage/backend-plugin-api';
import { createRouter } from './router';

export interface ServerOptions {
port: number;
enableCors: boolean;
logger: Logger;
logger: Logger | LoggerService;
}

export async function startStandaloneServer(
Expand Down
6 changes: 6 additions & 0 deletions plugins/backend/backstage-plugin-argo-cd-backend/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @roadiehq/backstage-plugin-argo-cd-backend

## 3.3.0

### Minor Changes

- 8915f83: We are making the logger compatible with Backstage's LoggerService and winston's Logger so that Roadie can be used with newer and older versions of Backstage.

## 3.2.3

### Patch Changes
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@roadiehq/backstage-plugin-argo-cd-backend",
"version": "3.2.3",
"version": "3.3.0",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Config } from '@backstage/config';
import fetch from 'cross-fetch';
import { Logger } from 'winston';
import { LoggerService } from '@backstage/backend-plugin-api';
import { timer } from './timer.services';

import {
Expand Down Expand Up @@ -45,7 +46,7 @@ export class ArgoService implements ArgoServiceApi {
private readonly username: string,
private readonly password: string,
private readonly config: Config,
private readonly logger: Logger,
private readonly logger: Logger | LoggerService,
) {
this.instanceConfigs = this.config
.getConfigArray('argocd.appLocatorMethods')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
} from './argocdTestResponses';
import fetchMock from 'jest-fetch-mock';
import { timer } from './timer.services';
import { Logger } from 'winston';
import { LoggerService } from '@backstage/backend-plugin-api';
import { ResourceItem, UpdateArgoProjectAndAppProps } from './types';
import { mocked } from 'jest-mock';

Expand All @@ -18,7 +18,7 @@ jest.mock('./timer.services', () => ({
const loggerMock = {
error: jest.fn(),
info: jest.fn(),
} as unknown as Logger;
} as unknown as LoggerService;

const getConfig = (options: {
token?: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ import { Config } from '@backstage/config';
import express from 'express';
import Router from 'express-promise-router';
import { Logger } from 'winston';
import { LoggerService } from '@backstage/backend-plugin-api';
import { ArgoService } from './argocd.service';
import { getArgoConfigByInstanceName } from '../utils/getArgoConfig';

export interface RouterOptions {
logger: Logger;
logger: Logger | LoggerService;
config: Config;
}
export type Response = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@ import {
} from '@backstage/backend-common';
import { Server } from 'http';
import { Logger } from 'winston';
import { LoggerService } from '@backstage/backend-plugin-api';
import { createRouter } from './router';

export interface ServerOptions {
port: number;
enableCors: boolean;
logger: Logger;
logger: Logger | LoggerService;
}

export async function startStandaloneServer(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Config } from '@backstage/config';
import { Logger } from 'winston';
import { LoggerService } from '@backstage/backend-plugin-api';

export type getRevisionDataResp = {
author: string;
Expand Down Expand Up @@ -61,7 +62,7 @@ export interface CreateArgoResourcesProps {
sourceRepo: string;
sourcePath: string;
labelValue: string;
logger: Logger;
logger: Logger | LoggerService;
}

export interface UpdateArgoProjectAndAppProps {
Expand Down
6 changes: 6 additions & 0 deletions plugins/backend/backstage-plugin-aws-auth/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @roadiehq/backstage-plugin-aws-auth

## 0.5.0

### Minor Changes

- 8915f83: We are making the logger compatible with Backstage's LoggerService and winston's Logger so that Roadie can be used with newer and older versions of Backstage.

## 0.4.26

### Patch Changes
Expand Down
3 changes: 2 additions & 1 deletion plugins/backend/backstage-plugin-aws-auth/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@roadiehq/backstage-plugin-aws-auth",
"version": "0.4.26",
"version": "0.5.0",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
Expand Down Expand Up @@ -39,6 +39,7 @@
},
"dependencies": {
"@backstage/backend-common": "^0.25.0",
"@backstage/backend-plugin-api": "^1.0.1",
"@types/express": "^4.17.11",
"aws-sdk": "^2.902.0",
"cors": "^2.8.5",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

import express from 'express';
import { Logger } from 'winston';
import { LoggerService } from '@backstage/backend-plugin-api';
import { generateTemporaryCredentials } from './generateTemporaryCredentials';

export type LambdaData = {
Expand All @@ -35,7 +36,7 @@ export function getAwsApiGenerateTempCredentialsForwarder({
}: {
AWS_ACCESS_KEY_ID?: string;
AWS_ACCESS_KEY_SECRET?: string;
logger: Logger;
logger: Logger | LoggerService;
}) {
return async function forwardRequest(
_: express.Request,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,14 @@
*/

import { Logger } from 'winston';
import { LoggerService } from '@backstage/backend-plugin-api';
import Router from 'express-promise-router';
import express from 'express';
import { getAwsApiGenerateTempCredentialsForwarder } from './aws-api';

export async function createRouter(logger: Logger): Promise<express.Router> {
export async function createRouter(
logger: Logger | LoggerService,
): Promise<express.Router> {
const router = Router();
router.use(express.json());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,11 @@ import cors from 'cors';
import express from 'express';
import helmet from 'helmet';
import { Logger } from 'winston';
import { LoggerService } from '@backstage/backend-plugin-api';
import { createRouter } from './router';

export async function createStandaloneApplication(
logger: Logger,
logger: Logger | LoggerService,
): Promise<express.Application> {
const app = express();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@
*/
import { Server } from 'http';
import { Logger } from 'winston';
import { LoggerService } from '@backstage/backend-plugin-api';
import { createStandaloneApplication } from './standaloneApplication';

export async function startStandaloneServer(
parentLogger: Logger,
parentLogger: Logger | LoggerService,
): Promise<Server> {
const logger = parentLogger.child({ service: 'scaffolder-backend' });
logger.debug('Creating application...');
Expand Down
Loading

0 comments on commit 0f076ce

Please sign in to comment.