### Run Example Backend with Authentication Source: https://github.com/roadiehq/roadie-backstage-plugins/blob/main/packages/backend/README.md Command to start the example Backstage backend development server. It requires setting various authentication environment variables, which can be dummy values for testing. The backend defaults to port 7007. ```bash AUTH_GOOGLE_CLIENT_ID=x AUTH_GOOGLE_CLIENT_SECRET=x \ AUTH_GITHUB_CLIENT_ID=x AUTH_GITHUB_CLIENT_SECRET=x \ AUTH_OAUTH2_CLIENT_ID=x AUTH_OAUTH2_CLIENT_SECRET=x \ AUTH_OAUTH2_AUTH_URL=x AUTH_OAUTH2_TOKEN_URL=x \ LOG_LEVEL=debug \ yarn start ``` -------------------------------- ### Legacy Okta Provider Configuration Example (TypeScript) Source: https://github.com/roadiehq/roadie-backstage-plugins/blob/main/plugins/backend/catalog-backend-module-okta/README.md Provides an example of configuring the `OktaOrgEntityProvider` within a legacy Backstage backend setup. It demonstrates initializing the `CatalogBuilder`, adding the `OktaOrgEntityProvider` with basic naming strategies, and starting the processing engine. This is useful for integrating Okta entities into older Backstage versions. ```typescript import { OktaOrgEntityProvider } from '@roadiehq/catalog-backend-module-okta'; export default async function createPlugin( env: PluginEnvironment, ): Promise { const builder = await CatalogBuilder.create(env); const orgProvider = OktaOrgEntityProvider.fromConfig(env.config, { logger: env.logger, userNamingStrategy: 'strip-domain-email', groupNamingStrategy: 'kebab-case-name', }); builder.addEntityProvider(orgProvider); const { processingEngine, router } = await builder.build(); orgProvider.run(); await processingEngine.start(); // ...snip... return router; } ``` -------------------------------- ### Install Dependencies and Build Project Source: https://github.com/roadiehq/roadie-backstage-plugins/blob/main/README.md Installs project dependencies, compiles TypeScript, and builds the project from the root directory. ```bash yarn install yarn tsc yarn build ``` -------------------------------- ### Install Markdown Home Plugin Source: https://github.com/roadiehq/roadie-backstage-plugins/blob/main/plugins/home/backstage-plugin-home-markdown/README.md Installs the @roadiehq/backstage-plugin-home-markdown package using yarn. ```bash yarn add @roadiehq/backstage-plugin-home-markdown ``` -------------------------------- ### Install Okta Catalog Backend Module Source: https://github.com/roadiehq/roadie-backstage-plugins/blob/main/plugins/backend/catalog-backend-module-okta/README.md Command to install the Okta Catalog Backend Module dependency in a Backstage project. ```bash yarn --cwd packages/backend add @roadiehq/catalog-backend-module-okta ``` -------------------------------- ### Minimal RAG AI Configuration Example Source: https://github.com/roadiehq/roadie-backstage-plugins/blob/main/plugins/backend/rag-ai-backend/README.md A minimal configuration example for RAG AI, demonstrating the necessary settings for AWS main account credentials and Bedrock embeddings model. ```yaml aws: mainAccount: accessKeyId: ${BEDROCK_AWS_ACCESS_KEY_ID} secretAccessKey: ${BEDROCK_AWS_SECRET_ACCESS_KEY} ai: embeddings: bedrock: modelName: 'amazon.titan-embed-text-v1' ``` -------------------------------- ### Run Development Server Source: https://github.com/roadiehq/roadie-backstage-plugins/blob/main/README.md Starts the Backstage application development server from the root directory. ```bash yarn dev ``` -------------------------------- ### Install AWS Lambda Plugin Source: https://github.com/roadiehq/roadie-backstage-plugins/blob/main/plugins/frontend/backstage-plugin-aws-lambda/README.md Installs the AWS Lambda plugin using Yarn. This is the first step in integrating the plugin into your Backstage instance. ```bash yarn add @roadiehq/backstage-plugin-aws-lambda ``` -------------------------------- ### Install and Configure Scaffolder Backend Module Utils Source: https://github.com/roadiehq/roadie-backstage-plugins/blob/main/plugins/scaffolder-actions/scaffolder-backend-module-utils/README.md Installs the utility module and registers its actions within the Backstage backend configuration. This involves adding the package to dependencies and importing/registering the actions in the scaffolder plugin setup. ```bash cd packages/backend yarn add @roadiehq/scaffolder-backend-module-utils ``` ```typescript // packages/backend/src/plugins/scaffolder.ts import { createZipAction, createSleepAction, createWriteFileAction, createAppendFileAction, createMergeJSONAction, createMergeAction, createParseFileAction, createSerializeYamlAction, createSerializeJsonAction, createJSONataAction, createYamlJSONataTransformAction, createJsonJSONataTransformAction, } from '@roadiehq/scaffolder-backend-module-utils'; ... const actions = [ createZipAction(), createSleepAction(), createWriteFileAction(), createAppendFileAction(), createMergeJSONAction({}), createMergeAction(), createAwsS3CpAction(), createEcrAction(), createParseFileAction(), createSerializeYamlAction(), createSerializeJsonAction(), createJSONataAction(), createYamlJSONataTransformAction(), createJsonJSONataTransformAction(), createReplaceInFileAction(), ...createBuiltinActions({ containerRunner, integrations, config, catalogClient, reader, }), ]; return await createRouter({ containerRunner, logger, config, database, catalogClient, reader, actions, }); ``` -------------------------------- ### Install Backstage Prometheus Plugin Source: https://github.com/roadiehq/roadie-backstage-plugins/blob/main/plugins/frontend/backstage-plugin-prometheus/README.md Installs the Backstage Prometheus plugin using Yarn. This command should be run within the Backstage application's 'packages/app' directory. ```bash cd packages/app yarn add @roadiehq/backstage-plugin-prometheus ``` -------------------------------- ### AWS Credentials Configuration Examples Source: https://github.com/roadiehq/roadie-backstage-plugins/blob/main/plugins/backend/rag-ai-backend-embeddings-aws/README.md YAML examples demonstrating how to configure AWS credentials for Backstage using the `@backstage/integration-aws-node` package. Supports various methods including access keys, IAM roles, profiles, and account defaults. ```yaml aws: mainAccount: accessKeyId: ${MY_ACCESS_KEY_ID} secretAccessKey: ${MY_SECRET_ACCESS_KEY} accounts: - accountId: '111111111111' roleName: 'my-iam-role-name' externalId: 'my-external-id' - accountId: '222222222222' partition: 'aws-other' roleName: 'my-iam-role-name' region: 'not-us-east-1' accessKeyId: ${MY_ACCESS_KEY_ID_FOR_ANOTHER_PARTITION} secretAccessKey: ${MY_SECRET_ACCESS_KEY_FOR_ANOTHER_PARTITION} - accountId: '333333333333' accessKeyId: ${MY_OTHER_ACCESS_KEY_ID} secretAccessKey: ${MY_OTHER_SECRET_ACCESS_KEY} - accountId: '444444444444' profile: my-profile-name - accountId: '555555555555' accountDefaults: roleName: 'my-backstage-role' externalId: 'my-id' ``` -------------------------------- ### Install Shortcut Plugin using Yarn Source: https://github.com/roadiehq/roadie-backstage-plugins/blob/main/plugins/frontend/backstage-plugin-shortcut/README.md Installs the Shortcut plugin package into your Backstage application's 'app' directory using Yarn. This is the first step in integrating the plugin. ```bash cd packages/app yarn add @roadiehq/backstage-plugin-shortcut ``` -------------------------------- ### Install GitHub Insights Plugin Source: https://github.com/roadiehq/roadie-backstage-plugins/blob/main/plugins/frontend/backstage-plugin-github-insights/README.md Installs the GitHub Insights plugin using yarn. This is the first step in setting up the plugin within a Backstage instance. ```bash cd packages/app yarn add @roadiehq/backstage-plugin-github-insights ``` -------------------------------- ### Install Wiz Plugin using Yarn Source: https://github.com/roadiehq/roadie-backstage-plugins/blob/main/plugins/frontend/backstage-plugin-wiz/README.md Command to install the Wiz plugin package into your Backstage application using Yarn. This command should be run from the root directory of your Backstage project. ```bash # From your Backstage root directory yarn --cwd packages/app add @roadiehq/backstage-plugin-wiz ``` -------------------------------- ### Create Component with LaunchDarkly Annotations Source: https://github.com/roadiehq/roadie-backstage-plugins/blob/main/plugins/frontend/backstage-plugin-launchdarkly/README.md Example of a Backstage Component definition with annotations required for the LaunchDarkly plugin to identify the project, environment, and context. ```yaml --- apiVersion: backstage.io/v1alpha1 kind: Component metadata: name: launchdarklytest annotations: launchdarkly.com/project-key: default launchdarkly.com/environment-key: test launchdarkly.com/context: '{ "kind": "tenant", "key": "blah", "name": "blah" }' spec: type: service lifecycle: unknown owner: 'group:engineering' ``` -------------------------------- ### Example HTTP GET Request in Backstage Template (YAML) Source: https://github.com/roadiehq/roadie-backstage-plugins/blob/main/plugins/scaffolder-actions/scaffolder-backend-module-http-request/README.md This YAML defines a Backstage software template that utilizes the `http:backstage:request` action to perform a GET request. It demonstrates how to specify the method, path, headers, and how to capture the response body, status code, and headers. ```yaml --- apiVersion: scaffolder.backstage.io/v1beta3 kind: Template metadata: name: HTTP-testing title: Http testing for post/get description: Testing get functionality with get spec: owner: roadie type: service parameters: - title: Fill in some params properties: httpGetPath: title: Get Path type: string description: The path you want to get on your backstage instance ui:autofocus: true ui:options: rows: 5 steps: - id: backstage_request name: backstage request action: http:backstage:request input: method: 'GET' path: '/proxy/snyk/org//project//aggregated-issues' headers: test: 'hello' foo: 'bar' output: getResponse: '{{ steps.backstage_request.output.body }}' getCode: '{{ steps.backstage_request.output.code }}' getHeaders: '{{ steps.backstage_request.output.headers }}' ``` -------------------------------- ### Install RSS Home Page Plugin Source: https://github.com/roadiehq/roadie-backstage-plugins/blob/main/plugins/home/backstage-plugin-home-rss/README.md Installs the RSS Home Page plugin using Yarn. This is a prerequisite for using the plugin. ```bash yarn add @roadiehq/backstage-plugin-home-rss ``` -------------------------------- ### Start AWS Auth Backend Plugin (Bash) Source: https://github.com/roadiehq/roadie-backstage-plugins/blob/main/plugins/backend/backstage-plugin-aws-auth/README.md Commands to set environment variables for AWS API keys and start the plugin locally. It also includes the yarn command to add the plugin to a Backstage application. ```bash export AWS_ACCESS_KEY_ID=x export AWS_ACCESS_KEY_SECRET=x yarn start ``` ```bash yarn add @roadiehq/backstage-plugin-aws-auth ``` -------------------------------- ### Install ArgoCD Scaffolder Action (Yarn) Source: https://github.com/roadiehq/roadie-backstage-plugins/blob/main/plugins/scaffolder-actions/scaffolder-backend-argocd/README.md Installs the `@roadiehq/scaffolder-backend-argocd` package using Yarn. This is a prerequisite for using the ArgoCD scaffolder actions. ```bash cd packages/backend yarn add @roadiehq/scaffolder-backend-argocd ``` -------------------------------- ### Install WIZ Backend Plugin (New System) Source: https://github.com/roadiehq/roadie-backstage-plugins/blob/main/plugins/backend/wiz-backend/README.md This TypeScript snippet demonstrates how to install the v2 WIZ backend plugin into your Backstage application using the new backend plugin system. It involves adding the plugin to your backend's index.ts file. ```typescript // Install wiz backend plugin backend.add(import('@roadiehq/plugin-wiz-backend')); ``` -------------------------------- ### Example Scaffolder Template: Overwrite File Source: https://github.com/roadiehq/roadie-backstage-plugins/blob/main/plugins/scaffolder-actions/scaffolder-backend-module-utils/README.md An example of a Backstage scaffolder template that demonstrates writing content to a file, potentially as part of a larger workflow like creating a Pull Request. ```APIDOC ## Scaffolder Template: overwrite-file-template-example ### Description This template allows users to specify repository details, a branch name, a file path, and content to write to that file within a repository. It includes steps to fetch the repository, write to a file, and publish a Pull Request. ### Parameters #### User Input Parameters - **repository** (string) - Required - The name of the repository. - **org** (string) - Required - The GitHub organization that the repository belongs to. - **pr_branch** (string) - Required - The name of the new branch to create for the Pull Request. - **path** (string) - Required - The path to the file within the repository to be modified. - **content** (string) - Required - The content to write to the specified file. Supports multiline input via a textarea widget. ### Steps 1. **fetch:plain**: Fetches the specified repository from GitHub. 2. **roadiehq:utils:fs:write**: Writes the provided content to the specified file path within the fetched repository. 3. **publish:github:pull-request**: Creates a Pull Request on GitHub with the changes. 4. **debug:log**: Logs the remote URL of the created Pull Request. ``` -------------------------------- ### Install Security Insights Plugin (Bash) Source: https://github.com/roadiehq/roadie-backstage-plugins/blob/main/plugins/frontend/backstage-plugin-security-insights/README.md Installs the @roadiehq/backstage-plugin-security-insights package as a dependency in your Backstage project's package.json file. ```bash yarn add @roadiehq/backstage-plugin-security-insights ``` -------------------------------- ### Install GitHub Pull Requests Plugin Source: https://github.com/roadiehq/roadie-backstage-plugins/blob/main/plugins/frontend/backstage-plugin-github-pull-requests/README.md Installs the GitHub Pull Requests plugin using Yarn. This command should be run within the 'packages/app' directory of your Backstage project. ```bash cd packages/app yarn add @roadiehq/backstage-plugin-github-pull-requests ``` -------------------------------- ### Add Buildkite Plugin Dependency Source: https://github.com/roadiehq/roadie-backstage-plugins/blob/main/plugins/frontend/backstage-plugin-buildkite/README.md Installs the Buildkite plugin for Backstage using yarn. This is the first step to integrate Buildkite CI/CD features into your Backstage application. ```bash yarn add @roadiehq/backstage-plugin-buildkite ``` -------------------------------- ### Example Extra Alert Table Columns (TypeScript) Source: https://github.com/roadiehq/roadie-backstage-plugins/blob/main/plugins/frontend/backstage-plugin-prometheus/README.md Provides an example of how to define extra columns for the PrometheusAlertStatus component, including 'Summary' and 'Description' fields from annotations. ```typescript const extraColumns: TableColumn[] = [ { title: 'Summary', field: 'annotations.summary', }, { title: 'Description', field: 'annotations.description', }, ]; ``` -------------------------------- ### Zip Action Example in Backstage Template Source: https://github.com/roadiehq/roadie-backstage-plugins/blob/main/plugins/scaffolder-actions/scaffolder-backend-module-utils/README.md Demonstrates how to use the `roadiehq:utils:zip` action within a Backstage scaffolder template. This action compresses files specified by `path` into a zip file at `outputPath`. ```yaml --- apiVersion: scaffolder.backstage.io/v1beta3 kind: Template metadata: name: zip-dummy title: My custom zip action description: scaffolder action to zip the current context? spec: owner: roadie type: service parameters: - title: Zip properties: path: title: Path type: string description: Workspace path to zip outputPath: title: Path type: string description: The path of the zip file steps: - id: zip name: Zip action: roadiehq:utils:zip input: path: ${{ parameters.path }} outputPath: ${{ parameters.outputPath }} output: outputPath: ${{ steps.zip.output.path }} ``` -------------------------------- ### Dynamic Prometheus Proxying Setup (YAML) Source: https://github.com/roadiehq/roadie-backstage-plugins/blob/main/plugins/frontend/backstage-plugin-prometheus/README.md Configures Backstage to use a dynamic path for Prometheus proxying, allowing for custom middleware to handle requests based on headers like 'x-prometheus-service-name'. ```yaml prometheus: proxyPath: '/dynamic-prometheus' ``` -------------------------------- ### Add Travis CI Plugin Dependency (Bash) Source: https://github.com/roadiehq/roadie-backstage-plugins/blob/main/plugins/frontend/backstage-plugin-travis-ci/README.md Installs the Travis CI plugin as a package.json dependency in your Backstage application's `app` package. This is the first step to integrating the plugin. ```bash yarn add @roadiehq/backstage-plugin-travis-ci ``` -------------------------------- ### Integrate Buildkite Content into Entity Page Source: https://github.com/roadiehq/roadie-backstage-plugins/blob/main/plugins/frontend/backstage-plugin-buildkite/README.md Adds the Buildkite CI/CD content to your Backstage entity page. This example shows how to conditionally render the `EntityBuildkiteContent` component based on whether the Buildkite plugin is applicable to the entity. ```typescript export const cicdContent = ( ... ); ``` -------------------------------- ### Add Jira Plugin Dependency to Backstage App (Bash) Source: https://github.com/roadiehq/roadie-backstage-plugins/blob/main/plugins/frontend/backstage-plugin-jira/README.md Installs the Jira plugin package for Backstage using yarn. This is the first step for integrating the plugin into a standalone Backstage application. ```bash cd packages/app yarn add @roadiehq/backstage-plugin-jira ``` -------------------------------- ### Utility Actions in Backstage Scaffolder Templates Source: https://context7.com/roadiehq/roadie-backstage-plugins/llms.txt Provides examples of various utility actions from '@roadiehq/scaffolder-backend-module-utils' for file manipulation, serialization, and data transformation. These include sleep, file write/append/parse, YAML serialization, JSON merging, JSONata transformation, file replacement, and zip archiving. ```yaml apiVersion: scaffolder.backstage.io/v1beta3 kind: Template metadata: name: utils-example title: Utility Actions Example spec: owner: platform-team type: service parameters: - title: Input properties: content: title: Content type: string ui:widget: textarea steps: # Sleep action - wait for external process - id: sleep name: Wait for provisioning action: roadiehq:utils:sleep input: amount: 30 # Write file action - id: write name: Create config file action: roadiehq:utils:fs:write input: path: ./config.json content: '{"name": "test"}' # Append to file action - id: append name: Append to changelog action: roadiehq:utils:fs:append input: path: ./CHANGELOG.md content: | ## v1.0.0 - Initial release # Parse file action - id: parse name: Parse config action: roadiehq:utils:fs:parse input: path: ./package.json parser: json # Serialize to YAML action - id: serialize name: Serialize to YAML action: roadiehq:utils:serialize:yaml input: data: apiVersion: backstage.io/v1alpha1 kind: Component metadata: name: my-service # Merge JSON action - id: merge name: Merge package.json action: roadiehq:utils:json:merge input: path: ./package.json content: engines: node: '>=18' mergeArrays: true # JSONata transform action - id: transform name: Transform data action: roadiehq:utils:jsonata input: data: items: ['item1'] expression: '$ ~> | $ | { "items": [items, "item2"] }|' # Replace in files action - id: replace name: Replace placeholders action: roadiehq:utils:fs:replace input: files: - file: './src/config.ts' find: 'PLACEHOLDER_NAME' replaceWith: ${{ parameters.name }} # Zip action - id: zip name: Create archive action: roadiehq:utils:zip input: path: ./dist outputPath: ./release.zip spec: output: parsedContent: ${{ steps.parse.output.content }} transformedData: ${{ steps.transform.output.result }} ``` -------------------------------- ### Retrieve AWS Resource Details using Curl Source: https://github.com/roadiehq/roadie-backstage-plugins/blob/main/plugins/backend/backstage-aws-backend/README.md This example shows how to fetch details of an AWS resource, such as an S3 bucket, using a curl command. The request includes the account ID, resource type, and resource name, with an optional region parameter. ```bash $ curl http://localhost:7007/api/aws/9999999999/AWS::S3::Bucket/bucket1 { "Arn":"arn:aws:s3:::bucket1", "BucketName":"bucket1", ... } ``` -------------------------------- ### Example HTTP POST Request (Shell) Source: https://github.com/roadiehq/roadie-backstage-plugins/blob/main/plugins/scaffolder-actions/scaffolder-backend-module-http-request/README.md This snippet shows the actual HTTP request that is sent when the YAML configuration is processed. It includes the request method, host, path, headers, and the raw JSON payload. This is useful for understanding the underlying network communication. ```sh -------- 127.0.0.1:53321 | POST / Headers "Accept" : ["*/*"] "Content-Type" : ["application/json"] "Connection" : ["close"] "User-Agent" : ["node-fetch/1.0 (+https://github.com/bitinn/node-fetch)"] "Content-Length" : ["27"] 00000000 7b 22 6e 61 6d 65 22 3a 22 74 65 73 74 22 2c 22 |{"name":"test",| 00000010 62 61 72 22 3a 22 66 6f 6f 22 7d |bar":"foo"}| ``` -------------------------------- ### OpenAI Configuration and Initialization Source: https://github.com/roadiehq/roadie-backstage-plugins/blob/main/plugins/backend/rag-ai-backend/README.md This section outlines the steps to initialize OpenAI embeddings and LLMs, and then set up the AI Backend with these configurations. ```APIDOC ## OpenAI Configuration and Initialization ### Description This guide explains how to configure and initialize OpenAI embeddings and LLMs within your Backstage project using the `@roadiehq/rag-ai-backend` plugin. It covers importing necessary modules, obtaining API keys, setting up vector storage, and initializing the AI backend. ### Steps 1. **Import Modules**: Import required components from `@roadiehq/rag-ai-backend`, `@roadiehq/rag-ai-backend-embeddings-openai`, `@roadiehq/rag-ai-storage-pgvector`, `@roadiehq/rag-ai-backend-retrieval-augmenter`, `@langchain/openai`, and `@backstage/catalog-client`. 2. **Get OpenAI API Token**: Obtain your API key from [OpenAI Platform](https://platform.openai.com/api-keys). 3. **Initialize Vector Storage**: Set up a vector storage solution, such as PostgreSQL with `createRoadiePgVectorStore`. 4. **Initialize OpenAI Embeddings**: Use `initializeOpenAiEmbeddings` with your vector store and other necessary configurations. 5. **Create OpenAI LLM Instance**: Instantiate the `OpenAI` model from `@langchain/openai`. 6. **Initialize AI Backend**: Create the AI backend instance using `initializeRagAiBackend`, providing the configured embeddings, LLM, and retrieval pipeline. ### Code Example ```typescript // './plugins/ai' import { createApiRoutes as initializeRagAiBackend } from '@roadiehq/rag-ai-backend'; import { initializeOpenAiEmbeddings } from '@roadiehq/rag-ai-backend-embeddings-openai'; import { createRoadiePgVectorStore } from '@roadiehq/rag-ai-storage-pgvector'; import { createDefaultRetrievalPipeline } from '@roadiehq/rag-ai-backend-retrieval-augmenter'; import { OpenAI } from '@langchain/openai'; import { CatalogClient } from '@backstage/catalog-client'; import { DefaultAwsCredentialsManager } from '@backstage/integration-aws-node'; export default async function createPlugin({ logger, database, discovery, config, }: PluginEnvironment) { const catalogApi = new CatalogClient({ discoveryApi: discovery, }); const vectorStore = await createRoadiePgVectorStore({ logger, database }); const augmentationIndexer = await initializeOpenAiEmbeddings({ logger, catalogApi, vectorStore, discovery, config, }); const model = new OpenAI(); const ragAi = await initializeRagAiBackend({ logger, augmentationIndexer, retrievalPipeline: createDefaultRetrievalPipeline({ discovery, logger, vectorStore: augmentationIndexer.vectorStore, auth, }), model, config, }); return ragAi.router; } ``` ``` -------------------------------- ### Annotate Backstage.yaml for Lambda Function Source: https://github.com/roadiehq/roadie-backstage-plugins/blob/main/plugins/frontend/backstage-plugin-aws-lambda/README.md Provides an example of how to annotate a Backstage entity in `backstage.yaml` to specify which AWS Lambda function and region to display. This requires the AWS auth backend plugin to be installed. ```yaml metadata: annotations: aws.com/lambda-function-name: HelloWorld aws.com/lambda-region: us-east-1 ``` -------------------------------- ### Install Iframe Plugin with Yarn Source: https://github.com/roadiehq/roadie-backstage-plugins/blob/main/plugins/frontend/backstage-plugin-iframe/README.md Installs the @roadiehq/backstage-plugin-iframe package as a dependency in your Backstage project using Yarn. ```bash yarn add @roadiehq/backstage-plugin-iframe ``` -------------------------------- ### Install Bitbucket PR Plugin (Bash) Source: https://github.com/roadiehq/roadie-backstage-plugins/blob/main/plugins/frontend/backstage-plugin-bitbucket-pullrequest/README.md Command to install the Roadie Bitbucket PullRequest plugin into a Backstage application. ```bash cd packages/app yarn add @roadiehq/backstage-plugin-bitbucket-pullrequest ``` -------------------------------- ### Configure LaunchDarkly Proxy Source: https://github.com/roadiehq/roadie-backstage-plugins/blob/main/plugins/frontend/backstage-plugin-launchdarkly/README.md Sets up the proxy configuration in `app-config.yaml` to connect to the LaunchDarkly API. Requires the `LAUNCHDARKLY_API_KEY` environment variable for authorization. ```yaml proxy: '/launchdarkly/api': target: https://app.launchdarkly.com/api headers: Authorization: ${LAUNCHDARKLY_API_KEY} ``` -------------------------------- ### Install Bugsnag Plugin Dependency (Bash) Source: https://github.com/roadiehq/roadie-backstage-plugins/blob/main/plugins/frontend/backstage-plugin-bugsnag/README.md Installs the Bugsnag plugin package into the Backstage application's `packages/app` directory using yarn. ```bash cd packages/app yarn add @roadiehq/backstage-plugin-bugsnag ``` -------------------------------- ### Initialize Rag AI Backend with OpenAI Source: https://github.com/roadiehq/roadie-backstage-plugins/blob/main/plugins/backend/rag-ai-backend/README.md Initializes the Rag AI Backend with OpenAI embeddings and LLM. It requires configuration of catalog client, vector store, and LLM. Dependencies include various @roadiehq packages and @langchain/openai. ```typescript // './plugins/ai' import { createApiRoutes as initializeRagAiBackend } from '@roadiehq/rag-ai-backend'; import { initializeOpenAiEmbeddings } from '@roadiehq/rag-ai-backend-embeddings-openai'; import { createRoadiePgVectorStore } from '@roadiehq/rag-ai-storage-pgvector'; import { createDefaultRetrievalPipeline } from '@roadiehq/rag-ai-backend-retrieval-augmenter'; import { OpenAI } from '@langchain/openai'; import { CatalogClient } from '@backstage/catalog-client'; import { DefaultAwsCredentialsManager } from '@backstage/integration-aws-node'; export default async function createPlugin({ logger, database, discovery, config, }: PluginEnvironment) { const catalogApi = new CatalogClient({ discoveryApi: discovery, }); const vectorStore = await createRoadiePgVectorStore({ logger, database }); const augmentationIndexer = await initializeOpenAiEmbeddings({ logger, catalogApi, vectorStore, discovery, config, }); const model = new OpenAI(); const ragAi = await initializeRagAiBackend({ logger, augmentationIndexer, retrievalPipeline: createDefaultRetrievalPipeline({ discovery, logger, vectorStore: augmentationIndexer.vectorStore, auth, }), model, config, }); return ragAi.router; } ``` -------------------------------- ### Configuring Multiple Prometheus Instances (YAML) Source: https://github.com/roadiehq/roadie-backstage-plugins/blob/main/plugins/frontend/backstage-plugin-prometheus/README.md Sets up multiple Prometheus instances in Backstage by mapping proxy paths and UI URLs. Requires matching 'prometheus.io/service-name' annotation with Backstage configuration. ```yaml proxy: '/prometheus/api': target: http://localhost:9090/api/v1/ '/prometheusTeamB/api': target: http://localhost:9999/api/v1/ prometheus: proxyPath: /prometheus/api uiUrl: http://localhost:9090 instances: - name: prometheusTeamB proxyPath: /prometheusTeamB/api uiUrl: http://localhost:9999 ``` -------------------------------- ### Write Content to File using Backstage Scaffolder Template Source: https://github.com/roadiehq/roadie-backstage-plugins/blob/main/plugins/scaffolder-actions/scaffolder-backend-module-utils/README.md This Backstage scaffolder template demonstrates how to write content to a file. It takes repository details, a branch name, a file path, and the content to write as parameters. The template uses actions like 'fetch:plain', 'roadiehq:utils:fs:write', 'publish:github:pull-request', and 'debug:log'. ```yaml --- apiVersion: scaffolder.backstage.io/v1beta3 kind: Template metadata: name: overwrite-file-template-example title: Write content to a file description: Write a file with the given content. spec: owner: roadie type: service parameters: - title: PR Data properties: repository: title: Repository name type: string description: The name of the repository org: title: Repository Organization type: string description: The Github org that the repository is in pr_branch: title: PR Branch type: string description: The new branch to make a pr from - title: Append content properties: path: title: Path type: string description: The path to the file you want to append this content to in the scaffolder workspace content: title: Text area input type: string description: Add your new entity ui:widget: textarea ui:options: rows: 10 ui:help: 'Make sure it is valid by checking the schema at `/tools/entity-preview`' ui:placeholder: | --- apiVersion: backstage.io/v1alpha1 kind: Component metadata: name: backstage spec: type: library owner: CNCF lifecycle: experimental steps: - id: fetch-repo name: Fetch repo action: fetch:plain input: url: https://github.com/${{ parameters.org }}/${{ parameters.repository }} - id: write-to-file name: Overwrite File Or Create New action: roadiehq:utils:fs:write input: path: ${{ parameters.path }} content: ${{ parameters.content }} - id: publish-pr name: Publish PR action: publish:github:pull-request input: repoUrl: github.com?repo=${{ parameters.repository }}&owner=${{ parameters.org }} branchName: ${{ parameters.pr_branch }} title: Write content to ${{ parameters.path }} description: This PR was created by a Backstage scaffolder task - id: log-message name: Log PR URL action: debug:log input: message: 'RemoteURL: ${{ steps["publish-pr"].output.remoteUrl }}' ``` -------------------------------- ### Configure Multiple Argo CD Instances with Proxy Source: https://github.com/roadiehq/roadie-backstage-plugins/blob/main/plugins/frontend/backstage-plugin-argo-cd/README.md Sets up proxy configurations for multiple Argo CD instances in `app-config.yaml`, each with a unique path and potentially different authentication tokens defined in environment variables. ```yaml proxy: ... '/argocd/api': target: https:///api/v1/ changeOrigin: true secure: false headers: Cookie: $env: ARGOCD_AUTH_TOKEN '/argocd/api2': target: https:///api/v1/ changeOrigin: true secure: false headers: Cookie: $env: ARGOCD_AUTH_TOKEN2 ``` -------------------------------- ### Initialize AWS Bedrock Embeddings and LLM for Rag AI Backend Source: https://github.com/roadiehq/roadie-backstage-plugins/blob/main/plugins/backend/rag-ai-backend/README.md This TypeScript code snippet demonstrates how to initialize AWS Bedrock embeddings and an LLM for the Rag AI Backend in a Backstage project. It requires importing necessary modules from various @roadiehq and @backstage packages, configuring AWS credentials, setting up a vector store, and then initializing the Bedrock LLM and the AI backend itself. Dependencies include @roadiehq/rag-ai-backend, @roadiehq/rag-ai-storage-pgvector, @backstage/catalog-client, @roadiehq/rag-ai-backend-retrieval-augmenter, @roadiehq/rag-ai-backend-embeddings-aws, @backstage/integration-aws-node, and @langchain/community/llms/bedrock. ```typescript import { createApiRoutes as initializeRagAiBackend } from '@roadiehq/rag-ai-backend'; import { PluginEnvironment } from '../types'; import { createRoadiePgVectorStore } from '@roadiehq/rag-ai-storage-pgvector'; import { CatalogClient } from '@backstage/catalog-client'; import { createDefaultRetrievalPipeline } from '@roadiehq/rag-ai-backend-retrieval-augmenter'; import { initializeBedrockEmbeddings } from '@roadiehq/rag-ai-backend-embeddings-aws'; import { DefaultAwsCredentialsManager } from '@backstage/integration-aws-node'; import { Bedrock } from '@langchain/community/llms/bedrock'; export default async function createPlugin({ logger, auth, database, discovery, config, }: PluginEnvironment) { const catalogApi = new CatalogClient({ discoveryApi: discovery, }); const vectorStore = await createRoadiePgVectorStore({ logger, database, config, }); const awsCredentialsManager = DefaultAwsCredentialsManager.fromConfig(config); const credProvider = await awsCredentialsManager.getCredentialProvider(); const augmentationIndexer = await initializeBedrockEmbeddings({ logger, auth, catalogApi, vectorStore, discovery, config, options: { region: 'us-east-1', credentials: credProvider.sdkCredentialProvider, }, }); const model = new Bedrock({ maxTokens: 4096, // model: 'anthropic.claude-instant-v1', // 'amazon.titan-text-express-v1', 'anthropic.claude-v2', 'mistral-xx'* model: 'amazon.titan-text-express-v1', region: 'us-east-1', credentials: credProvider.sdkCredentialProvider, }); const ragAi = await initializeRagAiBackend({ logger, augmentationIndexer, retrievalPipeline: createDefaultRetrievalPipeline({ discovery, logger, vectorStore: augmentationIndexer.vectorStore, auth, }), model, config, }); return ragAi.router; } ``` -------------------------------- ### Install SelectFieldFromApiExtension in App.tsx Source: https://github.com/roadiehq/roadie-backstage-plugins/blob/main/plugins/scaffolder-field-extensions/scaffolder-frontend-module-http-request-field/README.md This code snippet shows how to install the `SelectFieldFromApiExtension` custom scaffolder field by including it within the `ScaffolderFieldExtensions` in your `App.tsx` file. Ensure the `ScaffolderPage` route is correctly configured. ```typescript jsx }> ... ``` -------------------------------- ### Display LaunchDarkly Context Overview Card Source: https://github.com/roadiehq/roadie-backstage-plugins/blob/main/plugins/frontend/backstage-plugin-launchdarkly/README.md Integrates the `EntityLaunchdarklyContextOverviewCard` component into the entity page's overview content. This component is conditionally rendered based on the availability of LaunchDarkly context. ```jsx ``` -------------------------------- ### Add New Plugin to App Source: https://github.com/roadiehq/roadie-backstage-plugins/blob/main/README.md Adds a new plugin to the Backstage application within the 'packages/app' directory and then installs dependencies. ```bash // packages/app yarn add <> // packages/app yarn install ``` -------------------------------- ### Register Rag AI Backend Router in Backstage Source: https://github.com/roadiehq/roadie-backstage-plugins/blob/main/plugins/backend/rag-ai-backend/README.md Demonstrates how to register the AI backend router into a standard Backstage application. It involves creating an environment for the AI plugin and mounting its router under a specific path. ```typescript import ai from './plugins/ai'; // ... async function main() { // ... const aiEnv = useHotMemoize(module, () => createEnv('ai')); const apiRouter = Router(); apiRouter.use('/rag-ai', await ai(aiEnv)); // ... } ``` -------------------------------- ### Add Bitbucket PR Plugin to Entity Page (TypeScript) Source: https://github.com/roadiehq/roadie-backstage-plugins/blob/main/plugins/frontend/backstage-plugin-bitbucket-pullrequest/README.md Example of how to integrate the EntityBitbucketPullRequestsContent component into the Backstage entity page configuration. ```typescript // packages/app/src/components/catalog/EntityPage.tsx import { EntityBitbucketPullRequestsContent } from '@roadiehq/backstage-plugin-bitbucket-pullrequest'; ... const serviceEntityPage = ( ... ... ``` -------------------------------- ### Configure Wiz Dashboard Link in Backstage Source: https://github.com/roadiehq/roadie-backstage-plugins/blob/main/plugins/frontend/backstage-plugin-wiz/README.md Shows how to configure the `app-config.yaml` file to provide the necessary URLs and credentials for the Wiz plugin to connect to the WIZ dashboard and API. ```yaml wiz: dashboardLink: clientId: clientSecret: tokenUrl: wizAPIUrl: ``` -------------------------------- ### Import Buildkite Plugin Components Source: https://github.com/roadiehq/roadie-backstage-plugins/blob/main/plugins/frontend/backstage-plugin-buildkite/README.md Imports the necessary components and utility functions from the Buildkite plugin into your Backstage application's entity page configuration. This allows you to use the plugin's features within your catalog. ```typescript import { EntityBuildkiteContent, isPluginApplicableToEntity as isBuildkiteAvailable, } from '@roadiehq/backstage-plugin-buildkite'; ``` -------------------------------- ### Add Datadog Plugin Dependency (Shell) Source: https://github.com/roadiehq/roadie-backstage-plugins/blob/main/plugins/frontend/backstage-plugin-datadog/README.md Installs the Datadog plugin package as a dependency in your Backstage project's package.json file using Yarn. ```shell yarn add @roadiehq/backstage-plugin-datadog ``` -------------------------------- ### Import Argo CD Plugin into Backstage Plugins Source: https://github.com/roadiehq/roadie-backstage-plugins/blob/main/plugins/frontend/backstage-plugin-argo-cd/README.md Imports the `argocdPlugin` from the installed package into your Backstage application's `plugins.ts` file. ```typescript // packages/app/src/plugins.ts export { argocdPlugin } from '@roadiehq/backstage-plugin-argo-cd'; ``` -------------------------------- ### Navigate to Plugin Directory Source: https://github.com/roadiehq/roadie-backstage-plugins/blob/main/README.md Navigates into the directory of a specific plugin, whether it's a backend or frontend plugin. ```bash cd roadie-backstage-plugin/plugins cd backend/frontend cd selected-plugin ``` -------------------------------- ### Add Argo CD Plugin Dependency to Backstage Source: https://github.com/roadiehq/roadie-backstage-plugins/blob/main/plugins/frontend/backstage-plugin-argo-cd/README.md Installs the Argo CD plugin package as a dependency in your Backstage application using Yarn. ```bash yarn add @roadiehq/backstage-plugin-argo-cd ``` -------------------------------- ### Add LaunchDarkly Project Overview Route Source: https://github.com/roadiehq/roadie-backstage-plugins/blob/main/plugins/frontend/backstage-plugin-launchdarkly/README.md Defines a new route `/launch-darkly-projects` within the service entity page layout to display the `EntityLaunchdarklyProjectOverviewContent` component. ```jsx ``` -------------------------------- ### GET /aws/credentials Source: https://github.com/roadiehq/roadie-backstage-plugins/blob/main/plugins/backend/backstage-plugin-aws-auth/README.md Retrieves temporary AWS credentials. This endpoint is suitable for direct use of AWS SDKs from the frontend when no specific IAM role is required. ```APIDOC ## GET /aws/credentials ### Description Retrieves temporary AWS credentials that can be used by the AWS SDK in the frontend. ### Method GET ### Endpoint /aws/credentials ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **AccessKeyId** (string) - The AWS access key ID. - **SecretAccessKey** (string) - The AWS secret access key. - **SessionToken** (string) - The AWS session token. #### Response Example ```json { "AccessKeyId": "ASIA...", "SecretAccessKey": "...", "SessionToken": "..." } ``` ``` -------------------------------- ### Replace Text in Files using Backstage Scaffolder Action Source: https://github.com/roadiehq/roadie-backstage-plugins/blob/main/plugins/scaffolder-actions/scaffolder-backend-module-utils/README.md This Backstage scaffolder example demonstrates the 'roadiehq:utils:fs:replace' action, which replaces specified text within files. It requires a list of files, each with a path, text to find, and text to replace with. An optional 'matchRegex' parameter can treat the 'find' text as a regular expression. ```yaml --- parameters: templated_text: title: Replacer type: string description: Text you want to use to replace i_want_to_replace_this steps: - id: Replace text in file name: Replace action: roadiehq:utils:fs:replace input: files: - file: './file.1' find: 'i_want_to_replace_this' replaceWith: ${{ parameters.templated_text }} ``` -------------------------------- ### Import Cloudsmith Components for Backstage Homepage Source: https://github.com/roadiehq/roadie-backstage-plugins/blob/main/plugins/frontend/backstage-plugin-cloudsmith/README.md Imports necessary components from the @roadiehq/backstage-plugin-cloudsmith package to display Cloudsmith data on the Backstage homepage. Ensure the package is installed. ```typescript jsx import { CloudsmithStatsCard, CloudsmithQuotaCard, CloudsmithRepositoryAuditLogCard, CloudsmithRepositorySecurityCard, CloudsmithPackageListCard, } from '@roadiehq/backstage-plugin-cloudsmith'; ``` -------------------------------- ### Configure Okta Provider with API Token Source: https://github.com/roadiehq/roadie-backstage-plugins/blob/main/plugins/backend/catalog-backend-module-okta/README.md Basic configuration for the Okta provider in app-config.yaml using an API token. Includes organization URL, token, and schedule settings for data refresh. ```yaml catalog: providers: okta: - orgUrl: 'https://tenant.okta.com' token: ${OKTA_TOKEN} schedule: frequency: minutes: 5 timeout: minutes: 10 initialDelay: minutes: 1 ``` -------------------------------- ### Add Bitbucket Annotation to Component (YAML) Source: https://github.com/roadiehq/roadie-backstage-plugins/blob/main/plugins/frontend/backstage-plugin-bitbucket-pullrequest/README.md Example of how to add the necessary annotation to a component's YAML configuration file to enable the Bitbucket Pull Request plugin. ```yaml metadata: annotations: bitbucket.com/project-slug: / ```