@red-hat-developer-hub/backstage-plugin-bulk-import-backend 6.3.0 → 6.4.1
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 +20 -0
- package/README.md +28 -0
- package/config.d.ts +9 -1
- package/dist/catalog/catalogHttpClient.cjs.js +2 -0
- package/dist/catalog/catalogHttpClient.cjs.js.map +1 -1
- package/dist/catalog/catalogInfoGenerator.cjs.js +1 -0
- package/dist/catalog/catalogInfoGenerator.cjs.js.map +1 -1
- package/dist/database/migration.cjs.js +20 -0
- package/dist/database/migration.cjs.js.map +1 -0
- package/dist/database/repositoryDao.cjs.js +117 -0
- package/dist/database/repositoryDao.cjs.js.map +1 -0
- package/dist/generated/openapidocument.cjs.js +321 -72
- package/dist/generated/openapidocument.cjs.js.map +1 -1
- package/dist/github/githubApiService.cjs.js +217 -91
- package/dist/github/githubApiService.cjs.js.map +1 -1
- package/dist/github/utils/orgUtils.cjs.js +1 -0
- package/dist/github/utils/orgUtils.cjs.js.map +1 -1
- package/dist/github/utils/prUtils.cjs.js +2 -0
- package/dist/github/utils/prUtils.cjs.js.map +1 -1
- package/dist/github/utils/repoUtils.cjs.js +1 -38
- package/dist/github/utils/repoUtils.cjs.js.map +1 -1
- package/dist/github/utils/utils.cjs.js +39 -1
- package/dist/github/utils/utils.cjs.js.map +1 -1
- package/dist/gitlab/gitlabApiService.cjs.js +102 -0
- package/dist/gitlab/gitlabApiService.cjs.js.map +1 -1
- package/dist/gitlab/utils/prUtils.cjs.js +1 -0
- package/dist/gitlab/utils/prUtils.cjs.js.map +1 -1
- package/dist/gitlab/utils/utils.cjs.js +1 -0
- package/dist/gitlab/utils/utils.cjs.js.map +1 -1
- package/dist/helpers/utils.cjs.js +21 -0
- package/dist/helpers/utils.cjs.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/plugin.cjs.js +6 -3
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/service/handlers/import/bulkImports.cjs.js +155 -2
- package/dist/service/handlers/import/bulkImports.cjs.js.map +1 -1
- package/dist/service/handlers/import/execute-template.cjs.js +264 -0
- package/dist/service/handlers/import/execute-template.cjs.js.map +1 -0
- package/dist/service/handlers/import/importStatus.cjs.js +1 -1
- package/dist/service/handlers/import/importStatus.cjs.js.map +1 -1
- package/dist/service/handlers/repository/repositories.cjs.js +1 -0
- package/dist/service/handlers/repository/repositories.cjs.js.map +1 -1
- package/dist/service/router.cjs.js +179 -24
- package/dist/service/router.cjs.js.map +1 -1
- package/migrations/20250808122501_migrations.js +53 -0
- package/package.json +8 -3
|
@@ -428,6 +428,223 @@ const OPENAPI = `
|
|
|
428
428
|
}
|
|
429
429
|
}
|
|
430
430
|
},
|
|
431
|
+
"/task-imports": {
|
|
432
|
+
"get": {
|
|
433
|
+
"operationId": "findAllTaskImports",
|
|
434
|
+
"summary": "Fetch Import Jobs",
|
|
435
|
+
"security": [
|
|
436
|
+
{
|
|
437
|
+
"BearerAuth": []
|
|
438
|
+
}
|
|
439
|
+
],
|
|
440
|
+
"tags": [
|
|
441
|
+
"Import"
|
|
442
|
+
],
|
|
443
|
+
"parameters": [
|
|
444
|
+
{
|
|
445
|
+
"$ref": "#/components/parameters/apiVersionHeaderParam"
|
|
446
|
+
},
|
|
447
|
+
{
|
|
448
|
+
"$ref": "#/components/parameters/pagePerIntegrationQueryParamDeprecated"
|
|
449
|
+
},
|
|
450
|
+
{
|
|
451
|
+
"$ref": "#/components/parameters/sizePerIntegrationQueryParamDeprecated"
|
|
452
|
+
},
|
|
453
|
+
{
|
|
454
|
+
"$ref": "#/components/parameters/pageQueryParam"
|
|
455
|
+
},
|
|
456
|
+
{
|
|
457
|
+
"$ref": "#/components/parameters/sizeQueryParam"
|
|
458
|
+
},
|
|
459
|
+
{
|
|
460
|
+
"$ref": "#/components/parameters/sortOrderQueryParam"
|
|
461
|
+
},
|
|
462
|
+
{
|
|
463
|
+
"$ref": "#/components/parameters/sortColumnQueryParam"
|
|
464
|
+
},
|
|
465
|
+
{
|
|
466
|
+
"$ref": "#/components/parameters/searchQueryParam"
|
|
467
|
+
}
|
|
468
|
+
],
|
|
469
|
+
"responses": {
|
|
470
|
+
"200": {
|
|
471
|
+
"description": "Import Job list was fetched successfully with no errors",
|
|
472
|
+
"content": {
|
|
473
|
+
"application/json": {
|
|
474
|
+
"schema": {
|
|
475
|
+
"oneOf": [
|
|
476
|
+
{
|
|
477
|
+
"type": "array",
|
|
478
|
+
"items": {
|
|
479
|
+
"$ref": "#/components/schemas/SourceImport"
|
|
480
|
+
}
|
|
481
|
+
},
|
|
482
|
+
{
|
|
483
|
+
"$ref": "#/components/schemas/ImportJobListV2"
|
|
484
|
+
}
|
|
485
|
+
]
|
|
486
|
+
},
|
|
487
|
+
"examples": {
|
|
488
|
+
"twoImports": {
|
|
489
|
+
"$ref": "#/components/examples/twoImports"
|
|
490
|
+
},
|
|
491
|
+
"multipleImportJobsV2": {
|
|
492
|
+
"$ref": "#/components/examples/multipleImportJobsV2"
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
},
|
|
498
|
+
"500": {
|
|
499
|
+
"description": "Generic error when there are errors and no Import Job is returned",
|
|
500
|
+
"content": {
|
|
501
|
+
"application/json": {
|
|
502
|
+
"schema": {
|
|
503
|
+
"oneOf": [
|
|
504
|
+
{
|
|
505
|
+
"type": "string",
|
|
506
|
+
"description": "Generic error"
|
|
507
|
+
},
|
|
508
|
+
{
|
|
509
|
+
"$ref": "#/components/schemas/ImportJobListV2"
|
|
510
|
+
}
|
|
511
|
+
]
|
|
512
|
+
},
|
|
513
|
+
"examples": {
|
|
514
|
+
"repositoryListErrors": {
|
|
515
|
+
"$ref": "#/components/examples/importJobListErrors"
|
|
516
|
+
}
|
|
517
|
+
}
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
}
|
|
521
|
+
}
|
|
522
|
+
},
|
|
523
|
+
"post": {
|
|
524
|
+
"operationId": "createTaskImportJobs",
|
|
525
|
+
"summary": "Execute a scaffolder template for a list of repositories",
|
|
526
|
+
"security": [
|
|
527
|
+
{
|
|
528
|
+
"BearerAuth": []
|
|
529
|
+
}
|
|
530
|
+
],
|
|
531
|
+
"tags": [
|
|
532
|
+
"Import"
|
|
533
|
+
],
|
|
534
|
+
"requestBody": {
|
|
535
|
+
"description": "The template to execute and the repositories to run it against.",
|
|
536
|
+
"required": true,
|
|
537
|
+
"content": {
|
|
538
|
+
"application/json": {
|
|
539
|
+
"schema": {
|
|
540
|
+
"type": "array",
|
|
541
|
+
"items": {
|
|
542
|
+
"$ref": "#/components/schemas/ImportRequest"
|
|
543
|
+
}
|
|
544
|
+
}
|
|
545
|
+
}
|
|
546
|
+
}
|
|
547
|
+
},
|
|
548
|
+
"responses": {
|
|
549
|
+
"202": {
|
|
550
|
+
"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.",
|
|
551
|
+
"content": {
|
|
552
|
+
"application/json": {
|
|
553
|
+
"schema": {
|
|
554
|
+
"type": "array",
|
|
555
|
+
"items": {
|
|
556
|
+
"$ref": "#/components/schemas/Import"
|
|
557
|
+
}
|
|
558
|
+
}
|
|
559
|
+
}
|
|
560
|
+
}
|
|
561
|
+
}
|
|
562
|
+
}
|
|
563
|
+
}
|
|
564
|
+
},
|
|
565
|
+
"/task-import/by-repo": {
|
|
566
|
+
"get": {
|
|
567
|
+
"operationId": "findTaskImportStatusByRepo",
|
|
568
|
+
"summary": "Get Import Status by repository",
|
|
569
|
+
"security": [
|
|
570
|
+
{
|
|
571
|
+
"BearerAuth": []
|
|
572
|
+
}
|
|
573
|
+
],
|
|
574
|
+
"tags": [
|
|
575
|
+
"Import"
|
|
576
|
+
],
|
|
577
|
+
"parameters": [
|
|
578
|
+
{
|
|
579
|
+
"in": "query",
|
|
580
|
+
"name": "repo",
|
|
581
|
+
"description": "the full URL to the repo",
|
|
582
|
+
"schema": {
|
|
583
|
+
"type": "string"
|
|
584
|
+
}
|
|
585
|
+
},
|
|
586
|
+
{
|
|
587
|
+
"in": "query",
|
|
588
|
+
"name": "defaultBranch",
|
|
589
|
+
"description": "the name of the default branch",
|
|
590
|
+
"schema": {
|
|
591
|
+
"type": "string",
|
|
592
|
+
"default": "main"
|
|
593
|
+
}
|
|
594
|
+
}
|
|
595
|
+
],
|
|
596
|
+
"responses": {
|
|
597
|
+
"200": {
|
|
598
|
+
"description": "Import Job status was determined successfully with no errors",
|
|
599
|
+
"content": {
|
|
600
|
+
"application/json": {
|
|
601
|
+
"schema": {
|
|
602
|
+
"$ref": "#/components/schemas/Import"
|
|
603
|
+
},
|
|
604
|
+
"examples": {
|
|
605
|
+
"singleImportStatusForRepo": {
|
|
606
|
+
"$ref": "#/components/examples/singleImportStatusForRepo"
|
|
607
|
+
}
|
|
608
|
+
}
|
|
609
|
+
}
|
|
610
|
+
}
|
|
611
|
+
},
|
|
612
|
+
"500": {
|
|
613
|
+
"description": "Generic error"
|
|
614
|
+
}
|
|
615
|
+
}
|
|
616
|
+
},
|
|
617
|
+
"delete": {
|
|
618
|
+
"operationId": "deleteTaskImportByRepo",
|
|
619
|
+
"summary": "Delete stored scaffolder task records for a specific repository",
|
|
620
|
+
"security": [
|
|
621
|
+
{
|
|
622
|
+
"BearerAuth": []
|
|
623
|
+
}
|
|
624
|
+
],
|
|
625
|
+
"tags": [
|
|
626
|
+
"Import"
|
|
627
|
+
],
|
|
628
|
+
"parameters": [
|
|
629
|
+
{
|
|
630
|
+
"in": "query",
|
|
631
|
+
"name": "repo",
|
|
632
|
+
"description": "the full URL to the repo",
|
|
633
|
+
"schema": {
|
|
634
|
+
"type": "string"
|
|
635
|
+
}
|
|
636
|
+
}
|
|
637
|
+
],
|
|
638
|
+
"responses": {
|
|
639
|
+
"204": {
|
|
640
|
+
"description": "Repository was deleted successfully with no errors"
|
|
641
|
+
},
|
|
642
|
+
"500": {
|
|
643
|
+
"description": "Generic error"
|
|
644
|
+
}
|
|
645
|
+
}
|
|
646
|
+
}
|
|
647
|
+
},
|
|
431
648
|
"/import/by-repo": {
|
|
432
649
|
"get": {
|
|
433
650
|
"operationId": "findImportStatusByRepo",
|
|
@@ -754,7 +971,14 @@ const OPENAPI = `
|
|
|
754
971
|
"description": "organization which the repository is part of"
|
|
755
972
|
},
|
|
756
973
|
"importStatus": {
|
|
757
|
-
"
|
|
974
|
+
"oneOf": [
|
|
975
|
+
{
|
|
976
|
+
"$ref": "#/components/schemas/ImportStatus"
|
|
977
|
+
},
|
|
978
|
+
{
|
|
979
|
+
"$ref": "#/components/schemas/TaskImportStatus"
|
|
980
|
+
}
|
|
981
|
+
]
|
|
758
982
|
},
|
|
759
983
|
"defaultBranch": {
|
|
760
984
|
"type": "string",
|
|
@@ -780,6 +1004,20 @@ const OPENAPI = `
|
|
|
780
1004
|
"GITLAB"
|
|
781
1005
|
]
|
|
782
1006
|
},
|
|
1007
|
+
"TaskImportStatus": {
|
|
1008
|
+
"type": "string",
|
|
1009
|
+
"nullable": true,
|
|
1010
|
+
"description": "Import Job status",
|
|
1011
|
+
"enum": [
|
|
1012
|
+
"TASK_CANCELLED",
|
|
1013
|
+
"TASK_COMPLETED",
|
|
1014
|
+
"TASK_FAILED",
|
|
1015
|
+
"TASK_OPEN",
|
|
1016
|
+
"TASK_PROCESSING",
|
|
1017
|
+
"TASK_SKIPPED",
|
|
1018
|
+
"TASK_FETCH_FAILED"
|
|
1019
|
+
]
|
|
1020
|
+
},
|
|
783
1021
|
"ImportStatus": {
|
|
784
1022
|
"type": "string",
|
|
785
1023
|
"nullable": true,
|
|
@@ -826,7 +1064,33 @@ const OPENAPI = `
|
|
|
826
1064
|
"type": "string"
|
|
827
1065
|
},
|
|
828
1066
|
"status": {
|
|
829
|
-
"
|
|
1067
|
+
"oneOf": [
|
|
1068
|
+
{
|
|
1069
|
+
"$ref": "#/components/schemas/ImportStatus"
|
|
1070
|
+
},
|
|
1071
|
+
{
|
|
1072
|
+
"$ref": "#/components/schemas/TaskImportStatus"
|
|
1073
|
+
}
|
|
1074
|
+
]
|
|
1075
|
+
},
|
|
1076
|
+
"task": {
|
|
1077
|
+
"type": "object",
|
|
1078
|
+
"properties": {
|
|
1079
|
+
"taskId": {
|
|
1080
|
+
"type": "string"
|
|
1081
|
+
}
|
|
1082
|
+
}
|
|
1083
|
+
},
|
|
1084
|
+
"tasks": {
|
|
1085
|
+
"type": "array",
|
|
1086
|
+
"items": {
|
|
1087
|
+
"type": "object",
|
|
1088
|
+
"properties": {
|
|
1089
|
+
"taskId": {
|
|
1090
|
+
"type": "string"
|
|
1091
|
+
}
|
|
1092
|
+
}
|
|
1093
|
+
}
|
|
830
1094
|
},
|
|
831
1095
|
"catalogEntityName": {
|
|
832
1096
|
"type": "string",
|
|
@@ -853,29 +1117,7 @@ const OPENAPI = `
|
|
|
853
1117
|
"description": "GitLab details. Applicable if approvalTool is gitlab.",
|
|
854
1118
|
"properties": {
|
|
855
1119
|
"pullRequest": {
|
|
856
|
-
"
|
|
857
|
-
"properties": {
|
|
858
|
-
"url": {
|
|
859
|
-
"type": "string",
|
|
860
|
-
"description": "URL of the Pull Request"
|
|
861
|
-
},
|
|
862
|
-
"number": {
|
|
863
|
-
"type": "number",
|
|
864
|
-
"description": "Pull Request number"
|
|
865
|
-
},
|
|
866
|
-
"title": {
|
|
867
|
-
"type": "string",
|
|
868
|
-
"description": "title of the Pull Request"
|
|
869
|
-
},
|
|
870
|
-
"body": {
|
|
871
|
-
"type": "string",
|
|
872
|
-
"description": "body of the Pull Request"
|
|
873
|
-
},
|
|
874
|
-
"catalogInfoContent": {
|
|
875
|
-
"type": "string",
|
|
876
|
-
"description": "content of the catalog-info.yaml as fetched from the Pull Request"
|
|
877
|
-
}
|
|
878
|
-
}
|
|
1120
|
+
"$ref": "#/components/schemas/PullRequest"
|
|
879
1121
|
}
|
|
880
1122
|
}
|
|
881
1123
|
},
|
|
@@ -884,34 +1126,45 @@ const OPENAPI = `
|
|
|
884
1126
|
"description": "GitHub details. Applicable if approvalTool is git.",
|
|
885
1127
|
"properties": {
|
|
886
1128
|
"pullRequest": {
|
|
887
|
-
"
|
|
888
|
-
"properties": {
|
|
889
|
-
"url": {
|
|
890
|
-
"type": "string",
|
|
891
|
-
"description": "URL of the Pull Request"
|
|
892
|
-
},
|
|
893
|
-
"number": {
|
|
894
|
-
"type": "number",
|
|
895
|
-
"description": "Pull Request number"
|
|
896
|
-
},
|
|
897
|
-
"title": {
|
|
898
|
-
"type": "string",
|
|
899
|
-
"description": "title of the Pull Request"
|
|
900
|
-
},
|
|
901
|
-
"body": {
|
|
902
|
-
"type": "string",
|
|
903
|
-
"description": "body of the Pull Request"
|
|
904
|
-
},
|
|
905
|
-
"catalogInfoContent": {
|
|
906
|
-
"type": "string",
|
|
907
|
-
"description": "content of the catalog-info.yaml as fetched from the Pull Request."
|
|
908
|
-
}
|
|
909
|
-
}
|
|
1129
|
+
"$ref": "#/components/schemas/PullRequest"
|
|
910
1130
|
}
|
|
911
1131
|
}
|
|
912
1132
|
}
|
|
913
1133
|
}
|
|
914
1134
|
},
|
|
1135
|
+
"PullRequest": {
|
|
1136
|
+
"type": "object",
|
|
1137
|
+
"properties": {
|
|
1138
|
+
"url": {
|
|
1139
|
+
"type": "string",
|
|
1140
|
+
"description": "URL of the Pull Request"
|
|
1141
|
+
},
|
|
1142
|
+
"number": {
|
|
1143
|
+
"type": "number",
|
|
1144
|
+
"description": "Pull Request number"
|
|
1145
|
+
},
|
|
1146
|
+
"title": {
|
|
1147
|
+
"type": "string",
|
|
1148
|
+
"description": "title of the Pull Request"
|
|
1149
|
+
},
|
|
1150
|
+
"body": {
|
|
1151
|
+
"type": "string",
|
|
1152
|
+
"description": "body of the Pull Request"
|
|
1153
|
+
},
|
|
1154
|
+
"catalogInfoContent": {
|
|
1155
|
+
"type": "string",
|
|
1156
|
+
"description": "content of the catalog-info.yaml as fetched from the Pull Request."
|
|
1157
|
+
},
|
|
1158
|
+
"status": {
|
|
1159
|
+
"type": "string",
|
|
1160
|
+
"enum": [
|
|
1161
|
+
"WAIT_PR_APPROVAL",
|
|
1162
|
+
"PR_MERGED",
|
|
1163
|
+
"PR_ERROR"
|
|
1164
|
+
]
|
|
1165
|
+
}
|
|
1166
|
+
}
|
|
1167
|
+
},
|
|
915
1168
|
"SourceImport": {
|
|
916
1169
|
"title": "Import Job with source it originates from",
|
|
917
1170
|
"allOf": [
|
|
@@ -990,18 +1243,7 @@ const OPENAPI = `
|
|
|
990
1243
|
"description": "GitLab details. Applicable if approvalTool is gitlab.",
|
|
991
1244
|
"properties": {
|
|
992
1245
|
"pullRequest": {
|
|
993
|
-
"
|
|
994
|
-
"description": "Pull Request details. Applicable if approvalTool is gitlab.",
|
|
995
|
-
"properties": {
|
|
996
|
-
"title": {
|
|
997
|
-
"type": "string",
|
|
998
|
-
"description": "title of the Pull Request"
|
|
999
|
-
},
|
|
1000
|
-
"body": {
|
|
1001
|
-
"type": "string",
|
|
1002
|
-
"description": "body of the Pull Request"
|
|
1003
|
-
}
|
|
1004
|
-
}
|
|
1246
|
+
"$ref": "#/components/schemas/PullRequest"
|
|
1005
1247
|
}
|
|
1006
1248
|
}
|
|
1007
1249
|
},
|
|
@@ -1010,22 +1252,29 @@ const OPENAPI = `
|
|
|
1010
1252
|
"description": "GitHub details. Applicable if approvalTool is git.",
|
|
1011
1253
|
"properties": {
|
|
1012
1254
|
"pullRequest": {
|
|
1013
|
-
"
|
|
1014
|
-
"description": "Pull Request details. Applicable if approvalTool is git.",
|
|
1015
|
-
"properties": {
|
|
1016
|
-
"title": {
|
|
1017
|
-
"type": "string",
|
|
1018
|
-
"description": "title of the Pull Request"
|
|
1019
|
-
},
|
|
1020
|
-
"body": {
|
|
1021
|
-
"type": "string",
|
|
1022
|
-
"description": "body of the Pull Request"
|
|
1023
|
-
}
|
|
1024
|
-
}
|
|
1255
|
+
"$ref": "#/components/schemas/PullRequest"
|
|
1025
1256
|
}
|
|
1026
1257
|
}
|
|
1027
1258
|
}
|
|
1028
1259
|
}
|
|
1260
|
+
},
|
|
1261
|
+
"ScaffolderTask": {
|
|
1262
|
+
"title": "Scaffolder Task",
|
|
1263
|
+
"type": "object",
|
|
1264
|
+
"properties": {
|
|
1265
|
+
"taskId": {
|
|
1266
|
+
"type": "string"
|
|
1267
|
+
},
|
|
1268
|
+
"repositoryId": {
|
|
1269
|
+
"type": "number"
|
|
1270
|
+
},
|
|
1271
|
+
"locations": {
|
|
1272
|
+
"type": "array",
|
|
1273
|
+
"items": {
|
|
1274
|
+
"type": "string"
|
|
1275
|
+
}
|
|
1276
|
+
}
|
|
1277
|
+
}
|
|
1029
1278
|
}
|
|
1030
1279
|
},
|
|
1031
1280
|
"securitySchemes": {
|