Skip to content

Commit 7351c9b

Browse files
feat(e2e): migrate bulk-import tests from rhdh repo
Signed-off-by: Oleksandr Andriienko <oandriie@redhat.com>
1 parent 200088e commit 7351c9b

9 files changed

Lines changed: 1186 additions & 136 deletions

File tree

workspaces/bulk-import/e2e-tests/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"devDependencies": {
2525
"@eslint/js": "^9.39.2",
2626
"@playwright/test": "^1.56.1",
27-
"@red-hat-developer-hub/e2e-test-utils": "^1.1.22",
27+
"@red-hat-developer-hub/e2e-test-utils": "AndrienkoAleksandr/rhdh-e2e-test-utils#force-deploy",
2828
"@types/node": "^24.10.1",
2929
"dotenv": "^16.4.7",
3030
"eslint": "^9.39.2",
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# rhdh app config file
2+
# this file is used to merge with the default values of the rhdh app config
3+
4+
integrations:
5+
github:
6+
- host: github.com
7+
token: ${VAULT_GITHUB_USER_TOKEN}
8+
gitlab:
9+
- host: gitlab.com
10+
token: temp
11+
12+
bulkImport:
13+
importAPI: orchestrator
14+
orchestratorWorkflow: universal-pr
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,55 @@
11
# rhdh app config file
22
# this file is used to merge with the default values of the rhdh app config
33

4+
catalog:
5+
import:
6+
entityFilename: catalog-info.yaml
7+
pullRequestBranchName: backstage-integration
8+
rules:
9+
- allow: [Component, System, Group, User, Resource, Location, Template, API]
10+
locations:
11+
- type: url
12+
target: https://github.com/cloud-eda/janus-test-3-bulk-import/blob/main/catalog-info.yaml
13+
414
integrations:
515
github:
616
- host: github.com
717
token: ${VAULT_GITHUB_USER_TOKEN}
818
gitlab:
919
- host: gitlab.com
1020
token: temp
21+
22+
permission:
23+
enabled: true
24+
rbac:
25+
maxDepth: 1
26+
policyFileReload: true
27+
policies-csv-file: "./rbac/rbac-policy.csv"
28+
pluginsWithPermission:
29+
- catalog
30+
- permission
31+
- scaffolder
32+
- bulk-import
33+
# admin:
34+
# users:
35+
# todo remove it.
36+
# - name: user:default/test1
37+
policyDecisionPrecedence: conditional # default behavior
38+
includeTransitiveGroupOwnership: true
39+
40+
bulkImport:
41+
instructionsEnabled: true
42+
instructionsDefaultExpanded: true
43+
instructionsSteps:
44+
- id: "step1"
45+
text: "Choose a source control tool for pull request creation"
46+
icon: "approval-tool"
47+
- id: "step2"
48+
text: "Choose which items you want to import"
49+
icon: "search"
50+
- id: "step3"
51+
text: "Generate a catalog-info.yaml file for each selected item"
52+
icon: "build"
53+
- id: "step4"
54+
text: "View the pull/merge request details"
55+
icon: "kind:api"
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
plugins:
2+
# bulk-import plugins
3+
- package: ./dynamic-plugins/dist/red-hat-developer-hub-backstage-plugin-bulk-import-backend-dynamic
4+
disabled: false
5+
- package: ./dynamic-plugins/dist/red-hat-developer-hub-backstage-plugin-bulk-import
6+
disabled: false
7+
pluginConfig:
8+
dynamicPlugins:
9+
frontend:
10+
red-hat-developer-hub.backstage-plugin-bulk-import:
11+
appIcons:
12+
- name: bulkImportIcon
13+
importName: BulkImportIcon
14+
dynamicRoutes:
15+
- path: /bulk-import/repositories
16+
importName: BulkImportPage
17+
menuItem:
18+
icon: bulkImportIcon
19+
text: Bulk import
20+
21+
- package: ./dynamic-plugins/dist/backstage-plugin-scaffolder-backend-module-github-dynamic
22+
disabled: true
23+
24+
# Group: Orchestrator
25+
- package: "oci://ghcr.io/redhat-developer/rhdh-plugin-export-overlays/red-hat-developer-hub-backstage-plugin-orchestrator:bs_1.45.3__5.3.1"
26+
disabled: false
27+
pluginConfig:
28+
dynamicPlugins:
29+
frontend:
30+
red-hat-developer-hub.backstage-plugin-orchestrator:
31+
appIcons:
32+
- importName: OrchestratorIcon
33+
name: orchestratorIcon
34+
dynamicRoutes:
35+
- importName: OrchestratorPage
36+
menuItem:
37+
icon: orchestratorIcon
38+
text: Orchestrator
39+
textKey: menuItem.orchestrator
40+
path: /orchestrator
41+
entityTabs:
42+
- path: /workflows
43+
title: Workflows
44+
titleKey: catalog.entityPage.workflows.title
45+
mountPoint: entity.page.workflows
46+
mountPoints:
47+
- mountPoint: entity.page.workflows/cards
48+
importName: OrchestratorCatalogTab
49+
config:
50+
layout:
51+
gridColumn: 1 / -1
52+
if:
53+
anyOf:
54+
- IsOrchestratorCatalogTabAvailable
55+
56+
- package: "oci://ghcr.io/redhat-developer/rhdh-plugin-export-overlays/red-hat-developer-hub-backstage-plugin-orchestrator-backend:bs_1.45.3__8.5.1"
57+
disabled: false
58+
pluginConfig:
59+
orchestrator:
60+
dataIndexService:
61+
url: http://sonataflow-platform-data-index-service.orchestrator.svc.cluster.local:80
62+
63+
- package: "oci://ghcr.io/redhat-developer/rhdh-plugin-export-overlays/red-hat-developer-hub-backstage-plugin-scaffolder-backend-module-orchestrator:bs_1.45.3__1.3.1"
64+
disabled: false
65+
pluginConfig:
66+
orchestrator:
67+
dataIndexService:
68+
url: http://sonataflow-platform-data-index-service.orchestrator.svc.cluster.local:80
69+
70+
- package: "oci://ghcr.io/redhat-developer/rhdh-plugin-export-overlays/red-hat-developer-hub-backstage-plugin-orchestrator-form-widgets:bs_1.45.3__1.6.0"
71+
disabled: false
72+
pluginConfig:
73+
dynamicPlugins:
74+
frontend:
75+
red-hat-developer-hub.backstage-plugin-orchestrator-form-widgets: {}

workspaces/bulk-import/e2e-tests/tests/config/dynamic-plugins.yaml

Lines changed: 0 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@ plugins:
22
# bulk-import plugins
33
- package: ./dynamic-plugins/dist/red-hat-developer-hub-backstage-plugin-bulk-import-backend-dynamic
44
disabled: false
5-
pluginConfig:
6-
bulkImport:
7-
importAPI: orchestrator
8-
orchestratorWorkflow: universal-pr
95
- package: ./dynamic-plugins/dist/red-hat-developer-hub-backstage-plugin-bulk-import
106
disabled: false
117
pluginConfig:
@@ -24,56 +20,3 @@ plugins:
2420

2521
- package: ./dynamic-plugins/dist/backstage-plugin-scaffolder-backend-module-github-dynamic
2622
disabled: true
27-
28-
# Group: Orchestrator
29-
- package: "oci://ghcr.io/redhat-developer/rhdh-plugin-export-overlays/red-hat-developer-hub-backstage-plugin-orchestrator:bs_1.45.3__5.3.1"
30-
disabled: false
31-
pluginConfig:
32-
dynamicPlugins:
33-
frontend:
34-
red-hat-developer-hub.backstage-plugin-orchestrator:
35-
appIcons:
36-
- importName: OrchestratorIcon
37-
name: orchestratorIcon
38-
dynamicRoutes:
39-
- importName: OrchestratorPage
40-
menuItem:
41-
icon: orchestratorIcon
42-
text: Orchestrator
43-
textKey: menuItem.orchestrator
44-
path: /orchestrator
45-
entityTabs:
46-
- path: /workflows
47-
title: Workflows
48-
titleKey: catalog.entityPage.workflows.title
49-
mountPoint: entity.page.workflows
50-
mountPoints:
51-
- mountPoint: entity.page.workflows/cards
52-
importName: OrchestratorCatalogTab
53-
config:
54-
layout:
55-
gridColumn: 1 / -1
56-
if:
57-
anyOf:
58-
- IsOrchestratorCatalogTabAvailable
59-
60-
- package: "oci://ghcr.io/redhat-developer/rhdh-plugin-export-overlays/red-hat-developer-hub-backstage-plugin-orchestrator-backend:bs_1.45.3__8.5.1"
61-
disabled: false
62-
pluginConfig:
63-
orchestrator:
64-
dataIndexService:
65-
url: http://sonataflow-platform-data-index-service.orchestrator.svc.cluster.local:80
66-
67-
- package: "oci://ghcr.io/redhat-developer/rhdh-plugin-export-overlays/red-hat-developer-hub-backstage-plugin-scaffolder-backend-module-orchestrator:bs_1.45.3__1.3.1"
68-
disabled: false
69-
pluginConfig:
70-
orchestrator:
71-
dataIndexService:
72-
url: http://sonataflow-platform-data-index-service.orchestrator.svc.cluster.local:80
73-
74-
- package: "oci://ghcr.io/redhat-developer/rhdh-plugin-export-overlays/red-hat-developer-hub-backstage-plugin-orchestrator-form-widgets:bs_1.45.3__1.6.0"
75-
disabled: false
76-
pluginConfig:
77-
dynamicPlugins:
78-
frontend:
79-
red-hat-developer-hub.backstage-plugin-orchestrator-form-widgets: {}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
kind: ConfigMap
2+
apiVersion: v1
3+
metadata:
4+
name: rbac-policy
5+
labels:
6+
backstage.io/kubernetes-id: developer-hub
7+
data:
8+
rbac-policy.csv: |
9+
g, user:default/test1, role:default/bulk-importer
10+
p, role:default/bulk-importer, bulk-import, use, allow
11+
p, role:default/bulk-importer, catalog-entity, read, allow
12+
p, role:default/bulk-importer, catalog.entity.create, create, allow
13+
p, role:default/bulk-importer, catalog.location.create, create, allow
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
upstream:
2+
image:
3+
registry: quay.io
4+
repository: rhdh-community/rhdh
5+
tag: next
6+
backstage:
7+
extraVolumeMounts:
8+
# NOTE: Lists will not be merged with the default values file. So need to append all the defaults if you want to add a new item here
9+
# See https://issues.redhat.com/browse/RHDHPLAN-869
10+
# The initContainer below will install dynamic plugins in this volume mount.
11+
- name: dynamic-plugins-root
12+
mountPath: /opt/app-root/src/dynamic-plugins-root
13+
- name: extensions-catalog
14+
mountPath: /extensions
15+
- name: temp
16+
mountPath: /tmp
17+
- name: rbac-policy
18+
mountPath: /opt/app-root/src/rbac
19+
extraVolumes:
20+
# NOTE: Lists will not be merged with the default values file. So need to append all the defaults if you want to add a new item here
21+
# See https://issues.redhat.com/browse/RHDHPLAN-869
22+
# -- Ephemeral volume that will contain the dynamic plugins installed by the initContainer below at start.
23+
# To have more control on underlying storage, the [emptyDir](https://docs.openshift.com/container-platform/4.13/storage/understanding-ephemeral-storage.html)
24+
# could be changed to a [generic ephemeral volume](https://docs.openshift.com/container-platform/4.13/storage/generic-ephemeral-vols.html#generic-ephemeral-vols-procedure_generic-ephemeral-volumes).
25+
- name: dynamic-plugins-root
26+
emptyDir: {}
27+
# Volume that will expose the `dynamic-plugins.yaml` file from the `dynamic-plugins` config map.
28+
# The `dynamic-plugins` config map is created by the helm chart from the content of the `global.dynamic` field.
29+
- name: dynamic-plugins
30+
configMap:
31+
defaultMode: 420
32+
name: '{{ printf "%s-dynamic-plugins" .Release.Name }}'
33+
optional: true
34+
# Optional volume that allows exposing the `.npmrc` file (through a `dynamic-plugins-npmrc` secret)
35+
# to be used when running `npm pack` during the dynamic plugins installation by the initContainer.
36+
- name: dynamic-plugins-npmrc
37+
secret:
38+
defaultMode: 420
39+
optional: true
40+
secretName: '{{ printf "%s-dynamic-plugins-npmrc" .Release.Name }}'
41+
- name: dynamic-plugins-registry-auth
42+
secret:
43+
defaultMode: 416
44+
optional: true
45+
secretName: '{{ printf "%s-dynamic-plugins-registry-auth" .Release.Name }}'
46+
- name: npmcacache
47+
emptyDir: {}
48+
# -- Ephemeral volume used by the install-dynamic-plugins init container to extract catalog entities from the catalog index image.
49+
# Mounted at the /extensions path in the backstage-backend main container for automatic discovery by the extension catalog backend providers.
50+
- name: extensions-catalog
51+
emptyDir: {}
52+
- name: temp
53+
emptyDir: {}
54+
- name: rbac-policy
55+
configMap:
56+
defaultMode: 420
57+
name: rbac-policy

0 commit comments

Comments
 (0)