Skip to content

Commit 7c2a1c6

Browse files
feat(bulk-import): add documentation for Bulk Import Scaffolder template parameters (#1667)
Signed-off-by: Oleksandr Andriienko <[email protected]>
1 parent 72ea392 commit 7c2a1c6

File tree

1 file changed

+59
-0
lines changed
  • workspaces/bulk-import/plugins/bulk-import-backend

1 file changed

+59
-0
lines changed

workspaces/bulk-import/plugins/bulk-import-backend/README.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,65 @@ For the RHDH instance to use the scaffolder functionality, it must be run with t
117117
export NODE_OPTIONS=--no-node-snapshot
118118
```
119119

120+
##### Scaffolder Template Input Parameters
121+
122+
The **Bulk Import plugin** executes a Scaffolder template task with specified parameters. The Scaffolder template author should use these parameters within the template.
123+
124+
The Bulk Import plugin parses Git repository information and provides the following parameters for the Scaffolder template task:
125+
126+
- **`repoUrl`** – Normalized repository URL in the format:
127+
${gitProviderHost}?owner=${owner}&repo=${repository-name}
128+
129+
**Example:** `https://github.com/redhat-developer/rhdh-plugins` will be transformed to:
130+
`github.com?owner=redhat-developer&repo=rhdh-plugins`.
131+
132+
- **`name`** – Repository name.
133+
**Example:** For `https://github.com/redhat-developer/rhdh-plugins`, the `name` will be `rhdh-plugins`.
134+
135+
- **`organization`** – Repository owner, which can be a user nickname or organization name.
136+
**Example:** For `https://github.com/redhat-developer/rhdh-plugins`, `organization` will be `redhat-developer`.
137+
138+
- **`branchName`** – Proposed repository branch. By default, it is `bulk-import-catalog-entity`.
139+
140+
- **`targetBranchName`** – Default branch of the Git repository.
141+
142+
- **`gitProviderHost`** – Git provider host parsed from the repository URL.
143+
**Example:** For `https://github.com/redhat-developer/rhdh-plugins`, `gitProviderHost` will be `github.com`.
144+
This parameter allows the template author to write Git-provider-agnostic templates.
145+
146+
### Example of Using Parameters in a Scaffolder Template
147+
148+
```yaml
149+
parameters:
150+
- title: Repository Details
151+
required:
152+
- repoUrl
153+
- branchName
154+
- targetBranchName
155+
- name
156+
- organization
157+
properties:
158+
repoUrl:
159+
type: string
160+
title: Repository URL (Backstage format)
161+
description: 'e.g. github.com?owner=Org&repo=repoName or gitlab.com?owner=Org&repo=repoName'
162+
organization:
163+
type: string
164+
title: Owner of the Repository
165+
name:
166+
type: string
167+
title: Name of the repository
168+
branchName:
169+
type: string
170+
title: Branch to add the catalog entity to
171+
targetBranchName:
172+
type: string
173+
title: Branch to target the PR/MR to
174+
gitProviderHost:
175+
type: string
176+
title: Git provider host
177+
```
178+
120179
### Audit Logging
121180
122181
Audit logging is backed by the [`@backstage/backend-plugin-api`](https://www.npmjs.com/package/@backstage/backend-plugin-api) package.

0 commit comments

Comments
 (0)