Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions workspaces/x2a/.changeset/ready-plants-try.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
'@red-hat-developer-hub/backstage-plugin-scaffolder-backend-module-x2a': major
'@red-hat-developer-hub/backstage-plugin-x2a-mcp-extras': major
'@red-hat-developer-hub/backstage-plugin-x2a-backend': major
'@red-hat-developer-hub/backstage-plugin-x2a-common': major
'@red-hat-developer-hub/backstage-plugin-x2a-node': major
'@red-hat-developer-hub/backstage-plugin-x2a-dcr': major
'@red-hat-developer-hub/backstage-plugin-x2a': major
---

Updating x2a plugins to RHDH 1.10, including NFS for testing.
2 changes: 2 additions & 0 deletions workspaces/x2a/.eslintignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
playwright.config.ts
e2e-tests/
scripts
2 changes: 1 addition & 1 deletion workspaces/x2a/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,4 @@ site
*.session.sql

# E2E test reports
e2e-test-report/
e2e-test-report*/
44 changes: 42 additions & 2 deletions workspaces/x2a/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,15 +75,15 @@ See the [backend plugin README](./plugins/x2a-backend/README.md) for detailed co

This command runs both the frontend and backend plugins in parallel. The frontend will be available at `http://localhost:3000` and the backend at `http://localhost:7007`.

Eventually run the full Backstage application for more advanced testing or development, i.e. scaffolder or RBAC:
Eventually run the full Backstage application for more advanced testing or development, i.e. scaffolder or RBAC.

```sh
export AUTH_GITHUB_CLIENT_ID=.... # Optional if "guest" user is not enough
export AUTH_GITHUB_CLIENT_SECRET=... # Optional if "guest" user is not enough
export AUTH_GITLAB_CLIENT_ID=...
export AUTH_GITLAB_CLIENT_SECRET=...

yarn start
yarn start # starts the app + backend
```

## SCM Provider Detection
Expand Down Expand Up @@ -274,6 +274,42 @@ yarn dev

When running inside a Kubernetes cluster, the plugin will automatically fall back to in-cluster configuration if no local kubeconfig is found.

### TLS Certificate Handling

Dev clusters (CRC, minikube, kind) often use self-signed certificates that Node.js rejects by default. If you see TLS errors such as `UNABLE_TO_VERIFY_LEAF_SIGNATURE` or `DEPTH_ZERO_SELF_SIGNED_CERT` when the plugin connects to the cluster, use one of the approaches below.

#### Recommended: trust the cluster CA

Set `NODE_EXTRA_CA_CERTS` to point to the cluster's CA certificate **before** starting the backend. This trusts the CA without disabling TLS verification globally.

**OpenShift / CRC** -- extract the CA from the cluster:

```sh
oc get configmap kube-root-ca.crt -n openshift-config \
-o jsonpath='{.data.ca\.crt}' > /tmp/cluster-ca.crt
export NODE_EXTRA_CA_CERTS=/tmp/cluster-ca.crt
yarn dev
```

**In-cluster (OCP deployment)** - the [sample app.yaml](https://github.com/x2ansible/x2ansible.github.io/blob/main/deploy/app.yaml) already sets:

```yaml
env:
- name: NODE_EXTRA_CA_CERTS
value: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
```

#### Fallback (development only): disable TLS verification

If extracting the CA is not practical, you can disable TLS verification entirely. This must be set explicitly by the developer in the shell - the plugin does **not** set it automatically:

```sh
export NODE_TLS_REJECT_UNAUTHORIZED=0
yarn dev
```

**Warning:** `NODE_TLS_REJECT_UNAUTHORIZED=0` disables certificate verification for **all** outbound HTTPS connections in the Node.js process, not just Kubernetes. **Do not use this in production.**

### Verifying Kubernetes Connection

The plugin's `KubeService` provides methods to interact with Kubernetes resources. Check the logs when starting the backend to see if the Kubernetes configuration was loaded successfully:
Expand Down Expand Up @@ -315,13 +351,17 @@ The first run downloads the `postgres:18` image.

- `yarn test` - Run tests (SQLite only)
- `yarn test:pg` - Run tests (SQLite + PostgreSQL via testcontainers)
- `yarn test:e2e` - Run e2e tests
- `yarn lint` - Run linter
- `yarn prettier:fix` - Fix code formatting
- `yarn build:all` - Build all packages
- `yarn clean` - Clean build artifacts

## Project Structure

- `packages/app/` - Frontend app (New Frontend System)
- `packages/backend/` - Backend app for local development
- `e2e-tests/` - Workspace-level e2e tests
- `plugins/x2a/` - Frontend plugin
- `plugins/x2a-backend/` - Backend plugin
- `src/schema/openapi.yaml` - OpenAPI specification
Expand Down
10 changes: 10 additions & 0 deletions workspaces/x2a/app-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
app:
title: X2Ansible Convertor
baseUrl: http://localhost:3000
extensions:
- 'api:app/app-language':
config:
defaultLanguage: en
availableLanguages:
- en
- de
- es
- fr
- it

organization:
name: Red Hat
Expand Down
2 changes: 1 addition & 1 deletion workspaces/x2a/backstage.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{ "version": "1.45.3" }
{ "version": "1.49.4" }
10 changes: 10 additions & 0 deletions workspaces/x2a/e2e-tests/test_yamls/app-config-e2e-de.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# German (DE) - Ports: Frontend 3001, Backend 7008
app:
baseUrl: http://localhost:3001

backend:
baseUrl: http://localhost:7008
listen:
port: 7008
cors:
origin: http://localhost:3001
10 changes: 10 additions & 0 deletions workspaces/x2a/e2e-tests/test_yamls/app-config-e2e-en.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# English (EN) - Ports: Frontend 3000, Backend 7007
app:
baseUrl: http://localhost:3000

backend:
baseUrl: http://localhost:7007
listen:
port: 7007
cors:
origin: http://localhost:3000
10 changes: 10 additions & 0 deletions workspaces/x2a/e2e-tests/test_yamls/app-config-e2e-es.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Spanish (ES) - Ports: Frontend 3002, Backend 7009
app:
baseUrl: http://localhost:3002

backend:
baseUrl: http://localhost:7009
listen:
port: 7009
cors:
origin: http://localhost:3002
10 changes: 10 additions & 0 deletions workspaces/x2a/e2e-tests/test_yamls/app-config-e2e-fr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# French (FR) - Ports: Frontend 3003, Backend 7010
app:
baseUrl: http://localhost:3003

backend:
baseUrl: http://localhost:7010
listen:
port: 7010
cors:
origin: http://localhost:3003
10 changes: 10 additions & 0 deletions workspaces/x2a/e2e-tests/test_yamls/app-config-e2e-it.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Italian (IT) - Ports: Frontend 3004, Backend 7011
app:
baseUrl: http://localhost:3004

backend:
baseUrl: http://localhost:7011
listen:
port: 7011
cors:
origin: http://localhost:3004
45 changes: 33 additions & 12 deletions workspaces/x2a/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
"node": "22 || 24"
},
"scripts": {
"dev": "NODE_OPTIONS=--no-node-snapshot ; yarn workspaces foreach -A --include @red-hat-developer-hub/backstage-plugin-x2a --include @red-hat-developer-hub/backstage-plugin-x2a-backend --parallel -v -i run start",
"start": "NODE_OPTIONS=--no-node-snapshot ; backstage-cli repo start",
"dev": "NODE_OPTIONS=--no-node-snapshot yarn workspaces foreach -A --include @red-hat-developer-hub/backstage-plugin-x2a --include @red-hat-developer-hub/backstage-plugin-x2a-backend --parallel -v -i run start",
"start": "NODE_OPTIONS=--no-node-snapshot backstage-cli repo start",
"build:backend": "yarn workspace backend build",
"build:all": "backstage-cli repo build --all",
"build:api-reports": "yarn tsc:full; yarn build:api-reports:only",
Expand All @@ -22,15 +22,19 @@
"test:pg": "CI=true backstage-cli repo test",
"test:all": "yarn openapi-generate && yarn prettier:check && yarn lint:all && backstage-cli repo test --coverage",
"test:all:pg": "yarn openapi-generate && yarn prettier:check && yarn lint:all && CI=true backstage-cli repo test --coverage",
"test:e2e": "echo Skipping until we have tests: playwright test",
"test:e2e": "yarn test:e2e:all",
"test:e2e:nfs": "playwright test",
"test:e2e:all": "yarn test:e2e:nfs",
"playwright": "bash -c 'if [[ $1 == test ]]; then echo \"Skipping test:e2e:all e2e tests (no real tests yet)\"; else npx playwright \"$@\"; fi' _",
"fix": "backstage-cli repo fix --publish",
"lint": "backstage-cli repo lint --since origin/main",
"lint:all": "backstage-cli repo lint",
"prettier:check": "prettier --check .",
"prettier:fix": "prettier --write .",
"chores": "yarn prettier:fix && yarn lint:all --fix && yarn tsc:full && yarn build:api-reports && yarn test:all:pg",
"new": "backstage-cli new --scope @red-hat-developer-hub",
"postinstall": "cd ../../ && yarn install"
"postinstall": "cd ../../ && yarn install",
"enable-in-rhdh-repo": "node scripts/export-to-rhdh-repo.js && node scripts/update-config-in-rhdh-repo.js"
},
"workspaces": {
"packages": [
Expand All @@ -44,11 +48,17 @@
"directory": "workspaces/x2a"
},
"devDependencies": {
"@backstage/cli": "^0.34.5",
"@backstage/e2e-test-utils": "^0.1.1",
"@backstage/repo-tools": "^0.16.0",
"@backstage/cli": "0.36.0",
"@backstage/cli-defaults": "0.1.0",
"@backstage/e2e-test-utils": "^0.1.2",
"@backstage/repo-tools": "^0.17.0",
"@changesets/cli": "^2.27.1",
"@jest/environment-jsdom-abstract": "30.3.0",
"@playwright/test": "1.60.0",
"@types/jest": "30.0.0",
"enquirer": "^2.4.1",
"jest": "30.3.0",
"jsdom": "27.4.0",
"knip": "^5.27.4",
"node-gyp": "^9.0.0",
"prettier": "^3.7.4",
Expand All @@ -58,11 +68,22 @@
"isolated-vm": "^6.0.1",
"@types/react": "^18",
"@types/react-dom": "^18",
"@backstage/backend-plugin-api": "1.5.0",
"@backstage/backend-defaults": "0.13.2",
"@backstage/plugin-auth-node": "0.6.10",
"@backstage/plugin-permission-backend": "0.7.3",
"@backstage/core-app-api": "1.19.2"
"@backstage/frontend-plugin-api": "0.15.1",
"@backstage/frontend-defaults": "0.5.0",
"@backstage/frontend-app-api": "0.16.1",
"@backstage/plugin-app": "0.4.2",
"@backstage/plugin-app-react": "0.2.1",
"@backstage/core-compat-api": "0.5.9",
"@backstage/core-plugin-api": "1.12.4",
"@backstage/core-components": "0.18.8",
"@backstage/filter-predicates": "0.1.1",
"@backstage/plugin-catalog": "2.0.1",
"@backstage/plugin-catalog-react": "2.1.1",
"@backstage/plugin-scaffolder": "1.36.1",
"@backstage/plugin-scaffolder-react": "1.20.0",
"@backstage/plugin-user-settings": "0.9.1",
"zod@^3.25.76 || ^4.0.0": "3.25.76",
"zod@^3.25 || ^4.0": "3.25.76"
},
"prettier": "@backstage/cli/config/prettier",
"lint-staged": {
Expand Down
1 change: 0 additions & 1 deletion workspaces/x2a/packages/app/.eslintignore

This file was deleted.

61 changes: 20 additions & 41 deletions workspaces/x2a/packages/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
"directory": "workspaces/x2a/packages/app"
},
"backstage": {
"role": "frontend",
"supported-versions": "1.45.0"
"role": "frontend"
},
"scripts": {
"start": "backstage-cli package start",
Expand All @@ -20,55 +19,35 @@
"lint": "backstage-cli package lint"
},
"dependencies": {
"@backstage/app-defaults": "^1.7.2",
"@backstage/catalog-model": "^1.7.6",
"@backstage/cli": "^0.34.5",
"@backstage/core-app-api": "^1.19.2",
"@backstage/core-components": "^0.18.3",
"@backstage/core-plugin-api": "1.12.0",
"@backstage/integration-react": "1.2.12",
"@backstage/plugin-api-docs": "^0.13.1",
"@backstage/plugin-catalog": "^1.32.0",
"@backstage/plugin-catalog-common": "^1.1.7",
"@backstage/plugin-catalog-graph": "^0.5.3",
"@backstage/plugin-catalog-import": "^0.13.7",
"@backstage/plugin-catalog-react": "^1.21.3",
"@backstage/plugin-kubernetes": "^0.12.10",
"@backstage/plugin-notifications": "^0.5.8",
"@backstage/plugin-org": "^0.6.46",
"@backstage/plugin-permission-react": "^0.4.38",
"@backstage/plugin-scaffolder": "1.34.3",
"@backstage/plugin-scaffolder-react": "1.19.3",
"@backstage/plugin-search": "^1.5.0",
"@backstage/plugin-search-react": "^1.10.0",
"@backstage/plugin-signals": "^0.0.22",
"@backstage/plugin-techdocs": "^1.14.1",
"@backstage/plugin-techdocs-module-addons-contrib": "^1.1.27",
"@backstage/plugin-techdocs-react": "^1.3.2",
"@backstage/plugin-user-settings": "^0.8.29",
"@backstage/theme": "^0.7.0",
"@backstage/ui": "^0.9.1",
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.9.1",
"@red-hat-developer-hub/backstage-plugin-x2a": "workspace:*",
"@red-hat-developer-hub/backstage-plugin-x2a-dcr": "workspace:*",
"@backstage/cli": "^0.36.0",
"@backstage/core-compat-api": "^0.5.9",
"@backstage/core-components": "^0.18.8",
"@backstage/core-plugin-api": "^1.12.4",
"@backstage/frontend-defaults": "^0.5.0",
"@backstage/frontend-plugin-api": "^0.15.1",
"@backstage/integration-react": "^1.2.16",
"@backstage/plugin-app-react": "^0.2.1",
"@backstage/plugin-catalog": "^2.0.1",
"@backstage/plugin-scaffolder": "^1.36.1",
"@backstage/plugin-user-settings": "^0.9.1",
"@backstage/ui": "^0.13.2",
"@mui/icons-material": "^5.17.1",
"@mui/material": "^5.17.1",
"@red-hat-developer-hub/backstage-plugin-theme": "^0.14.0",
"@red-hat-developer-hub/backstage-plugin-x2a": "workspace:^",
"react": "^18.0.2",
"react-dom": "^18.0.2",
"react-router": "^6.3.0",
"react-router-dom": "^6.3.0"
},
"devDependencies": {
"@backstage/test-utils": "^1.7.13",
"@testing-library/dom": "^9.0.0",
"@backstage/test-utils": "^1.7.16",
"@testing-library/dom": "^10.0.0",
"@testing-library/jest-dom": "^6.0.0",
"@testing-library/react": "^14.0.0",
"@testing-library/user-event": "^14.0.0",
"@testing-library/react": "^16.0.0",
"@types/react-dom": "*",
"cross-env": "^7.0.0"
},
"peerDependencies": {
"@playwright/test": "1.60.0"
},
"browserslist": {
"production": [
">0.2%",
Expand Down
43 changes: 0 additions & 43 deletions workspaces/x2a/packages/app/src/App.test.tsx

This file was deleted.

Loading
Loading