@red-hat-developer-hub/backstage-plugin-bulk-import-backend 6.4.0 → 6.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/config.d.ts +2 -2
- package/dist/generated/openapidocument.cjs.js +6 -0
- package/dist/generated/openapidocument.cjs.js.map +1 -1
- package/dist/service/handlers/import/execute-template.cjs.js +4 -2
- package/dist/service/handlers/import/execute-template.cjs.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
### Dependencies
|
|
2
2
|
|
|
3
|
+
## 6.5.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 8c33ce4: Enable GitLab frontend support. Restore previously removed approval tool parameters in the backend.
|
|
8
|
+
|
|
9
|
+
## 6.4.1
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 4c5967e: Make bulkImport configuration optional again to be backward compatible
|
|
14
|
+
|
|
3
15
|
## 6.4.0
|
|
4
16
|
|
|
5
17
|
### Minor Changes
|
package/config.d.ts
CHANGED
|
@@ -15,11 +15,11 @@
|
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
export interface Config {
|
|
18
|
-
bulkImport
|
|
18
|
+
bulkImport?: {
|
|
19
19
|
/**
|
|
20
20
|
* The name of the scaffolder template to execute for importing a repository.
|
|
21
21
|
* @visibility backend
|
|
22
22
|
*/
|
|
23
|
-
importTemplate
|
|
23
|
+
importTemplate?: string;
|
|
24
24
|
};
|
|
25
25
|
}
|
|
@@ -591,6 +591,9 @@ const OPENAPI = `
|
|
|
591
591
|
"type": "string",
|
|
592
592
|
"default": "main"
|
|
593
593
|
}
|
|
594
|
+
},
|
|
595
|
+
{
|
|
596
|
+
"$ref": "#/components/parameters/approvalToolParam"
|
|
594
597
|
}
|
|
595
598
|
],
|
|
596
599
|
"responses": {
|
|
@@ -633,6 +636,9 @@ const OPENAPI = `
|
|
|
633
636
|
"schema": {
|
|
634
637
|
"type": "string"
|
|
635
638
|
}
|
|
639
|
+
},
|
|
640
|
+
{
|
|
641
|
+
"$ref": "#/components/parameters/approvalToolParam"
|
|
636
642
|
}
|
|
637
643
|
],
|
|
638
644
|
"responses": {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"openapidocument.cjs.js","sources":["../../src/generated/openapidocument.ts"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// eslint-disable\n// prettier-ignore\nconst OPENAPI = `\n{\n \"openapi\": \"3.1.0\",\n \"info\": {\n \"version\": \"1.0\",\n \"title\": \"Bulk Import Backend\",\n \"description\": \"The Bulk Import Backend APIs allow users to bulk import repositories into the Backstage catalog from remote sources such as Git.\"\n },\n \"servers\": [\n {\n \"url\": \"{protocol}://{host}:{port}/{basePath}\",\n \"variables\": {\n \"protocol\": {\n \"enum\": [\n \"http\",\n \"https\"\n ],\n \"default\": \"http\"\n },\n \"host\": {\n \"default\": \"localhost\"\n },\n \"port\": {\n \"default\": \"7007\"\n },\n \"basePath\": {\n \"default\": \"api/bulk-import\"\n }\n }\n }\n ],\n \"paths\": {\n \"/ping\": {\n \"get\": {\n \"operationId\": \"ping\",\n \"summary\": \"Check the health of the Bulk Import backend router\",\n \"tags\": [\n \"Management\"\n ],\n \"responses\": {\n \"200\": {\n \"description\": \"The backend router for the Bulk Import backend is up and running\",\n \"content\": {\n \"application/json\": {\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"status\": {\n \"enum\": [\n \"ok\"\n ]\n }\n }\n },\n \"example\": {\n \"status\": \"ok\"\n }\n }\n }\n }\n }\n }\n },\n \"/organizations\": {\n \"get\": {\n \"operationId\": \"findAllOrganizations\",\n \"summary\": \"Fetch Organizations accessible by Backstage Github Integrations\",\n \"security\": [\n {\n \"BearerAuth\": []\n }\n ],\n \"tags\": [\n \"Organization\"\n ],\n \"parameters\": [\n {\n \"$ref\": \"#/components/parameters/pagePerIntegrationQueryParam\"\n },\n {\n \"$ref\": \"#/components/parameters/sizePerIntegrationQueryParam\"\n },\n {\n \"$ref\": \"#/components/parameters/searchQueryParam\"\n },\n {\n \"$ref\": \"#/components/parameters/approvalToolParam\"\n }\n ],\n \"responses\": {\n \"200\": {\n \"description\": \"Organization list was fetched successfully with no errors\",\n \"content\": {\n \"application/json\": {\n \"schema\": {\n \"$ref\": \"#/components/schemas/OrganizationList\"\n },\n \"examples\": {\n \"multipleRepos\": {\n \"$ref\": \"#/components/examples/multipleOrgs\"\n }\n }\n }\n }\n },\n \"500\": {\n \"description\": \"Generic error when there are errors and no Organization is returned\",\n \"content\": {\n \"application/json\": {\n \"schema\": {\n \"$ref\": \"#/components/schemas/OrganizationList\"\n },\n \"examples\": {\n \"repositoryListErrors\": {\n \"$ref\": \"#/components/examples/orgListErrors\"\n }\n }\n }\n }\n }\n }\n }\n },\n \"/organizations/{organizationName}/repositories\": {\n \"get\": {\n \"operationId\": \"findRepositoriesByOrganization\",\n \"summary\": \"Fetch Repositories in the specified GitHub organization, provided it is accessible by any of the configured GitHub Integrations.\",\n \"security\": [\n {\n \"BearerAuth\": []\n }\n ],\n \"tags\": [\n \"Organization\"\n ],\n \"parameters\": [\n {\n \"in\": \"path\",\n \"name\": \"organizationName\",\n \"description\": \"Organization name\",\n \"required\": true,\n \"schema\": {\n \"type\": \"string\"\n }\n },\n {\n \"in\": \"query\",\n \"name\": \"checkImportStatus\",\n \"description\": \"whether to return import status. Note that this might incur a performance penalty because the import status is computed for each repository.\",\n \"schema\": {\n \"type\": \"boolean\",\n \"default\": \"false\"\n }\n },\n {\n \"$ref\": \"#/components/parameters/pagePerIntegrationQueryParam\"\n },\n {\n \"$ref\": \"#/components/parameters/sizePerIntegrationQueryParam\"\n },\n {\n \"$ref\": \"#/components/parameters/searchQueryParam\"\n },\n {\n \"$ref\": \"#/components/parameters/approvalToolParam\"\n }\n ],\n \"responses\": {\n \"200\": {\n \"description\": \"Org Repository list was fetched successfully with no errors\",\n \"content\": {\n \"application/json\": {\n \"schema\": {\n \"$ref\": \"#/components/schemas/RepositoryList\"\n },\n \"examples\": {\n \"multipleRepos\": {\n \"$ref\": \"#/components/examples/multipleRepos\"\n }\n }\n }\n }\n },\n \"500\": {\n \"description\": \"Generic error when there are errors and no Org Repository is returned\",\n \"content\": {\n \"application/json\": {\n \"schema\": {\n \"$ref\": \"#/components/schemas/RepositoryList\"\n },\n \"examples\": {\n \"repositoryListErrors\": {\n \"$ref\": \"#/components/examples/repositoryListErrors\"\n }\n }\n }\n }\n }\n }\n }\n },\n \"/repositories\": {\n \"get\": {\n \"operationId\": \"findAllRepositories\",\n \"summary\": \"Fetch Organization Repositories accessible by Backstage Github Integrations\",\n \"security\": [\n {\n \"BearerAuth\": []\n }\n ],\n \"tags\": [\n \"Repository\"\n ],\n \"parameters\": [\n {\n \"in\": \"query\",\n \"name\": \"checkImportStatus\",\n \"description\": \"whether to return import status. Note that this might incur a performance penalty because the import status is computed for each repository.\",\n \"schema\": {\n \"type\": \"boolean\",\n \"default\": \"false\"\n }\n },\n {\n \"$ref\": \"#/components/parameters/pagePerIntegrationQueryParam\"\n },\n {\n \"$ref\": \"#/components/parameters/sizePerIntegrationQueryParam\"\n },\n {\n \"$ref\": \"#/components/parameters/searchQueryParam\"\n },\n {\n \"$ref\": \"#/components/parameters/approvalToolParam\"\n }\n ],\n \"responses\": {\n \"200\": {\n \"description\": \"Repository list was fetched successfully with no errors\",\n \"content\": {\n \"application/json\": {\n \"schema\": {\n \"$ref\": \"#/components/schemas/RepositoryList\"\n },\n \"examples\": {\n \"multipleRepos\": {\n \"$ref\": \"#/components/examples/multipleRepos\"\n }\n }\n }\n }\n },\n \"500\": {\n \"description\": \"Generic error when there are errors and no repository is returned\",\n \"content\": {\n \"application/json\": {\n \"schema\": {\n \"$ref\": \"#/components/schemas/RepositoryList\"\n },\n \"examples\": {\n \"repositoryListErrors\": {\n \"$ref\": \"#/components/examples/repositoryListErrors\"\n }\n }\n }\n }\n }\n }\n }\n },\n \"/imports\": {\n \"get\": {\n \"operationId\": \"findAllImports\",\n \"summary\": \"Fetch Import Jobs\",\n \"security\": [\n {\n \"BearerAuth\": []\n }\n ],\n \"tags\": [\n \"Import\"\n ],\n \"parameters\": [\n {\n \"$ref\": \"#/components/parameters/apiVersionHeaderParam\"\n },\n {\n \"$ref\": \"#/components/parameters/pagePerIntegrationQueryParamDeprecated\"\n },\n {\n \"$ref\": \"#/components/parameters/sizePerIntegrationQueryParamDeprecated\"\n },\n {\n \"$ref\": \"#/components/parameters/pageQueryParam\"\n },\n {\n \"$ref\": \"#/components/parameters/sizeQueryParam\"\n },\n {\n \"$ref\": \"#/components/parameters/sortOrderQueryParam\"\n },\n {\n \"$ref\": \"#/components/parameters/sortColumnQueryParam\"\n },\n {\n \"$ref\": \"#/components/parameters/searchQueryParam\"\n },\n {\n \"$ref\": \"#/components/parameters/approvalToolParam\"\n }\n ],\n \"responses\": {\n \"200\": {\n \"description\": \"Import Job list was fetched successfully with no errors\",\n \"content\": {\n \"application/json\": {\n \"schema\": {\n \"oneOf\": [\n {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/components/schemas/SourceImport\"\n }\n },\n {\n \"$ref\": \"#/components/schemas/ImportJobListV2\"\n }\n ]\n },\n \"examples\": {\n \"twoImports\": {\n \"$ref\": \"#/components/examples/twoImports\"\n },\n \"multipleImportJobsV2\": {\n \"$ref\": \"#/components/examples/multipleImportJobsV2\"\n }\n }\n }\n }\n },\n \"500\": {\n \"description\": \"Generic error when there are errors and no Import Job is returned\",\n \"content\": {\n \"application/json\": {\n \"schema\": {\n \"oneOf\": [\n {\n \"type\": \"string\",\n \"description\": \"Generic error\"\n },\n {\n \"$ref\": \"#/components/schemas/ImportJobListV2\"\n }\n ]\n },\n \"examples\": {\n \"repositoryListErrors\": {\n \"$ref\": \"#/components/examples/importJobListErrors\"\n }\n }\n }\n }\n }\n }\n },\n \"post\": {\n \"operationId\": \"createImportJobs\",\n \"summary\": \"Submit Import Jobs\",\n \"security\": [\n {\n \"BearerAuth\": []\n }\n ],\n \"tags\": [\n \"Import\"\n ],\n \"parameters\": [\n {\n \"in\": \"query\",\n \"name\": \"dryRun\",\n \"description\": \"whether to perform a dry-run to check if entity name collisions would occur in the catalog\",\n \"schema\": {\n \"type\": \"boolean\",\n \"default\": \"false\"\n }\n }\n ],\n \"requestBody\": {\n \"description\": \"List of Import jobs to create\",\n \"required\": true,\n \"content\": {\n \"application/json\": {\n \"schema\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/components/schemas/ImportRequest\"\n }\n },\n \"examples\": {\n \"multipleImportRequests\": {\n \"$ref\": \"#/components/examples/multipleImportRequests\"\n }\n }\n }\n }\n },\n \"responses\": {\n \"202\": {\n \"description\": \"Import Jobs request was submitted successfully to the API. Check the status in each item of the response body list to see their individual status.\",\n \"content\": {\n \"application/json\": {\n \"schema\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/components/schemas/Import\"\n }\n },\n \"examples\": {\n \"twoImports\": {\n \"$ref\": \"#/components/examples/twoImportJobs\"\n }\n }\n }\n }\n }\n }\n }\n },\n \"/task-imports\": {\n \"get\": {\n \"operationId\": \"findAllTaskImports\",\n \"summary\": \"Fetch Import Jobs\",\n \"security\": [\n {\n \"BearerAuth\": []\n }\n ],\n \"tags\": [\n \"Import\"\n ],\n \"parameters\": [\n {\n \"$ref\": \"#/components/parameters/apiVersionHeaderParam\"\n },\n {\n \"$ref\": \"#/components/parameters/pagePerIntegrationQueryParamDeprecated\"\n },\n {\n \"$ref\": \"#/components/parameters/sizePerIntegrationQueryParamDeprecated\"\n },\n {\n \"$ref\": \"#/components/parameters/pageQueryParam\"\n },\n {\n \"$ref\": \"#/components/parameters/sizeQueryParam\"\n },\n {\n \"$ref\": \"#/components/parameters/sortOrderQueryParam\"\n },\n {\n \"$ref\": \"#/components/parameters/sortColumnQueryParam\"\n },\n {\n \"$ref\": \"#/components/parameters/searchQueryParam\"\n }\n ],\n \"responses\": {\n \"200\": {\n \"description\": \"Import Job list was fetched successfully with no errors\",\n \"content\": {\n \"application/json\": {\n \"schema\": {\n \"oneOf\": [\n {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/components/schemas/SourceImport\"\n }\n },\n {\n \"$ref\": \"#/components/schemas/ImportJobListV2\"\n }\n ]\n },\n \"examples\": {\n \"twoImports\": {\n \"$ref\": \"#/components/examples/twoImports\"\n },\n \"multipleImportJobsV2\": {\n \"$ref\": \"#/components/examples/multipleImportJobsV2\"\n }\n }\n }\n }\n },\n \"500\": {\n \"description\": \"Generic error when there are errors and no Import Job is returned\",\n \"content\": {\n \"application/json\": {\n \"schema\": {\n \"oneOf\": [\n {\n \"type\": \"string\",\n \"description\": \"Generic error\"\n },\n {\n \"$ref\": \"#/components/schemas/ImportJobListV2\"\n }\n ]\n },\n \"examples\": {\n \"repositoryListErrors\": {\n \"$ref\": \"#/components/examples/importJobListErrors\"\n }\n }\n }\n }\n }\n }\n },\n \"post\": {\n \"operationId\": \"createTaskImportJobs\",\n \"summary\": \"Execute a scaffolder template for a list of repositories\",\n \"security\": [\n {\n \"BearerAuth\": []\n }\n ],\n \"tags\": [\n \"Import\"\n ],\n \"requestBody\": {\n \"description\": \"The template to execute and the repositories to run it against.\",\n \"required\": true,\n \"content\": {\n \"application/json\": {\n \"schema\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/components/schemas/ImportRequest\"\n }\n }\n }\n }\n },\n \"responses\": {\n \"202\": {\n \"description\": \"Import Jobs request was submitted successfully to the API. Check the status in each item of the response body list to see their individual status.\",\n \"content\": {\n \"application/json\": {\n \"schema\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/components/schemas/Import\"\n }\n }\n }\n }\n }\n }\n }\n },\n \"/task-import/by-repo\": {\n \"get\": {\n \"operationId\": \"findTaskImportStatusByRepo\",\n \"summary\": \"Get Import Status by repository\",\n \"security\": [\n {\n \"BearerAuth\": []\n }\n ],\n \"tags\": [\n \"Import\"\n ],\n \"parameters\": [\n {\n \"in\": \"query\",\n \"name\": \"repo\",\n \"description\": \"the full URL to the repo\",\n \"schema\": {\n \"type\": \"string\"\n }\n },\n {\n \"in\": \"query\",\n \"name\": \"defaultBranch\",\n \"description\": \"the name of the default branch\",\n \"schema\": {\n \"type\": \"string\",\n \"default\": \"main\"\n }\n }\n ],\n \"responses\": {\n \"200\": {\n \"description\": \"Import Job status was determined successfully with no errors\",\n \"content\": {\n \"application/json\": {\n \"schema\": {\n \"$ref\": \"#/components/schemas/Import\"\n },\n \"examples\": {\n \"singleImportStatusForRepo\": {\n \"$ref\": \"#/components/examples/singleImportStatusForRepo\"\n }\n }\n }\n }\n },\n \"500\": {\n \"description\": \"Generic error\"\n }\n }\n },\n \"delete\": {\n \"operationId\": \"deleteTaskImportByRepo\",\n \"summary\": \"Delete stored scaffolder task records for a specific repository\",\n \"security\": [\n {\n \"BearerAuth\": []\n }\n ],\n \"tags\": [\n \"Import\"\n ],\n \"parameters\": [\n {\n \"in\": \"query\",\n \"name\": \"repo\",\n \"description\": \"the full URL to the repo\",\n \"schema\": {\n \"type\": \"string\"\n }\n }\n ],\n \"responses\": {\n \"204\": {\n \"description\": \"Repository was deleted successfully with no errors\"\n },\n \"500\": {\n \"description\": \"Generic error\"\n }\n }\n }\n },\n \"/import/by-repo\": {\n \"get\": {\n \"operationId\": \"findImportStatusByRepo\",\n \"summary\": \"Get Import Status by repository\",\n \"security\": [\n {\n \"BearerAuth\": []\n }\n ],\n \"tags\": [\n \"Import\"\n ],\n \"parameters\": [\n {\n \"in\": \"query\",\n \"name\": \"repo\",\n \"description\": \"the full URL to the repo\",\n \"schema\": {\n \"type\": \"string\"\n }\n },\n {\n \"in\": \"query\",\n \"name\": \"defaultBranch\",\n \"description\": \"the name of the default branch\",\n \"schema\": {\n \"type\": \"string\",\n \"default\": \"main\"\n }\n },\n {\n \"$ref\": \"#/components/parameters/approvalToolParam\"\n }\n ],\n \"responses\": {\n \"200\": {\n \"description\": \"Import Job status was determined successfully with no errors\",\n \"content\": {\n \"application/json\": {\n \"schema\": {\n \"$ref\": \"#/components/schemas/Import\"\n },\n \"examples\": {\n \"singleImportStatusForRepo\": {\n \"$ref\": \"#/components/examples/singleImportStatusForRepo\"\n }\n }\n }\n }\n },\n \"500\": {\n \"description\": \"Generic error\"\n }\n }\n },\n \"delete\": {\n \"operationId\": \"deleteImportByRepo\",\n \"summary\": \"Delete Import by repository\",\n \"security\": [\n {\n \"BearerAuth\": []\n }\n ],\n \"tags\": [\n \"Import\"\n ],\n \"parameters\": [\n {\n \"in\": \"query\",\n \"name\": \"repo\",\n \"description\": \"the full URL to the repo\",\n \"schema\": {\n \"type\": \"string\"\n }\n },\n {\n \"in\": \"query\",\n \"name\": \"defaultBranch\",\n \"description\": \"the name of the default branch\",\n \"schema\": {\n \"type\": \"string\",\n \"default\": \"main\"\n }\n },\n {\n \"$ref\": \"#/components/parameters/approvalToolParam\"\n }\n ],\n \"responses\": {\n \"204\": {\n \"description\": \"Import Job was successfully delete with no errors\"\n },\n \"500\": {\n \"description\": \"Generic error\"\n }\n }\n }\n }\n },\n \"components\": {\n \"parameters\": {\n \"apiVersionHeaderParam\": {\n \"in\": \"header\",\n \"name\": \"api-version\",\n \"description\": \"API version.\\\\n\\\\n## Changelog\\\\n\\\\n### v1 (default)\\\\nInitial version\\\\n#### Deprecations\\\\n* GET /imports\\\\n * Deprecation of 'pagePerIntegration' and 'sizePerIntegration' query parameters and introduction of new 'page' and 'size' parameters\\\\n * 'page' takes precedence over 'pagePerIntegration' if both are passed\\\\n * 'size' takes precedence over 'sizePerIntegration' if both are passed\\\\n\\\\n### v2\\\\n#### Breaking changes\\\\n* GET /imports\\\\n * Query parameters:\\\\n * 'pagePerIntegration' is ignored in favor of 'page'\\\\n * 'sizePerIntegration' is ignored in favor of 'size'\\\\n * Response structure changed to include pagination info: instead of returning a simple list of Imports, the response is now an object containing the following fields:\\\\n * 'imports': the list of Imports\\\\n * 'page': the page requested\\\\n * 'size': the requested number of Imports requested per page\\\\n * 'totalCount': the total count of Imports\\\\n\",\n \"schema\": {\n \"type\": \"string\",\n \"enum\": [\n \"v1\",\n \"v2\"\n ],\n \"default\": \"v1\"\n }\n },\n \"pagePerIntegrationQueryParam\": {\n \"in\": \"query\",\n \"name\": \"pagePerIntegration\",\n \"description\": \"the page number for each Integration\",\n \"schema\": {\n \"type\": \"integer\",\n \"default\": 1\n }\n },\n \"sizePerIntegrationQueryParam\": {\n \"in\": \"query\",\n \"name\": \"sizePerIntegration\",\n \"description\": \"the number of items per Integration to return per page\",\n \"schema\": {\n \"type\": \"integer\",\n \"default\": 20\n }\n },\n \"pagePerIntegrationQueryParamDeprecated\": {\n \"in\": \"query\",\n \"name\": \"pagePerIntegration\",\n \"description\": \"the page number for each Integration. **Deprecated**. Use the 'page' query parameter instead.\",\n \"deprecated\": true,\n \"schema\": {\n \"type\": \"integer\",\n \"default\": 1\n }\n },\n \"sortColumnQueryParam\": {\n \"in\": \"query\",\n \"name\": \"sortColumn\",\n \"description\": \"The allowed values for sorting columns:\\\\n- repository.name: Sort by repository name.\\\\n- repository.organization: Sort by organization URL.\\\\n- repository.url: Sort by repository URL.\\\\n- lastUpdate: Sort by the last time the catalog-info.yaml was updated.\\\\n- status: Sort by the status of the catalog-info.yaml.\\\\n\",\n \"required\": false,\n \"schema\": {\n \"enum\": [\n \"repository.name\",\n \"repository.organization\",\n \"repository.url\",\n \"lastUpdate\",\n \"status\"\n ],\n \"default\": \"repository.name\"\n }\n },\n \"sortOrderQueryParam\": {\n \"in\": \"query\",\n \"name\": \"sortOrder\",\n \"description\": \"The order of sorting asc for ascending or desc for descending\",\n \"required\": false,\n \"schema\": {\n \"type\": \"string\",\n \"enum\": [\n \"asc\",\n \"desc\"\n ],\n \"default\": \"asc\"\n }\n },\n \"sizePerIntegrationQueryParamDeprecated\": {\n \"in\": \"query\",\n \"name\": \"sizePerIntegration\",\n \"description\": \"the number of items per Integration to return per page. **Deprecated**. Use the 'size' query parameter instead.\",\n \"deprecated\": true,\n \"schema\": {\n \"type\": \"integer\",\n \"default\": 20\n }\n },\n \"searchQueryParam\": {\n \"in\": \"query\",\n \"name\": \"search\",\n \"description\": \"returns only the items that match the search string\",\n \"schema\": {\n \"type\": \"string\"\n }\n },\n \"pageQueryParam\": {\n \"in\": \"query\",\n \"name\": \"page\",\n \"description\": \"the requested page number\",\n \"schema\": {\n \"type\": \"integer\",\n \"default\": 1\n }\n },\n \"sizeQueryParam\": {\n \"in\": \"query\",\n \"name\": \"size\",\n \"description\": \"the number of items to return per page\",\n \"schema\": {\n \"type\": \"integer\",\n \"default\": 20\n }\n },\n \"approvalToolParam\": {\n \"in\": \"query\",\n \"name\": \"approvalTool\",\n \"description\": \"the approvalTool to use\",\n \"schema\": {\n \"type\": \"string\",\n \"default\": \"GIT\"\n }\n }\n },\n \"schemas\": {\n \"OrganizationList\": {\n \"title\": \"Organization List\",\n \"type\": \"object\",\n \"properties\": {\n \"organizations\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/components/schemas/Organization\"\n }\n },\n \"errors\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n },\n \"totalCount\": {\n \"type\": \"integer\"\n },\n \"pagePerIntegration\": {\n \"type\": \"integer\"\n },\n \"sizePerIntegration\": {\n \"type\": \"integer\"\n }\n }\n },\n \"Organization\": {\n \"title\": \"Organization\",\n \"type\": \"object\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\",\n \"description\": \"unique identifier\"\n },\n \"name\": {\n \"type\": \"string\",\n \"description\": \"organization name\"\n },\n \"description\": {\n \"type\": \"string\",\n \"description\": \"organization description\"\n },\n \"url\": {\n \"type\": \"string\",\n \"description\": \"organization URL\"\n },\n \"totalRepoCount\": {\n \"type\": \"number\",\n \"description\": \"total number of repositories in this Organization\"\n },\n \"errors\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n }\n }\n },\n \"RepositoryList\": {\n \"title\": \"Repository List\",\n \"type\": \"object\",\n \"properties\": {\n \"repositories\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/components/schemas/Repository\"\n }\n },\n \"errors\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n },\n \"totalCount\": {\n \"type\": \"integer\"\n },\n \"pagePerIntegration\": {\n \"type\": \"integer\"\n },\n \"sizePerIntegration\": {\n \"type\": \"integer\"\n }\n }\n },\n \"Repository\": {\n \"title\": \"Repository\",\n \"type\": \"object\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\",\n \"description\": \"unique identifier\"\n },\n \"name\": {\n \"type\": \"string\",\n \"description\": \"repository name\"\n },\n \"url\": {\n \"type\": \"string\",\n \"description\": \"repository URL\"\n },\n \"organization\": {\n \"type\": \"string\",\n \"description\": \"organization which the repository is part of\"\n },\n \"importStatus\": {\n \"oneOf\": [\n {\n \"$ref\": \"#/components/schemas/ImportStatus\"\n },\n {\n \"$ref\": \"#/components/schemas/TaskImportStatus\"\n }\n ]\n },\n \"defaultBranch\": {\n \"type\": \"string\",\n \"description\": \"default branch\"\n },\n \"lastUpdate\": {\n \"type\": \"string\",\n \"format\": \"date-time\"\n },\n \"errors\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n }\n }\n },\n \"ApprovalTool\": {\n \"type\": \"string\",\n \"enum\": [\n \"GIT\",\n \"SERVICENOW\",\n \"GITLAB\"\n ]\n },\n \"TaskImportStatus\": {\n \"type\": \"string\",\n \"nullable\": true,\n \"description\": \"Import Job status\",\n \"enum\": [\n \"TASK_CANCELLED\",\n \"TASK_COMPLETED\",\n \"TASK_FAILED\",\n \"TASK_OPEN\",\n \"TASK_PROCESSING\",\n \"TASK_SKIPPED\",\n \"TASK_FETCH_FAILED\"\n ]\n },\n \"ImportStatus\": {\n \"type\": \"string\",\n \"nullable\": true,\n \"description\": \"Import Job status\",\n \"enum\": [\n \"ADDED\",\n \"WAIT_PR_APPROVAL\",\n \"PR_ERROR\",\n null\n ]\n },\n \"ImportJobListV2\": {\n \"title\": \"Import Job List\",\n \"type\": \"object\",\n \"properties\": {\n \"imports\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/components/schemas/SourceImport\"\n }\n },\n \"errors\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n },\n \"totalCount\": {\n \"type\": \"integer\"\n },\n \"page\": {\n \"type\": \"integer\"\n },\n \"size\": {\n \"type\": \"integer\"\n }\n }\n },\n \"Import\": {\n \"title\": \"Import Job\",\n \"type\": \"object\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\"\n },\n \"status\": {\n \"oneOf\": [\n {\n \"$ref\": \"#/components/schemas/ImportStatus\"\n },\n {\n \"$ref\": \"#/components/schemas/TaskImportStatus\"\n }\n ]\n },\n \"task\": {\n \"type\": \"object\",\n \"properties\": {\n \"taskId\": {\n \"type\": \"string\"\n }\n }\n },\n \"tasks\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"taskId\": {\n \"type\": \"string\"\n }\n }\n }\n },\n \"catalogEntityName\": {\n \"type\": \"string\",\n \"description\": \"Specified entity name in the catalog. Filled only in response for dry-run import requests.\"\n },\n \"lastUpdate\": {\n \"type\": \"string\",\n \"format\": \"date-time\"\n },\n \"errors\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n },\n \"approvalTool\": {\n \"$ref\": \"#/components/schemas/ApprovalTool\"\n },\n \"repository\": {\n \"$ref\": \"#/components/schemas/Repository\"\n },\n \"gitlab\": {\n \"type\": \"object\",\n \"description\": \"GitLab details. Applicable if approvalTool is gitlab.\",\n \"properties\": {\n \"pullRequest\": {\n \"$ref\": \"#/components/schemas/PullRequest\"\n }\n }\n },\n \"github\": {\n \"type\": \"object\",\n \"description\": \"GitHub details. Applicable if approvalTool is git.\",\n \"properties\": {\n \"pullRequest\": {\n \"$ref\": \"#/components/schemas/PullRequest\"\n }\n }\n }\n }\n },\n \"PullRequest\": {\n \"type\": \"object\",\n \"properties\": {\n \"url\": {\n \"type\": \"string\",\n \"description\": \"URL of the Pull Request\"\n },\n \"number\": {\n \"type\": \"number\",\n \"description\": \"Pull Request number\"\n },\n \"title\": {\n \"type\": \"string\",\n \"description\": \"title of the Pull Request\"\n },\n \"body\": {\n \"type\": \"string\",\n \"description\": \"body of the Pull Request\"\n },\n \"catalogInfoContent\": {\n \"type\": \"string\",\n \"description\": \"content of the catalog-info.yaml as fetched from the Pull Request.\"\n },\n \"status\": {\n \"type\": \"string\",\n \"enum\": [\n \"WAIT_PR_APPROVAL\",\n \"PR_MERGED\",\n \"PR_ERROR\"\n ]\n }\n }\n },\n \"SourceImport\": {\n \"title\": \"Import Job with source it originates from\",\n \"allOf\": [\n {\n \"$ref\": \"#/components/schemas/Import\"\n },\n {\n \"type\": \"object\",\n \"properties\": {\n \"source\": {\n \"$ref\": \"#/components/schemas/Source\"\n }\n }\n }\n ]\n },\n \"Source\": {\n \"type\": \"string\",\n \"nullable\": true,\n \"description\": \"Import Source:\\\\n * 'config' - Import from static catalog location configuration in 'app-config'\\\\n * 'location' - Import of user registered entities using locations endpoint\\\\n * 'integration' - Import using a GitHub integration\\\\n * null - Import source is unknown\\\\n\",\n \"enum\": [\n \"config\",\n \"location\",\n \"integration\",\n null\n ]\n },\n \"ImportRequest\": {\n \"title\": \"Import Job request\",\n \"type\": \"object\",\n \"required\": [\n \"repository\"\n ],\n \"properties\": {\n \"approvalTool\": {\n \"$ref\": \"#/components/schemas/ApprovalTool\"\n },\n \"catalogEntityName\": {\n \"type\": \"string\",\n \"description\": \"Expected Entity name in the catalog. Relevant only if the 'dryRun' query parameter is set to 'true'.\"\n },\n \"codeOwnersFileAsEntityOwner\": {\n \"type\": \"boolean\",\n \"description\": \"Whether the CODEOWNERS file will be used as entity owner. Only relevant for dry-run requests. If set to 'false', the corresponding dry-run check will be skipped.\"\n },\n \"repository\": {\n \"type\": \"object\",\n \"required\": [\n \"url\"\n ],\n \"properties\": {\n \"name\": {\n \"type\": \"string\",\n \"description\": \"repository name\"\n },\n \"url\": {\n \"type\": \"string\",\n \"description\": \"repository URL\"\n },\n \"organization\": {\n \"type\": \"string\",\n \"description\": \"organization which the repository is part of\"\n },\n \"defaultBranch\": {\n \"type\": \"string\",\n \"description\": \"default branch\"\n }\n }\n },\n \"catalogInfoContent\": {\n \"type\": \"string\",\n \"description\": \"content of the catalog-info.yaml to include in the import Pull Request.\"\n },\n \"gitlab\": {\n \"type\": \"object\",\n \"description\": \"GitLab details. Applicable if approvalTool is gitlab.\",\n \"properties\": {\n \"pullRequest\": {\n \"$ref\": \"#/components/schemas/PullRequest\"\n }\n }\n },\n \"github\": {\n \"type\": \"object\",\n \"description\": \"GitHub details. Applicable if approvalTool is git.\",\n \"properties\": {\n \"pullRequest\": {\n \"$ref\": \"#/components/schemas/PullRequest\"\n }\n }\n }\n }\n },\n \"ScaffolderTask\": {\n \"title\": \"Scaffolder Task\",\n \"type\": \"object\",\n \"properties\": {\n \"taskId\": {\n \"type\": \"string\"\n },\n \"repositoryId\": {\n \"type\": \"number\"\n },\n \"locations\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n }\n }\n }\n },\n \"securitySchemes\": {\n \"BearerAuth\": {\n \"type\": \"http\",\n \"scheme\": \"bearer\",\n \"bearerFormat\": \"JWT\",\n \"description\": \"Backstage Permissions Framework JWT\"\n }\n },\n \"examples\": {\n \"multipleOrgs\": {\n \"summary\": \"Multiple organizations\",\n \"value\": {\n \"errors\": [],\n \"organizations\": [\n {\n \"id\": \"unique-org-id-1\",\n \"name\": \"pet-org\",\n \"url\": \"https://github.com/pet-org\",\n \"description\": \"A great Pet Org\",\n \"totalRepoCount\": 10\n },\n {\n \"id\": \"unique-org-id-2\",\n \"name\": \"org-zero\",\n \"url\": \"https://ghe.example.com/org-zero\",\n \"totalRepoCount\": 0\n },\n {\n \"id\": \"unique-id-2\",\n \"name\": \"org-one\",\n \"url\": \"https://ghe.example.com/org-one\",\n \"description\": \"Org One description\",\n \"totalRepoCount\": 1234\n }\n ]\n }\n },\n \"orgListErrors\": {\n \"summary\": \"Errors when listing organizations\",\n \"value\": {\n \"errors\": [\n \"Github App with ID 2 failed spectacularly\"\n ],\n \"organizations\": []\n }\n },\n \"multipleRepos\": {\n \"summary\": \"Multiple repositories\",\n \"value\": {\n \"errors\": [],\n \"repositories\": [\n {\n \"id\": \"unique-id-1\",\n \"name\": \"pet-app\",\n \"url\": \"https://github.com/my-org/pet-app\",\n \"organization\": \"my-org\",\n \"importStatus\": \"WAIT_PR_APPROVAL\",\n \"defaultBranch\": \"main\"\n },\n {\n \"id\": \"unique-id-2\",\n \"name\": \"project-zero\",\n \"url\": \"https://ghe.example.com/my-other-org/project-zero\",\n \"organization\": \"my-other-org\",\n \"importStatus\": \"PR_REJECTED\",\n \"defaultBranch\": \"dev\"\n },\n {\n \"id\": \"unique-id-2\",\n \"name\": \"project-one\",\n \"defaultBranch\": \"trunk\",\n \"url\": \"https://ghe.example.com/my-other-org-2/project-one\",\n \"organization\": \"my-other-org-2\"\n }\n ]\n }\n },\n \"repositoryListErrors\": {\n \"summary\": \"Errors when listing repositories\",\n \"value\": {\n \"errors\": [\n \"Github App with ID 2 failed spectacularly\"\n ],\n \"repositories\": []\n }\n },\n \"twoImports\": {\n \"summary\": \"Two import job requests (V1)\",\n \"value\": [\n {\n \"id\": \"bulk-import-id-1\",\n \"status\": \"WAIT_PR_APPROVAL\",\n \"errors\": [],\n \"approvalTool\": \"GIT\",\n \"repository\": {\n \"name\": \"pet-app\",\n \"url\": \"https://github.com/my-org/pet-app\",\n \"organization\": \"my-org\"\n },\n \"github\": {\n \"pullRequest\": {\n \"url\": \"https://github.com/my-org/pet-app/pull/1\",\n \"number\": 1\n }\n }\n },\n {\n \"id\": \"bulk-import-id-2\",\n \"status\": \"PR_REJECTED\",\n \"errors\": [],\n \"approvalTool\": \"GIT\",\n \"repository\": {\n \"name\": \"pet-app-test\",\n \"url\": \"https://github.com/my-org/pet-app-test\",\n \"organization\": \"my-org\"\n },\n \"github\": {\n \"pullRequest\": {\n \"url\": \"https://github.com/my-org/pet-app-test/pull/10\",\n \"number\": 10\n }\n }\n }\n ]\n },\n \"multipleImportJobsV2\": {\n \"summary\": \"Two import job requests (V2)\",\n \"value\": {\n \"errors\": [],\n \"page\": 1,\n \"size\": 2,\n \"totalCount\": 10,\n \"imports\": [\n {\n \"id\": \"bulk-import-id-1\",\n \"status\": \"WAIT_PR_APPROVAL\",\n \"errors\": [],\n \"approvalTool\": \"GIT\",\n \"repository\": {\n \"name\": \"pet-app\",\n \"url\": \"https://github.com/my-org/pet-app\",\n \"organization\": \"my-org\"\n },\n \"github\": {\n \"pullRequest\": {\n \"url\": \"https://github.com/my-org/pet-app/pull/1\",\n \"number\": 1\n }\n }\n },\n {\n \"id\": \"bulk-import-id-2\",\n \"status\": \"PR_REJECTED\",\n \"errors\": [],\n \"approvalTool\": \"GIT\",\n \"repository\": {\n \"name\": \"pet-app-test\",\n \"url\": \"https://github.com/my-org/pet-app-test\",\n \"organization\": \"my-org\"\n },\n \"github\": {\n \"pullRequest\": {\n \"url\": \"https://github.com/my-org/pet-app-test/pull/10\",\n \"number\": 10\n }\n }\n }\n ]\n }\n },\n \"importJobListErrors\": {\n \"summary\": \"Errors when listing import jobs\",\n \"value\": {\n \"errors\": [\n \"Github App with ID xyz-123 failed spectacularly\"\n ],\n \"imports\": []\n }\n },\n \"twoImportJobs\": {\n \"summary\": \"Two import jobs\",\n \"value\": [\n {\n \"id\": \"bulk-import-id-1\",\n \"status\": \"WAIT_PR_APPROVAL\",\n \"errors\": [],\n \"approvalTool\": \"GIT\",\n \"repository\": {\n \"name\": \"pet-app\",\n \"url\": \"https://github.com/my-org/pet-app\",\n \"organization\": \"my-org\"\n },\n \"github\": {\n \"pullRequest\": {\n \"url\": \"https://github.com/my-org/pet-app/pull/1\",\n \"number\": 1\n }\n }\n },\n {\n \"id\": \"bulk-import-id-2\",\n \"status\": \"PR_REJECTED\",\n \"errors\": [],\n \"approvalTool\": \"GIT\",\n \"repository\": {\n \"name\": \"pet-app-test\",\n \"url\": \"https://github.com/my-org/pet-app-test\",\n \"organization\": \"my-org\"\n },\n \"github\": {\n \"pullRequest\": {\n \"url\": \"https://github.com/my-org/pet-app-test/pull/10\",\n \"number\": 10\n }\n }\n }\n ]\n },\n \"singleImportStatusForRepo\": {\n \"summary\": \"Single import job status for given repo\",\n \"value\": {\n \"id\": \"bulk-import-id-1\",\n \"status\": \"WAIT_PR_APPROVAL\",\n \"errors\": [],\n \"approvalTool\": \"GIT\",\n \"repository\": {\n \"name\": \"pet-app\",\n \"url\": \"https://github.com/my-org/pet-app\",\n \"organization\": \"my-org\"\n },\n \"github\": {\n \"pullRequest\": {\n \"url\": \"https://github.com/my-org/pet-app/pull/1\",\n \"number\": 1\n }\n }\n }\n },\n \"multipleImportRequests\": {\n \"summary\": \"Multiple import requests\",\n \"value\": [\n {\n \"approvalTool\": \"GIT\",\n \"repository\": {\n \"name\": \"pet-app\",\n \"url\": \"https://github.com/my-org/pet-app\",\n \"organization\": \"my-org\",\n \"defaultBranch\": \"main\"\n },\n \"github\": {\n \"pullRequest\": {\n \"title\": \"Add default catalog-info.yaml to import to Red Hat Developer Hub\"\n }\n }\n },\n {\n \"approvalTool\": \"GIT\",\n \"repository\": {\n \"name\": \"project-zero\",\n \"url\": \"https://ghe.example.com/my-other-org/project-zero\",\n \"organization\": \"my-other-org\",\n \"defaultBranch\": \"dev\"\n },\n \"github\": {\n \"pullRequest\": {\n \"title\": \"Add custom catalog-info.yaml to import to Red Hat Developer Hub\",\n \"body\": \"This pull request adds a **Backstage entity metadata file** to this repository so that the component can be added to the Red Hat Developer Hub software catalog.\\\\n\\\\nAfter this pull request is merged, the component will become available.\\\\n\\\\nFor more information, read an [overview of the Backstage software catalog](https://backstage.io/docs/features/software-catalog/).\"\n }\n },\n \"catalogInfoContent\": \"apiVersion: backstage.io/v1alpha1\\\\nkind: Component\\\\nmetadata:\\\\n name: project-zero\\\\n annotations:\\\\n github.com/project-slug: my-other-org/project-zero\\\\n acme.com/custom-annotation: my-value\\\\nspec:\\\\n type: other\\\\n lifecycle: unknown\\\\n owner: my-other-org\"\n }\n ]\n }\n }\n }\n}`\nexport const openApiDocument = JSON.parse(OPENAPI);\n"],"names":[],"mappings":";;AAkBA,MAAM,OAAU,GAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAA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AihDH,MAAA,eAAA,GAAkB,IAAK,CAAA,KAAA,CAAM,OAAO;;;;"}
|
|
1
|
+
{"version":3,"file":"openapidocument.cjs.js","sources":["../../src/generated/openapidocument.ts"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// eslint-disable\n// prettier-ignore\nconst OPENAPI = `\n{\n \"openapi\": \"3.1.0\",\n \"info\": {\n \"version\": \"1.0\",\n \"title\": \"Bulk Import Backend\",\n \"description\": \"The Bulk Import Backend APIs allow users to bulk import repositories into the Backstage catalog from remote sources such as Git.\"\n },\n \"servers\": [\n {\n \"url\": \"{protocol}://{host}:{port}/{basePath}\",\n \"variables\": {\n \"protocol\": {\n \"enum\": [\n \"http\",\n \"https\"\n ],\n \"default\": \"http\"\n },\n \"host\": {\n \"default\": \"localhost\"\n },\n \"port\": {\n \"default\": \"7007\"\n },\n \"basePath\": {\n \"default\": \"api/bulk-import\"\n }\n }\n }\n ],\n \"paths\": {\n \"/ping\": {\n \"get\": {\n \"operationId\": \"ping\",\n \"summary\": \"Check the health of the Bulk Import backend router\",\n \"tags\": [\n \"Management\"\n ],\n \"responses\": {\n \"200\": {\n \"description\": \"The backend router for the Bulk Import backend is up and running\",\n \"content\": {\n \"application/json\": {\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"status\": {\n \"enum\": [\n \"ok\"\n ]\n }\n }\n },\n \"example\": {\n \"status\": \"ok\"\n }\n }\n }\n }\n }\n }\n },\n \"/organizations\": {\n \"get\": {\n \"operationId\": \"findAllOrganizations\",\n \"summary\": \"Fetch Organizations accessible by Backstage Github Integrations\",\n \"security\": [\n {\n \"BearerAuth\": []\n }\n ],\n \"tags\": [\n \"Organization\"\n ],\n \"parameters\": [\n {\n \"$ref\": \"#/components/parameters/pagePerIntegrationQueryParam\"\n },\n {\n \"$ref\": \"#/components/parameters/sizePerIntegrationQueryParam\"\n },\n {\n \"$ref\": \"#/components/parameters/searchQueryParam\"\n },\n {\n \"$ref\": \"#/components/parameters/approvalToolParam\"\n }\n ],\n \"responses\": {\n \"200\": {\n \"description\": \"Organization list was fetched successfully with no errors\",\n \"content\": {\n \"application/json\": {\n \"schema\": {\n \"$ref\": \"#/components/schemas/OrganizationList\"\n },\n \"examples\": {\n \"multipleRepos\": {\n \"$ref\": \"#/components/examples/multipleOrgs\"\n }\n }\n }\n }\n },\n \"500\": {\n \"description\": \"Generic error when there are errors and no Organization is returned\",\n \"content\": {\n \"application/json\": {\n \"schema\": {\n \"$ref\": \"#/components/schemas/OrganizationList\"\n },\n \"examples\": {\n \"repositoryListErrors\": {\n \"$ref\": \"#/components/examples/orgListErrors\"\n }\n }\n }\n }\n }\n }\n }\n },\n \"/organizations/{organizationName}/repositories\": {\n \"get\": {\n \"operationId\": \"findRepositoriesByOrganization\",\n \"summary\": \"Fetch Repositories in the specified GitHub organization, provided it is accessible by any of the configured GitHub Integrations.\",\n \"security\": [\n {\n \"BearerAuth\": []\n }\n ],\n \"tags\": [\n \"Organization\"\n ],\n \"parameters\": [\n {\n \"in\": \"path\",\n \"name\": \"organizationName\",\n \"description\": \"Organization name\",\n \"required\": true,\n \"schema\": {\n \"type\": \"string\"\n }\n },\n {\n \"in\": \"query\",\n \"name\": \"checkImportStatus\",\n \"description\": \"whether to return import status. Note that this might incur a performance penalty because the import status is computed for each repository.\",\n \"schema\": {\n \"type\": \"boolean\",\n \"default\": \"false\"\n }\n },\n {\n \"$ref\": \"#/components/parameters/pagePerIntegrationQueryParam\"\n },\n {\n \"$ref\": \"#/components/parameters/sizePerIntegrationQueryParam\"\n },\n {\n \"$ref\": \"#/components/parameters/searchQueryParam\"\n },\n {\n \"$ref\": \"#/components/parameters/approvalToolParam\"\n }\n ],\n \"responses\": {\n \"200\": {\n \"description\": \"Org Repository list was fetched successfully with no errors\",\n \"content\": {\n \"application/json\": {\n \"schema\": {\n \"$ref\": \"#/components/schemas/RepositoryList\"\n },\n \"examples\": {\n \"multipleRepos\": {\n \"$ref\": \"#/components/examples/multipleRepos\"\n }\n }\n }\n }\n },\n \"500\": {\n \"description\": \"Generic error when there are errors and no Org Repository is returned\",\n \"content\": {\n \"application/json\": {\n \"schema\": {\n \"$ref\": \"#/components/schemas/RepositoryList\"\n },\n \"examples\": {\n \"repositoryListErrors\": {\n \"$ref\": \"#/components/examples/repositoryListErrors\"\n }\n }\n }\n }\n }\n }\n }\n },\n \"/repositories\": {\n \"get\": {\n \"operationId\": \"findAllRepositories\",\n \"summary\": \"Fetch Organization Repositories accessible by Backstage Github Integrations\",\n \"security\": [\n {\n \"BearerAuth\": []\n }\n ],\n \"tags\": [\n \"Repository\"\n ],\n \"parameters\": [\n {\n \"in\": \"query\",\n \"name\": \"checkImportStatus\",\n \"description\": \"whether to return import status. Note that this might incur a performance penalty because the import status is computed for each repository.\",\n \"schema\": {\n \"type\": \"boolean\",\n \"default\": \"false\"\n }\n },\n {\n \"$ref\": \"#/components/parameters/pagePerIntegrationQueryParam\"\n },\n {\n \"$ref\": \"#/components/parameters/sizePerIntegrationQueryParam\"\n },\n {\n \"$ref\": \"#/components/parameters/searchQueryParam\"\n },\n {\n \"$ref\": \"#/components/parameters/approvalToolParam\"\n }\n ],\n \"responses\": {\n \"200\": {\n \"description\": \"Repository list was fetched successfully with no errors\",\n \"content\": {\n \"application/json\": {\n \"schema\": {\n \"$ref\": \"#/components/schemas/RepositoryList\"\n },\n \"examples\": {\n \"multipleRepos\": {\n \"$ref\": \"#/components/examples/multipleRepos\"\n }\n }\n }\n }\n },\n \"500\": {\n \"description\": \"Generic error when there are errors and no repository is returned\",\n \"content\": {\n \"application/json\": {\n \"schema\": {\n \"$ref\": \"#/components/schemas/RepositoryList\"\n },\n \"examples\": {\n \"repositoryListErrors\": {\n \"$ref\": \"#/components/examples/repositoryListErrors\"\n }\n }\n }\n }\n }\n }\n }\n },\n \"/imports\": {\n \"get\": {\n \"operationId\": \"findAllImports\",\n \"summary\": \"Fetch Import Jobs\",\n \"security\": [\n {\n \"BearerAuth\": []\n }\n ],\n \"tags\": [\n \"Import\"\n ],\n \"parameters\": [\n {\n \"$ref\": \"#/components/parameters/apiVersionHeaderParam\"\n },\n {\n \"$ref\": \"#/components/parameters/pagePerIntegrationQueryParamDeprecated\"\n },\n {\n \"$ref\": \"#/components/parameters/sizePerIntegrationQueryParamDeprecated\"\n },\n {\n \"$ref\": \"#/components/parameters/pageQueryParam\"\n },\n {\n \"$ref\": \"#/components/parameters/sizeQueryParam\"\n },\n {\n \"$ref\": \"#/components/parameters/sortOrderQueryParam\"\n },\n {\n \"$ref\": \"#/components/parameters/sortColumnQueryParam\"\n },\n {\n \"$ref\": \"#/components/parameters/searchQueryParam\"\n },\n {\n \"$ref\": \"#/components/parameters/approvalToolParam\"\n }\n ],\n \"responses\": {\n \"200\": {\n \"description\": \"Import Job list was fetched successfully with no errors\",\n \"content\": {\n \"application/json\": {\n \"schema\": {\n \"oneOf\": [\n {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/components/schemas/SourceImport\"\n }\n },\n {\n \"$ref\": \"#/components/schemas/ImportJobListV2\"\n }\n ]\n },\n \"examples\": {\n \"twoImports\": {\n \"$ref\": \"#/components/examples/twoImports\"\n },\n \"multipleImportJobsV2\": {\n \"$ref\": \"#/components/examples/multipleImportJobsV2\"\n }\n }\n }\n }\n },\n \"500\": {\n \"description\": \"Generic error when there are errors and no Import Job is returned\",\n \"content\": {\n \"application/json\": {\n \"schema\": {\n \"oneOf\": [\n {\n \"type\": \"string\",\n \"description\": \"Generic error\"\n },\n {\n \"$ref\": \"#/components/schemas/ImportJobListV2\"\n }\n ]\n },\n \"examples\": {\n \"repositoryListErrors\": {\n \"$ref\": \"#/components/examples/importJobListErrors\"\n }\n }\n }\n }\n }\n }\n },\n \"post\": {\n \"operationId\": \"createImportJobs\",\n \"summary\": \"Submit Import Jobs\",\n \"security\": [\n {\n \"BearerAuth\": []\n }\n ],\n \"tags\": [\n \"Import\"\n ],\n \"parameters\": [\n {\n \"in\": \"query\",\n \"name\": \"dryRun\",\n \"description\": \"whether to perform a dry-run to check if entity name collisions would occur in the catalog\",\n \"schema\": {\n \"type\": \"boolean\",\n \"default\": \"false\"\n }\n }\n ],\n \"requestBody\": {\n \"description\": \"List of Import jobs to create\",\n \"required\": true,\n \"content\": {\n \"application/json\": {\n \"schema\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/components/schemas/ImportRequest\"\n }\n },\n \"examples\": {\n \"multipleImportRequests\": {\n \"$ref\": \"#/components/examples/multipleImportRequests\"\n }\n }\n }\n }\n },\n \"responses\": {\n \"202\": {\n \"description\": \"Import Jobs request was submitted successfully to the API. Check the status in each item of the response body list to see their individual status.\",\n \"content\": {\n \"application/json\": {\n \"schema\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/components/schemas/Import\"\n }\n },\n \"examples\": {\n \"twoImports\": {\n \"$ref\": \"#/components/examples/twoImportJobs\"\n }\n }\n }\n }\n }\n }\n }\n },\n \"/task-imports\": {\n \"get\": {\n \"operationId\": \"findAllTaskImports\",\n \"summary\": \"Fetch Import Jobs\",\n \"security\": [\n {\n \"BearerAuth\": []\n }\n ],\n \"tags\": [\n \"Import\"\n ],\n \"parameters\": [\n {\n \"$ref\": \"#/components/parameters/apiVersionHeaderParam\"\n },\n {\n \"$ref\": \"#/components/parameters/pagePerIntegrationQueryParamDeprecated\"\n },\n {\n \"$ref\": \"#/components/parameters/sizePerIntegrationQueryParamDeprecated\"\n },\n {\n \"$ref\": \"#/components/parameters/pageQueryParam\"\n },\n {\n \"$ref\": \"#/components/parameters/sizeQueryParam\"\n },\n {\n \"$ref\": \"#/components/parameters/sortOrderQueryParam\"\n },\n {\n \"$ref\": \"#/components/parameters/sortColumnQueryParam\"\n },\n {\n \"$ref\": \"#/components/parameters/searchQueryParam\"\n }\n ],\n \"responses\": {\n \"200\": {\n \"description\": \"Import Job list was fetched successfully with no errors\",\n \"content\": {\n \"application/json\": {\n \"schema\": {\n \"oneOf\": [\n {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/components/schemas/SourceImport\"\n }\n },\n {\n \"$ref\": \"#/components/schemas/ImportJobListV2\"\n }\n ]\n },\n \"examples\": {\n \"twoImports\": {\n \"$ref\": \"#/components/examples/twoImports\"\n },\n \"multipleImportJobsV2\": {\n \"$ref\": \"#/components/examples/multipleImportJobsV2\"\n }\n }\n }\n }\n },\n \"500\": {\n \"description\": \"Generic error when there are errors and no Import Job is returned\",\n \"content\": {\n \"application/json\": {\n \"schema\": {\n \"oneOf\": [\n {\n \"type\": \"string\",\n \"description\": \"Generic error\"\n },\n {\n \"$ref\": \"#/components/schemas/ImportJobListV2\"\n }\n ]\n },\n \"examples\": {\n \"repositoryListErrors\": {\n \"$ref\": \"#/components/examples/importJobListErrors\"\n }\n }\n }\n }\n }\n }\n },\n \"post\": {\n \"operationId\": \"createTaskImportJobs\",\n \"summary\": \"Execute a scaffolder template for a list of repositories\",\n \"security\": [\n {\n \"BearerAuth\": []\n }\n ],\n \"tags\": [\n \"Import\"\n ],\n \"requestBody\": {\n \"description\": \"The template to execute and the repositories to run it against.\",\n \"required\": true,\n \"content\": {\n \"application/json\": {\n \"schema\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/components/schemas/ImportRequest\"\n }\n }\n }\n }\n },\n \"responses\": {\n \"202\": {\n \"description\": \"Import Jobs request was submitted successfully to the API. Check the status in each item of the response body list to see their individual status.\",\n \"content\": {\n \"application/json\": {\n \"schema\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/components/schemas/Import\"\n }\n }\n }\n }\n }\n }\n }\n },\n \"/task-import/by-repo\": {\n \"get\": {\n \"operationId\": \"findTaskImportStatusByRepo\",\n \"summary\": \"Get Import Status by repository\",\n \"security\": [\n {\n \"BearerAuth\": []\n }\n ],\n \"tags\": [\n \"Import\"\n ],\n \"parameters\": [\n {\n \"in\": \"query\",\n \"name\": \"repo\",\n \"description\": \"the full URL to the repo\",\n \"schema\": {\n \"type\": \"string\"\n }\n },\n {\n \"in\": \"query\",\n \"name\": \"defaultBranch\",\n \"description\": \"the name of the default branch\",\n \"schema\": {\n \"type\": \"string\",\n \"default\": \"main\"\n }\n },\n {\n \"$ref\": \"#/components/parameters/approvalToolParam\"\n }\n ],\n \"responses\": {\n \"200\": {\n \"description\": \"Import Job status was determined successfully with no errors\",\n \"content\": {\n \"application/json\": {\n \"schema\": {\n \"$ref\": \"#/components/schemas/Import\"\n },\n \"examples\": {\n \"singleImportStatusForRepo\": {\n \"$ref\": \"#/components/examples/singleImportStatusForRepo\"\n }\n }\n }\n }\n },\n \"500\": {\n \"description\": \"Generic error\"\n }\n }\n },\n \"delete\": {\n \"operationId\": \"deleteTaskImportByRepo\",\n \"summary\": \"Delete stored scaffolder task records for a specific repository\",\n \"security\": [\n {\n \"BearerAuth\": []\n }\n ],\n \"tags\": [\n \"Import\"\n ],\n \"parameters\": [\n {\n \"in\": \"query\",\n \"name\": \"repo\",\n \"description\": \"the full URL to the repo\",\n \"schema\": {\n \"type\": \"string\"\n }\n },\n {\n \"$ref\": \"#/components/parameters/approvalToolParam\"\n }\n ],\n \"responses\": {\n \"204\": {\n \"description\": \"Repository was deleted successfully with no errors\"\n },\n \"500\": {\n \"description\": \"Generic error\"\n }\n }\n }\n },\n \"/import/by-repo\": {\n \"get\": {\n \"operationId\": \"findImportStatusByRepo\",\n \"summary\": \"Get Import Status by repository\",\n \"security\": [\n {\n \"BearerAuth\": []\n }\n ],\n \"tags\": [\n \"Import\"\n ],\n \"parameters\": [\n {\n \"in\": \"query\",\n \"name\": \"repo\",\n \"description\": \"the full URL to the repo\",\n \"schema\": {\n \"type\": \"string\"\n }\n },\n {\n \"in\": \"query\",\n \"name\": \"defaultBranch\",\n \"description\": \"the name of the default branch\",\n \"schema\": {\n \"type\": \"string\",\n \"default\": \"main\"\n }\n },\n {\n \"$ref\": \"#/components/parameters/approvalToolParam\"\n }\n ],\n \"responses\": {\n \"200\": {\n \"description\": \"Import Job status was determined successfully with no errors\",\n \"content\": {\n \"application/json\": {\n \"schema\": {\n \"$ref\": \"#/components/schemas/Import\"\n },\n \"examples\": {\n \"singleImportStatusForRepo\": {\n \"$ref\": \"#/components/examples/singleImportStatusForRepo\"\n }\n }\n }\n }\n },\n \"500\": {\n \"description\": \"Generic error\"\n }\n }\n },\n \"delete\": {\n \"operationId\": \"deleteImportByRepo\",\n \"summary\": \"Delete Import by repository\",\n \"security\": [\n {\n \"BearerAuth\": []\n }\n ],\n \"tags\": [\n \"Import\"\n ],\n \"parameters\": [\n {\n \"in\": \"query\",\n \"name\": \"repo\",\n \"description\": \"the full URL to the repo\",\n \"schema\": {\n \"type\": \"string\"\n }\n },\n {\n \"in\": \"query\",\n \"name\": \"defaultBranch\",\n \"description\": \"the name of the default branch\",\n \"schema\": {\n \"type\": \"string\",\n \"default\": \"main\"\n }\n },\n {\n \"$ref\": \"#/components/parameters/approvalToolParam\"\n }\n ],\n \"responses\": {\n \"204\": {\n \"description\": \"Import Job was successfully delete with no errors\"\n },\n \"500\": {\n \"description\": \"Generic error\"\n }\n }\n }\n }\n },\n \"components\": {\n \"parameters\": {\n \"apiVersionHeaderParam\": {\n \"in\": \"header\",\n \"name\": \"api-version\",\n \"description\": \"API version.\\\\n\\\\n## Changelog\\\\n\\\\n### v1 (default)\\\\nInitial version\\\\n#### Deprecations\\\\n* GET /imports\\\\n * Deprecation of 'pagePerIntegration' and 'sizePerIntegration' query parameters and introduction of new 'page' and 'size' parameters\\\\n * 'page' takes precedence over 'pagePerIntegration' if both are passed\\\\n * 'size' takes precedence over 'sizePerIntegration' if both are passed\\\\n\\\\n### v2\\\\n#### Breaking changes\\\\n* GET /imports\\\\n * Query parameters:\\\\n * 'pagePerIntegration' is ignored in favor of 'page'\\\\n * 'sizePerIntegration' is ignored in favor of 'size'\\\\n * Response structure changed to include pagination info: instead of returning a simple list of Imports, the response is now an object containing the following fields:\\\\n * 'imports': the list of Imports\\\\n * 'page': the page requested\\\\n * 'size': the requested number of Imports requested per page\\\\n * 'totalCount': the total count of Imports\\\\n\",\n \"schema\": {\n \"type\": \"string\",\n \"enum\": [\n \"v1\",\n \"v2\"\n ],\n \"default\": \"v1\"\n }\n },\n \"pagePerIntegrationQueryParam\": {\n \"in\": \"query\",\n \"name\": \"pagePerIntegration\",\n \"description\": \"the page number for each Integration\",\n \"schema\": {\n \"type\": \"integer\",\n \"default\": 1\n }\n },\n \"sizePerIntegrationQueryParam\": {\n \"in\": \"query\",\n \"name\": \"sizePerIntegration\",\n \"description\": \"the number of items per Integration to return per page\",\n \"schema\": {\n \"type\": \"integer\",\n \"default\": 20\n }\n },\n \"pagePerIntegrationQueryParamDeprecated\": {\n \"in\": \"query\",\n \"name\": \"pagePerIntegration\",\n \"description\": \"the page number for each Integration. **Deprecated**. Use the 'page' query parameter instead.\",\n \"deprecated\": true,\n \"schema\": {\n \"type\": \"integer\",\n \"default\": 1\n }\n },\n \"sortColumnQueryParam\": {\n \"in\": \"query\",\n \"name\": \"sortColumn\",\n \"description\": \"The allowed values for sorting columns:\\\\n- repository.name: Sort by repository name.\\\\n- repository.organization: Sort by organization URL.\\\\n- repository.url: Sort by repository URL.\\\\n- lastUpdate: Sort by the last time the catalog-info.yaml was updated.\\\\n- status: Sort by the status of the catalog-info.yaml.\\\\n\",\n \"required\": false,\n \"schema\": {\n \"enum\": [\n \"repository.name\",\n \"repository.organization\",\n \"repository.url\",\n \"lastUpdate\",\n \"status\"\n ],\n \"default\": \"repository.name\"\n }\n },\n \"sortOrderQueryParam\": {\n \"in\": \"query\",\n \"name\": \"sortOrder\",\n \"description\": \"The order of sorting asc for ascending or desc for descending\",\n \"required\": false,\n \"schema\": {\n \"type\": \"string\",\n \"enum\": [\n \"asc\",\n \"desc\"\n ],\n \"default\": \"asc\"\n }\n },\n \"sizePerIntegrationQueryParamDeprecated\": {\n \"in\": \"query\",\n \"name\": \"sizePerIntegration\",\n \"description\": \"the number of items per Integration to return per page. **Deprecated**. Use the 'size' query parameter instead.\",\n \"deprecated\": true,\n \"schema\": {\n \"type\": \"integer\",\n \"default\": 20\n }\n },\n \"searchQueryParam\": {\n \"in\": \"query\",\n \"name\": \"search\",\n \"description\": \"returns only the items that match the search string\",\n \"schema\": {\n \"type\": \"string\"\n }\n },\n \"pageQueryParam\": {\n \"in\": \"query\",\n \"name\": \"page\",\n \"description\": \"the requested page number\",\n \"schema\": {\n \"type\": \"integer\",\n \"default\": 1\n }\n },\n \"sizeQueryParam\": {\n \"in\": \"query\",\n \"name\": \"size\",\n \"description\": \"the number of items to return per page\",\n \"schema\": {\n \"type\": \"integer\",\n \"default\": 20\n }\n },\n \"approvalToolParam\": {\n \"in\": \"query\",\n \"name\": \"approvalTool\",\n \"description\": \"the approvalTool to use\",\n \"schema\": {\n \"type\": \"string\",\n \"default\": \"GIT\"\n }\n }\n },\n \"schemas\": {\n \"OrganizationList\": {\n \"title\": \"Organization List\",\n \"type\": \"object\",\n \"properties\": {\n \"organizations\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/components/schemas/Organization\"\n }\n },\n \"errors\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n },\n \"totalCount\": {\n \"type\": \"integer\"\n },\n \"pagePerIntegration\": {\n \"type\": \"integer\"\n },\n \"sizePerIntegration\": {\n \"type\": \"integer\"\n }\n }\n },\n \"Organization\": {\n \"title\": \"Organization\",\n \"type\": \"object\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\",\n \"description\": \"unique identifier\"\n },\n \"name\": {\n \"type\": \"string\",\n \"description\": \"organization name\"\n },\n \"description\": {\n \"type\": \"string\",\n \"description\": \"organization description\"\n },\n \"url\": {\n \"type\": \"string\",\n \"description\": \"organization URL\"\n },\n \"totalRepoCount\": {\n \"type\": \"number\",\n \"description\": \"total number of repositories in this Organization\"\n },\n \"errors\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n }\n }\n },\n \"RepositoryList\": {\n \"title\": \"Repository List\",\n \"type\": \"object\",\n \"properties\": {\n \"repositories\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/components/schemas/Repository\"\n }\n },\n \"errors\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n },\n \"totalCount\": {\n \"type\": \"integer\"\n },\n \"pagePerIntegration\": {\n \"type\": \"integer\"\n },\n \"sizePerIntegration\": {\n \"type\": \"integer\"\n }\n }\n },\n \"Repository\": {\n \"title\": \"Repository\",\n \"type\": \"object\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\",\n \"description\": \"unique identifier\"\n },\n \"name\": {\n \"type\": \"string\",\n \"description\": \"repository name\"\n },\n \"url\": {\n \"type\": \"string\",\n \"description\": \"repository URL\"\n },\n \"organization\": {\n \"type\": \"string\",\n \"description\": \"organization which the repository is part of\"\n },\n \"importStatus\": {\n \"oneOf\": [\n {\n \"$ref\": \"#/components/schemas/ImportStatus\"\n },\n {\n \"$ref\": \"#/components/schemas/TaskImportStatus\"\n }\n ]\n },\n \"defaultBranch\": {\n \"type\": \"string\",\n \"description\": \"default branch\"\n },\n \"lastUpdate\": {\n \"type\": \"string\",\n \"format\": \"date-time\"\n },\n \"errors\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n }\n }\n },\n \"ApprovalTool\": {\n \"type\": \"string\",\n \"enum\": [\n \"GIT\",\n \"SERVICENOW\",\n \"GITLAB\"\n ]\n },\n \"TaskImportStatus\": {\n \"type\": \"string\",\n \"nullable\": true,\n \"description\": \"Import Job status\",\n \"enum\": [\n \"TASK_CANCELLED\",\n \"TASK_COMPLETED\",\n \"TASK_FAILED\",\n \"TASK_OPEN\",\n \"TASK_PROCESSING\",\n \"TASK_SKIPPED\",\n \"TASK_FETCH_FAILED\"\n ]\n },\n \"ImportStatus\": {\n \"type\": \"string\",\n \"nullable\": true,\n \"description\": \"Import Job status\",\n \"enum\": [\n \"ADDED\",\n \"WAIT_PR_APPROVAL\",\n \"PR_ERROR\",\n null\n ]\n },\n \"ImportJobListV2\": {\n \"title\": \"Import Job List\",\n \"type\": \"object\",\n \"properties\": {\n \"imports\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/components/schemas/SourceImport\"\n }\n },\n \"errors\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n },\n \"totalCount\": {\n \"type\": \"integer\"\n },\n \"page\": {\n \"type\": \"integer\"\n },\n \"size\": {\n \"type\": \"integer\"\n }\n }\n },\n \"Import\": {\n \"title\": \"Import Job\",\n \"type\": \"object\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\"\n },\n \"status\": {\n \"oneOf\": [\n {\n \"$ref\": \"#/components/schemas/ImportStatus\"\n },\n {\n \"$ref\": \"#/components/schemas/TaskImportStatus\"\n }\n ]\n },\n \"task\": {\n \"type\": \"object\",\n \"properties\": {\n \"taskId\": {\n \"type\": \"string\"\n }\n }\n },\n \"tasks\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"taskId\": {\n \"type\": \"string\"\n }\n }\n }\n },\n \"catalogEntityName\": {\n \"type\": \"string\",\n \"description\": \"Specified entity name in the catalog. Filled only in response for dry-run import requests.\"\n },\n \"lastUpdate\": {\n \"type\": \"string\",\n \"format\": \"date-time\"\n },\n \"errors\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n },\n \"approvalTool\": {\n \"$ref\": \"#/components/schemas/ApprovalTool\"\n },\n \"repository\": {\n \"$ref\": \"#/components/schemas/Repository\"\n },\n \"gitlab\": {\n \"type\": \"object\",\n \"description\": \"GitLab details. Applicable if approvalTool is gitlab.\",\n \"properties\": {\n \"pullRequest\": {\n \"$ref\": \"#/components/schemas/PullRequest\"\n }\n }\n },\n \"github\": {\n \"type\": \"object\",\n \"description\": \"GitHub details. Applicable if approvalTool is git.\",\n \"properties\": {\n \"pullRequest\": {\n \"$ref\": \"#/components/schemas/PullRequest\"\n }\n }\n }\n }\n },\n \"PullRequest\": {\n \"type\": \"object\",\n \"properties\": {\n \"url\": {\n \"type\": \"string\",\n \"description\": \"URL of the Pull Request\"\n },\n \"number\": {\n \"type\": \"number\",\n \"description\": \"Pull Request number\"\n },\n \"title\": {\n \"type\": \"string\",\n \"description\": \"title of the Pull Request\"\n },\n \"body\": {\n \"type\": \"string\",\n \"description\": \"body of the Pull Request\"\n },\n \"catalogInfoContent\": {\n \"type\": \"string\",\n \"description\": \"content of the catalog-info.yaml as fetched from the Pull Request.\"\n },\n \"status\": {\n \"type\": \"string\",\n \"enum\": [\n \"WAIT_PR_APPROVAL\",\n \"PR_MERGED\",\n \"PR_ERROR\"\n ]\n }\n }\n },\n \"SourceImport\": {\n \"title\": \"Import Job with source it originates from\",\n \"allOf\": [\n {\n \"$ref\": \"#/components/schemas/Import\"\n },\n {\n \"type\": \"object\",\n \"properties\": {\n \"source\": {\n \"$ref\": \"#/components/schemas/Source\"\n }\n }\n }\n ]\n },\n \"Source\": {\n \"type\": \"string\",\n \"nullable\": true,\n \"description\": \"Import Source:\\\\n * 'config' - Import from static catalog location configuration in 'app-config'\\\\n * 'location' - Import of user registered entities using locations endpoint\\\\n * 'integration' - Import using a GitHub integration\\\\n * null - Import source is unknown\\\\n\",\n \"enum\": [\n \"config\",\n \"location\",\n \"integration\",\n null\n ]\n },\n \"ImportRequest\": {\n \"title\": \"Import Job request\",\n \"type\": \"object\",\n \"required\": [\n \"repository\"\n ],\n \"properties\": {\n \"approvalTool\": {\n \"$ref\": \"#/components/schemas/ApprovalTool\"\n },\n \"catalogEntityName\": {\n \"type\": \"string\",\n \"description\": \"Expected Entity name in the catalog. Relevant only if the 'dryRun' query parameter is set to 'true'.\"\n },\n \"codeOwnersFileAsEntityOwner\": {\n \"type\": \"boolean\",\n \"description\": \"Whether the CODEOWNERS file will be used as entity owner. Only relevant for dry-run requests. If set to 'false', the corresponding dry-run check will be skipped.\"\n },\n \"repository\": {\n \"type\": \"object\",\n \"required\": [\n \"url\"\n ],\n \"properties\": {\n \"name\": {\n \"type\": \"string\",\n \"description\": \"repository name\"\n },\n \"url\": {\n \"type\": \"string\",\n \"description\": \"repository URL\"\n },\n \"organization\": {\n \"type\": \"string\",\n \"description\": \"organization which the repository is part of\"\n },\n \"defaultBranch\": {\n \"type\": \"string\",\n \"description\": \"default branch\"\n }\n }\n },\n \"catalogInfoContent\": {\n \"type\": \"string\",\n \"description\": \"content of the catalog-info.yaml to include in the import Pull Request.\"\n },\n \"gitlab\": {\n \"type\": \"object\",\n \"description\": \"GitLab details. Applicable if approvalTool is gitlab.\",\n \"properties\": {\n \"pullRequest\": {\n \"$ref\": \"#/components/schemas/PullRequest\"\n }\n }\n },\n \"github\": {\n \"type\": \"object\",\n \"description\": \"GitHub details. Applicable if approvalTool is git.\",\n \"properties\": {\n \"pullRequest\": {\n \"$ref\": \"#/components/schemas/PullRequest\"\n }\n }\n }\n }\n },\n \"ScaffolderTask\": {\n \"title\": \"Scaffolder Task\",\n \"type\": \"object\",\n \"properties\": {\n \"taskId\": {\n \"type\": \"string\"\n },\n \"repositoryId\": {\n \"type\": \"number\"\n },\n \"locations\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n }\n }\n }\n },\n \"securitySchemes\": {\n \"BearerAuth\": {\n \"type\": \"http\",\n \"scheme\": \"bearer\",\n \"bearerFormat\": \"JWT\",\n \"description\": \"Backstage Permissions Framework JWT\"\n }\n },\n \"examples\": {\n \"multipleOrgs\": {\n \"summary\": \"Multiple organizations\",\n \"value\": {\n \"errors\": [],\n \"organizations\": [\n {\n \"id\": \"unique-org-id-1\",\n \"name\": \"pet-org\",\n \"url\": \"https://github.com/pet-org\",\n \"description\": \"A great Pet Org\",\n \"totalRepoCount\": 10\n },\n {\n \"id\": \"unique-org-id-2\",\n \"name\": \"org-zero\",\n \"url\": \"https://ghe.example.com/org-zero\",\n \"totalRepoCount\": 0\n },\n {\n \"id\": \"unique-id-2\",\n \"name\": \"org-one\",\n \"url\": \"https://ghe.example.com/org-one\",\n \"description\": \"Org One description\",\n \"totalRepoCount\": 1234\n }\n ]\n }\n },\n \"orgListErrors\": {\n \"summary\": \"Errors when listing organizations\",\n \"value\": {\n \"errors\": [\n \"Github App with ID 2 failed spectacularly\"\n ],\n \"organizations\": []\n }\n },\n \"multipleRepos\": {\n \"summary\": \"Multiple repositories\",\n \"value\": {\n \"errors\": [],\n \"repositories\": [\n {\n \"id\": \"unique-id-1\",\n \"name\": \"pet-app\",\n \"url\": \"https://github.com/my-org/pet-app\",\n \"organization\": \"my-org\",\n \"importStatus\": \"WAIT_PR_APPROVAL\",\n \"defaultBranch\": \"main\"\n },\n {\n \"id\": \"unique-id-2\",\n \"name\": \"project-zero\",\n \"url\": \"https://ghe.example.com/my-other-org/project-zero\",\n \"organization\": \"my-other-org\",\n \"importStatus\": \"PR_REJECTED\",\n \"defaultBranch\": \"dev\"\n },\n {\n \"id\": \"unique-id-2\",\n \"name\": \"project-one\",\n \"defaultBranch\": \"trunk\",\n \"url\": \"https://ghe.example.com/my-other-org-2/project-one\",\n \"organization\": \"my-other-org-2\"\n }\n ]\n }\n },\n \"repositoryListErrors\": {\n \"summary\": \"Errors when listing repositories\",\n \"value\": {\n \"errors\": [\n \"Github App with ID 2 failed spectacularly\"\n ],\n \"repositories\": []\n }\n },\n \"twoImports\": {\n \"summary\": \"Two import job requests (V1)\",\n \"value\": [\n {\n \"id\": \"bulk-import-id-1\",\n \"status\": \"WAIT_PR_APPROVAL\",\n \"errors\": [],\n \"approvalTool\": \"GIT\",\n \"repository\": {\n \"name\": \"pet-app\",\n \"url\": \"https://github.com/my-org/pet-app\",\n \"organization\": \"my-org\"\n },\n \"github\": {\n \"pullRequest\": {\n \"url\": \"https://github.com/my-org/pet-app/pull/1\",\n \"number\": 1\n }\n }\n },\n {\n \"id\": \"bulk-import-id-2\",\n \"status\": \"PR_REJECTED\",\n \"errors\": [],\n \"approvalTool\": \"GIT\",\n \"repository\": {\n \"name\": \"pet-app-test\",\n \"url\": \"https://github.com/my-org/pet-app-test\",\n \"organization\": \"my-org\"\n },\n \"github\": {\n \"pullRequest\": {\n \"url\": \"https://github.com/my-org/pet-app-test/pull/10\",\n \"number\": 10\n }\n }\n }\n ]\n },\n \"multipleImportJobsV2\": {\n \"summary\": \"Two import job requests (V2)\",\n \"value\": {\n \"errors\": [],\n \"page\": 1,\n \"size\": 2,\n \"totalCount\": 10,\n \"imports\": [\n {\n \"id\": \"bulk-import-id-1\",\n \"status\": \"WAIT_PR_APPROVAL\",\n \"errors\": [],\n \"approvalTool\": \"GIT\",\n \"repository\": {\n \"name\": \"pet-app\",\n \"url\": \"https://github.com/my-org/pet-app\",\n \"organization\": \"my-org\"\n },\n \"github\": {\n \"pullRequest\": {\n \"url\": \"https://github.com/my-org/pet-app/pull/1\",\n \"number\": 1\n }\n }\n },\n {\n \"id\": \"bulk-import-id-2\",\n \"status\": \"PR_REJECTED\",\n \"errors\": [],\n \"approvalTool\": \"GIT\",\n \"repository\": {\n \"name\": \"pet-app-test\",\n \"url\": \"https://github.com/my-org/pet-app-test\",\n \"organization\": \"my-org\"\n },\n \"github\": {\n \"pullRequest\": {\n \"url\": \"https://github.com/my-org/pet-app-test/pull/10\",\n \"number\": 10\n }\n }\n }\n ]\n }\n },\n \"importJobListErrors\": {\n \"summary\": \"Errors when listing import jobs\",\n \"value\": {\n \"errors\": [\n \"Github App with ID xyz-123 failed spectacularly\"\n ],\n \"imports\": []\n }\n },\n \"twoImportJobs\": {\n \"summary\": \"Two import jobs\",\n \"value\": [\n {\n \"id\": \"bulk-import-id-1\",\n \"status\": \"WAIT_PR_APPROVAL\",\n \"errors\": [],\n \"approvalTool\": \"GIT\",\n \"repository\": {\n \"name\": \"pet-app\",\n \"url\": \"https://github.com/my-org/pet-app\",\n \"organization\": \"my-org\"\n },\n \"github\": {\n \"pullRequest\": {\n \"url\": \"https://github.com/my-org/pet-app/pull/1\",\n \"number\": 1\n }\n }\n },\n {\n \"id\": \"bulk-import-id-2\",\n \"status\": \"PR_REJECTED\",\n \"errors\": [],\n \"approvalTool\": \"GIT\",\n \"repository\": {\n \"name\": \"pet-app-test\",\n \"url\": \"https://github.com/my-org/pet-app-test\",\n \"organization\": \"my-org\"\n },\n \"github\": {\n \"pullRequest\": {\n \"url\": \"https://github.com/my-org/pet-app-test/pull/10\",\n \"number\": 10\n }\n }\n }\n ]\n },\n \"singleImportStatusForRepo\": {\n \"summary\": \"Single import job status for given repo\",\n \"value\": {\n \"id\": \"bulk-import-id-1\",\n \"status\": \"WAIT_PR_APPROVAL\",\n \"errors\": [],\n \"approvalTool\": \"GIT\",\n \"repository\": {\n \"name\": \"pet-app\",\n \"url\": \"https://github.com/my-org/pet-app\",\n \"organization\": \"my-org\"\n },\n \"github\": {\n \"pullRequest\": {\n \"url\": \"https://github.com/my-org/pet-app/pull/1\",\n \"number\": 1\n }\n }\n }\n },\n \"multipleImportRequests\": {\n \"summary\": \"Multiple import requests\",\n \"value\": [\n {\n \"approvalTool\": \"GIT\",\n \"repository\": {\n \"name\": \"pet-app\",\n \"url\": \"https://github.com/my-org/pet-app\",\n \"organization\": \"my-org\",\n \"defaultBranch\": \"main\"\n },\n \"github\": {\n \"pullRequest\": {\n \"title\": \"Add default catalog-info.yaml to import to Red Hat Developer Hub\"\n }\n }\n },\n {\n \"approvalTool\": \"GIT\",\n \"repository\": {\n \"name\": \"project-zero\",\n \"url\": \"https://ghe.example.com/my-other-org/project-zero\",\n \"organization\": \"my-other-org\",\n \"defaultBranch\": \"dev\"\n },\n \"github\": {\n \"pullRequest\": {\n \"title\": \"Add custom catalog-info.yaml to import to Red Hat Developer Hub\",\n \"body\": \"This pull request adds a **Backstage entity metadata file** to this repository so that the component can be added to the Red Hat Developer Hub software catalog.\\\\n\\\\nAfter this pull request is merged, the component will become available.\\\\n\\\\nFor more information, read an [overview of the Backstage software catalog](https://backstage.io/docs/features/software-catalog/).\"\n }\n },\n \"catalogInfoContent\": \"apiVersion: backstage.io/v1alpha1\\\\nkind: Component\\\\nmetadata:\\\\n name: project-zero\\\\n annotations:\\\\n github.com/project-slug: my-other-org/project-zero\\\\n acme.com/custom-annotation: my-value\\\\nspec:\\\\n type: other\\\\n lifecycle: unknown\\\\n owner: my-other-org\"\n }\n ]\n }\n }\n }\n}`\nexport const openApiDocument = JSON.parse(OPENAPI);\n"],"names":[],"mappings":";;AAkBA,MAAM,OAAU,GAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;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;;;"}
|
|
@@ -195,13 +195,15 @@ const createTaskImportJobs = async (templateRef, discovery, logger, auth, config
|
|
|
195
195
|
result.push(updatedImport);
|
|
196
196
|
} else {
|
|
197
197
|
try {
|
|
198
|
-
const
|
|
198
|
+
const gitProviderHost = new URL(importReq.repository.url).hostname;
|
|
199
|
+
const normalizedUrl = `${gitProviderHost}?owner=${owner}&repo=${repoName}`;
|
|
199
200
|
const scaffolderOptions = {
|
|
200
201
|
name: repoName,
|
|
201
202
|
organization: owner,
|
|
202
203
|
repoUrl: normalizedUrl,
|
|
203
204
|
branchName: `bulk-import-catalog-entity`,
|
|
204
|
-
targetBranchName: importReq.repository.defaultBranch
|
|
205
|
+
targetBranchName: importReq.repository.defaultBranch,
|
|
206
|
+
gitProviderHost
|
|
205
207
|
};
|
|
206
208
|
const { taskId, status, createdAt } = await executeTask(scaffolderOptions);
|
|
207
209
|
const repositoryId = await repositoryDao.insertRepository(
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"execute-template.cjs.js","sources":["../../../../src/service/handlers/import/execute-template.ts"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n AuthService,\n DiscoveryService,\n LoggerService,\n} from '@backstage/backend-plugin-api';\nimport { Config } from '@backstage/config';\n\nimport { fetchEventSource } from '@microsoft/fetch-event-source';\nimport gitUrlParse from 'git-url-parse';\n\nimport { getCatalogFilename } from '../../../catalog/catalogUtils';\nimport {\n RepositoryDao,\n ScaffolderTaskDao,\n TaskLocationsDao,\n} from '../../../database/repositoryDao';\nimport { Components } from '../../../generated/openapi';\nimport { GithubApiService } from '../../../github';\nimport { HandlerResponse } from '../handlers';\n\ninterface ScaffolderEvent {\n id: number;\n isTaskRecoverable: boolean;\n taskId: string;\n body: {\n message: string;\n stepId?: string;\n status?: string;\n [key: string]: any;\n };\n type: 'log' | 'completion' | 'error';\n createdAt: string;\n error?: any;\n}\n\nasync function* getEvents(\n taskId: string,\n scaffolderUrl: string,\n token: string,\n logger: LoggerService,\n) {\n const url = `${scaffolderUrl}/v2/tasks/${taskId}/eventstream`;\n\n const queue: ScaffolderEvent[] = [];\n let resolver: ((event: ScaffolderEvent) => void) | undefined;\n\n const handleEvent = (data: any) => {\n logger.info('Received event:', data);\n if (resolver) {\n resolver(data);\n resolver = undefined;\n } else {\n queue.push(data);\n }\n };\n\n const controller = new AbortController();\n\n fetchEventSource(url, {\n method: 'GET',\n headers: {\n Authorization: `Bearer ${token}`,\n },\n signal: controller.signal,\n onopen: async response => {\n logger.info('SSE connection opened', { status: response.status });\n },\n onmessage: event => {\n try {\n const data: ScaffolderEvent = JSON.parse(event.data);\n handleEvent(data);\n } catch (err) {\n logger.error('==== Failed to parse SSE event', err);\n }\n },\n onclose: () => {\n logger.info('SSE connection closed');\n },\n onerror: err => {\n logger.error('==== SSE error', err);\n handleEvent({\n type: 'error',\n error: err,\n id: -1,\n isTaskRecoverable: false,\n taskId,\n body: { message: err?.message ?? '' },\n createdAt: new Date().toISOString(),\n });\n controller.abort();\n },\n }).catch(err => logger.error('==== fetchEventSource failed', err));\n\n const nextEvent = (): Promise<ScaffolderEvent> =>\n new Promise(resolve => {\n resolver = resolve;\n });\n\n while (true) {\n const event: ScaffolderEvent =\n queue.length > 0 ? queue.shift()! : await nextEvent();\n\n yield event;\n\n if (event.type === 'completion' || event.type === 'error') {\n controller.abort();\n break;\n }\n }\n}\n\nasync function processTaskEvents(\n taskId: string,\n scaffolderUrl: string,\n token: string,\n logger: LoggerService,\n taskLocationsDao: TaskLocationsDao,\n) {\n try {\n for await (const event of getEvents(taskId, scaffolderUrl, token, logger)) {\n if (event.type === 'log') {\n const message = event.body.message;\n const match = message.match(/Registering (.*) in the catalog/);\n if (match?.[1]) {\n await taskLocationsDao.addTaskLocation(taskId, match[1]);\n }\n }\n }\n } catch (e) {\n logger.error(`==== Failed to process events for task ${taskId}`, e);\n }\n}\n\nconst handlePullRequestUpdate = async (\n importReq: Components.Schemas.ImportRequest,\n logger: LoggerService,\n config: Config,\n githubApiService: GithubApiService,\n): Promise<Components.Schemas.Import> => {\n const url = importReq.repository.url;\n const owner = importReq.repository.organization;\n const repoName = importReq.repository.name;\n const prUrl = importReq.github?.pullRequest?.url;\n const prNumber = importReq.github?.pullRequest?.number;\n const prTitle = importReq.github?.pullRequest?.title;\n const prBody = importReq.github?.pullRequest?.body;\n const catalogInfoContent = importReq.catalogInfoContent;\n\n const result: Components.Schemas.Import = {\n repository: {\n organization: owner,\n url: url,\n name: repoName,\n },\n github: {\n pullRequest: {\n url: prUrl,\n number: prNumber,\n title: prTitle,\n body: prBody,\n catalogInfoContent: catalogInfoContent,\n },\n },\n approvalTool: importReq.approvalTool,\n };\n\n try {\n if (prNumber && prTitle && prBody) {\n await githubApiService.updatePullRequest(url, prNumber, prTitle, prBody);\n\n const prInfo = await githubApiService.getPullRequest(url, prNumber);\n\n // Update catalog info content in the pull request\n const gitUrl = gitUrlParse(url);\n const fileName = getCatalogFilename(config);\n if (catalogInfoContent && prInfo.prBranch) {\n await githubApiService.createOrUpdateFileInBranch(\n gitUrl.owner,\n gitUrl.name,\n prInfo.prBranch,\n fileName,\n catalogInfoContent,\n );\n }\n } else {\n logger.warn(`prNumber is undefined, skipping updatePullRequest`);\n }\n } catch (err) {\n logger.error(`Failed to update pull request ${prUrl}`, err);\n result.status = 'PR_ERROR';\n result.errors = [err];\n return result;\n }\n\n result.status = 'WAIT_PR_APPROVAL';\n return result;\n};\n\nexport const createTaskImportJobs = async (\n templateRef: string,\n discovery: DiscoveryService,\n logger: LoggerService,\n auth: AuthService,\n config: Config,\n repositoryDao: RepositoryDao,\n taskDao: ScaffolderTaskDao,\n taskLocationsDao: TaskLocationsDao,\n importRequests: Components.Schemas.ImportRequest[],\n githubApiService: GithubApiService,\n): Promise<\n HandlerResponse<Components.Schemas.Import[] | { errors: string[] }>\n> => {\n if (importRequests.length === 0) {\n logger.debug('Missing import requests from request body');\n return {\n statusCode: 400,\n responseBody: [],\n };\n }\n\n const result: Components.Schemas.Import[] = [];\n\n const scaffolderUrl = await discovery.getBaseUrl('scaffolder');\n const { token } = await auth.getPluginRequestToken({\n onBehalfOf: await auth.getOwnServiceCredentials(),\n targetPluginId: 'scaffolder',\n });\n\n const executeTask = async (\n values: Record<string, any>,\n ): Promise<{ taskId: string; status: string; createdAt: string }> => {\n const response = await fetch(`${scaffolderUrl}/v2/tasks`, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n Authorization: `Bearer ${token}`,\n },\n body: JSON.stringify({\n templateRef: `${templateRef}`,\n values: {\n repoUrl: values.repoUrl,\n owner: values.owner,\n ...values,\n },\n secrets: {},\n }),\n });\n\n if (!response.ok) {\n throw new Error(\n `Failed to start scaffolder task: ${response.status} ${response.statusText}`,\n );\n }\n\n const data = await response.json();\n const taskResp = await fetch(`${scaffolderUrl}/v2/tasks/${data.id}`, {\n headers: {\n Authorization: `Bearer ${token}`,\n },\n });\n\n const task = await taskResp.json();\n return { taskId: data.id, status: task.status, createdAt: task.createdAt };\n };\n\n for (const importReq of importRequests) {\n const url = importReq.repository.url;\n const owner = importReq.repository.organization;\n const repoName = importReq.repository.name;\n if (importReq.github?.pullRequest?.url) {\n const updatedImport = await handlePullRequestUpdate(\n importReq,\n logger,\n config,\n githubApiService,\n );\n result.push(updatedImport);\n } else {\n try {\n // Create new task\n const normalizedUrl = `${new URL(importReq.repository.url).hostname}?owner=${owner}&repo=${repoName}`;\n\n const scaffolderOptions = {\n name: repoName,\n organization: owner,\n repoUrl: normalizedUrl,\n branchName: `bulk-import-catalog-entity`,\n targetBranchName: importReq.repository.defaultBranch,\n };\n const { taskId, status, createdAt } =\n await executeTask(scaffolderOptions);\n\n const repositoryId = await repositoryDao.insertRepository(\n url,\n taskId,\n importReq.approvalTool ?? 'GIT',\n );\n await taskDao.insertTask({\n repositoryId,\n scaffolderOptions,\n taskId,\n executedAt: new Date(),\n });\n result.push({\n repository: {\n organization: owner,\n url,\n name: repoName,\n },\n status:\n `TASK_${status.toLocaleUpperCase()}` as Components.Schemas.TaskImportStatus,\n task: { taskId },\n lastUpdate: createdAt,\n approvalTool: importReq.approvalTool,\n });\n\n processTaskEvents(\n taskId,\n scaffolderUrl,\n token,\n logger,\n taskLocationsDao,\n );\n } catch (error: any) {\n logger.error(`Error processing import request for ${url}`, error);\n result.push({\n repository: {\n organization: owner,\n url,\n name: repoName,\n },\n status: 'TASK_FAILED',\n errors: [error.message],\n approvalTool: importReq.approvalTool,\n });\n }\n }\n }\n\n if (result.some(r => r.errors)) {\n return {\n statusCode: 202,\n responseBody: { errors: result.flatMap(r => r.errors || []) },\n };\n }\n\n return {\n statusCode: 202,\n responseBody: result,\n };\n};\n"],"names":["fetchEventSource","gitUrlParse","getCatalogFilename"],"mappings":";;;;;;;;;;AAmDA,gBAAgB,SACd,CAAA,MAAA,EACA,aACA,EAAA,KAAA,EACA,MACA,EAAA;AACA,EAAA,MAAM,GAAM,GAAA,CAAA,EAAG,aAAa,CAAA,UAAA,EAAa,MAAM,CAAA,YAAA,CAAA;AAE/C,EAAA,MAAM,QAA2B,EAAC;AAClC,EAAI,IAAA,QAAA;AAEJ,EAAM,MAAA,WAAA,GAAc,CAAC,IAAc,KAAA;AACjC,IAAO,MAAA,CAAA,IAAA,CAAK,mBAAmB,IAAI,CAAA;AACnC,IAAA,IAAI,QAAU,EAAA;AACZ,MAAA,QAAA,CAAS,IAAI,CAAA;AACb,MAAW,QAAA,GAAA,SAAA;AAAA,KACN,MAAA;AACL,MAAA,KAAA,CAAM,KAAK,IAAI,CAAA;AAAA;AACjB,GACF;AAEA,EAAM,MAAA,UAAA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O,CAAA,iBAAA,EAAmB,CAAA,CAAA;AAAA,UACpC,IAAA,EAAM,EAAE,MAAO,EAAA;AAAA,UACf,UAAY,EAAA,SAAA;AAAA,UACZ,cAAc,SAAU,CAAA;AAAA,SACzB,CAAA;AAED,QAAA,iBAAA;AAAA,UACE,MAAA;AAAA,UACA,aAAA;AAAA,UACA,KAAA;AAAA,UACA,MAAA;AAAA,UACA;AAAA,SACF;AAAA,eACO,KAAY,EAAA;AACnB,QAAA,MAAA,CAAO,KAAM,CAAA,CAAA,oCAAA,EAAuC,GAAG,CAAA,CAAA,EAAI,KAAK,CAAA;AAChE,QAAA,MAAA,CAAO,IAAK,CAAA;AAAA,UACV,UAAY,EAAA;AAAA,YACV,YAAc,EAAA,KAAA;AAAA,YACd,GAAA;AAAA,YACA,IAAM,EAAA;AAAA,WACR;AAAA,UACA,MAAQ,EAAA,aAAA;AAAA,UACR,MAAA,EAAQ,CAAC,KAAA,CAAM,OAAO,CAAA;AAAA,UACtB,cAAc,SAAU,CAAA;AAAA,SACzB,CAAA;AAAA;AACH;AACF;AAGF,EAAA,IAAI,MAAO,CAAA,IAAA,CAAK,CAAK,CAAA,KAAA,CAAA,CAAE,MAAM,CAAG,EAAA;AAC9B,IAAO,OAAA;AAAA,MACL,UAAY,EAAA,GAAA;AAAA,MACZ,YAAA,EAAc,EAAE,MAAA,EAAQ,MAAO,CAAA,OAAA,CAAQ,OAAK,CAAE,CAAA,MAAA,IAAU,EAAE,CAAE;AAAA,KAC9D;AAAA;AAGF,EAAO,OAAA;AAAA,IACL,UAAY,EAAA,GAAA;AAAA,IACZ,YAAc,EAAA;AAAA,GAChB;AACF;;;;"}
|
|
1
|
+
{"version":3,"file":"execute-template.cjs.js","sources":["../../../../src/service/handlers/import/execute-template.ts"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n AuthService,\n DiscoveryService,\n LoggerService,\n} from '@backstage/backend-plugin-api';\nimport { Config } from '@backstage/config';\n\nimport { fetchEventSource } from '@microsoft/fetch-event-source';\nimport gitUrlParse from 'git-url-parse';\n\nimport { getCatalogFilename } from '../../../catalog/catalogUtils';\nimport {\n RepositoryDao,\n ScaffolderTaskDao,\n TaskLocationsDao,\n} from '../../../database/repositoryDao';\nimport { Components } from '../../../generated/openapi';\nimport { GithubApiService } from '../../../github';\nimport { HandlerResponse } from '../handlers';\n\ninterface ScaffolderEvent {\n id: number;\n isTaskRecoverable: boolean;\n taskId: string;\n body: {\n message: string;\n stepId?: string;\n status?: string;\n [key: string]: any;\n };\n type: 'log' | 'completion' | 'error';\n createdAt: string;\n error?: any;\n}\n\nasync function* getEvents(\n taskId: string,\n scaffolderUrl: string,\n token: string,\n logger: LoggerService,\n) {\n const url = `${scaffolderUrl}/v2/tasks/${taskId}/eventstream`;\n\n const queue: ScaffolderEvent[] = [];\n let resolver: ((event: ScaffolderEvent) => void) | undefined;\n\n const handleEvent = (data: any) => {\n logger.info('Received event:', data);\n if (resolver) {\n resolver(data);\n resolver = undefined;\n } else {\n queue.push(data);\n }\n };\n\n const controller = new AbortController();\n\n fetchEventSource(url, {\n method: 'GET',\n headers: {\n Authorization: `Bearer ${token}`,\n },\n signal: controller.signal,\n onopen: async response => {\n logger.info('SSE connection opened', { status: response.status });\n },\n onmessage: event => {\n try {\n const data: ScaffolderEvent = JSON.parse(event.data);\n handleEvent(data);\n } catch (err) {\n logger.error('==== Failed to parse SSE event', err);\n }\n },\n onclose: () => {\n logger.info('SSE connection closed');\n },\n onerror: err => {\n logger.error('==== SSE error', err);\n handleEvent({\n type: 'error',\n error: err,\n id: -1,\n isTaskRecoverable: false,\n taskId,\n body: { message: err?.message ?? '' },\n createdAt: new Date().toISOString(),\n });\n controller.abort();\n },\n }).catch(err => logger.error('==== fetchEventSource failed', err));\n\n const nextEvent = (): Promise<ScaffolderEvent> =>\n new Promise(resolve => {\n resolver = resolve;\n });\n\n while (true) {\n const event: ScaffolderEvent =\n queue.length > 0 ? queue.shift()! : await nextEvent();\n\n yield event;\n\n if (event.type === 'completion' || event.type === 'error') {\n controller.abort();\n break;\n }\n }\n}\n\nasync function processTaskEvents(\n taskId: string,\n scaffolderUrl: string,\n token: string,\n logger: LoggerService,\n taskLocationsDao: TaskLocationsDao,\n) {\n try {\n for await (const event of getEvents(taskId, scaffolderUrl, token, logger)) {\n if (event.type === 'log') {\n const message = event.body.message;\n const match = message.match(/Registering (.*) in the catalog/);\n if (match?.[1]) {\n await taskLocationsDao.addTaskLocation(taskId, match[1]);\n }\n }\n }\n } catch (e) {\n logger.error(`==== Failed to process events for task ${taskId}`, e);\n }\n}\n\nconst handlePullRequestUpdate = async (\n importReq: Components.Schemas.ImportRequest,\n logger: LoggerService,\n config: Config,\n githubApiService: GithubApiService,\n): Promise<Components.Schemas.Import> => {\n const url = importReq.repository.url;\n const owner = importReq.repository.organization;\n const repoName = importReq.repository.name;\n const prUrl = importReq.github?.pullRequest?.url;\n const prNumber = importReq.github?.pullRequest?.number;\n const prTitle = importReq.github?.pullRequest?.title;\n const prBody = importReq.github?.pullRequest?.body;\n const catalogInfoContent = importReq.catalogInfoContent;\n\n const result: Components.Schemas.Import = {\n repository: {\n organization: owner,\n url: url,\n name: repoName,\n },\n github: {\n pullRequest: {\n url: prUrl,\n number: prNumber,\n title: prTitle,\n body: prBody,\n catalogInfoContent: catalogInfoContent,\n },\n },\n approvalTool: importReq.approvalTool,\n };\n\n try {\n if (prNumber && prTitle && prBody) {\n await githubApiService.updatePullRequest(url, prNumber, prTitle, prBody);\n\n const prInfo = await githubApiService.getPullRequest(url, prNumber);\n\n // Update catalog info content in the pull request\n const gitUrl = gitUrlParse(url);\n const fileName = getCatalogFilename(config);\n if (catalogInfoContent && prInfo.prBranch) {\n await githubApiService.createOrUpdateFileInBranch(\n gitUrl.owner,\n gitUrl.name,\n prInfo.prBranch,\n fileName,\n catalogInfoContent,\n );\n }\n } else {\n logger.warn(`prNumber is undefined, skipping updatePullRequest`);\n }\n } catch (err) {\n logger.error(`Failed to update pull request ${prUrl}`, err);\n result.status = 'PR_ERROR';\n result.errors = [err];\n return result;\n }\n\n result.status = 'WAIT_PR_APPROVAL';\n return result;\n};\n\nexport const createTaskImportJobs = async (\n templateRef: string,\n discovery: DiscoveryService,\n logger: LoggerService,\n auth: AuthService,\n config: Config,\n repositoryDao: RepositoryDao,\n taskDao: ScaffolderTaskDao,\n taskLocationsDao: TaskLocationsDao,\n importRequests: Components.Schemas.ImportRequest[],\n githubApiService: GithubApiService,\n): Promise<\n HandlerResponse<Components.Schemas.Import[] | { errors: string[] }>\n> => {\n if (importRequests.length === 0) {\n logger.debug('Missing import requests from request body');\n return {\n statusCode: 400,\n responseBody: [],\n };\n }\n\n const result: Components.Schemas.Import[] = [];\n\n const scaffolderUrl = await discovery.getBaseUrl('scaffolder');\n const { token } = await auth.getPluginRequestToken({\n onBehalfOf: await auth.getOwnServiceCredentials(),\n targetPluginId: 'scaffolder',\n });\n\n const executeTask = async (\n values: Record<string, any>,\n ): Promise<{ taskId: string; status: string; createdAt: string }> => {\n const response = await fetch(`${scaffolderUrl}/v2/tasks`, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n Authorization: `Bearer ${token}`,\n },\n body: JSON.stringify({\n templateRef: `${templateRef}`,\n values: {\n repoUrl: values.repoUrl,\n owner: values.owner,\n ...values,\n },\n secrets: {},\n }),\n });\n\n if (!response.ok) {\n throw new Error(\n `Failed to start scaffolder task: ${response.status} ${response.statusText}`,\n );\n }\n\n const data = await response.json();\n const taskResp = await fetch(`${scaffolderUrl}/v2/tasks/${data.id}`, {\n headers: {\n Authorization: `Bearer ${token}`,\n },\n });\n\n const task = await taskResp.json();\n return { taskId: data.id, status: task.status, createdAt: task.createdAt };\n };\n\n for (const importReq of importRequests) {\n const url = importReq.repository.url;\n const owner = importReq.repository.organization;\n const repoName = importReq.repository.name;\n if (importReq.github?.pullRequest?.url) {\n const updatedImport = await handlePullRequestUpdate(\n importReq,\n logger,\n config,\n githubApiService,\n );\n result.push(updatedImport);\n } else {\n try {\n // Create new task\n const gitProviderHost = new URL(importReq.repository.url).hostname;\n const normalizedUrl = `${gitProviderHost}?owner=${owner}&repo=${repoName}`;\n\n const scaffolderOptions = {\n name: repoName,\n organization: owner,\n repoUrl: normalizedUrl,\n branchName: `bulk-import-catalog-entity`,\n targetBranchName: importReq.repository.defaultBranch,\n gitProviderHost,\n };\n const { taskId, status, createdAt } =\n await executeTask(scaffolderOptions);\n\n const repositoryId = await repositoryDao.insertRepository(\n url,\n taskId,\n importReq.approvalTool ?? 'GIT',\n );\n await taskDao.insertTask({\n repositoryId,\n scaffolderOptions,\n taskId,\n executedAt: new Date(),\n });\n result.push({\n repository: {\n organization: owner,\n url,\n name: repoName,\n },\n status:\n `TASK_${status.toLocaleUpperCase()}` as Components.Schemas.TaskImportStatus,\n task: { taskId },\n lastUpdate: createdAt,\n approvalTool: importReq.approvalTool,\n });\n\n processTaskEvents(\n taskId,\n scaffolderUrl,\n token,\n logger,\n taskLocationsDao,\n );\n } catch (error: any) {\n logger.error(`Error processing import request for ${url}`, error);\n result.push({\n repository: {\n organization: owner,\n url,\n name: repoName,\n },\n status: 'TASK_FAILED',\n errors: [error.message],\n approvalTool: importReq.approvalTool,\n });\n }\n }\n }\n\n if (result.some(r => r.errors)) {\n return {\n statusCode: 202,\n responseBody: { errors: result.flatMap(r => r.errors || []) },\n };\n }\n\n return {\n statusCode: 202,\n responseBody: result,\n };\n};\n"],"names":["fetchEventSource","gitUrlParse","getCatalogFilename"],"mappings":";;;;;;;;;;AAmDA,gBAAgB,SACd,CAAA,MAAA,EACA,aACA,EAAA,KAA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