@catladder/pipeline 3.13.0 → 3.14.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.
Files changed (107) hide show
  1. package/dist/bash/bashEscape.d.ts +2 -0
  2. package/dist/bash/bashEscape.js +9 -1
  3. package/dist/constants.js +1 -1
  4. package/dist/pipeline/agent/createAgentContext.d.ts +6 -0
  5. package/dist/pipeline/agent/createAgentContext.js +141 -0
  6. package/dist/pipeline/agent/createAgentEventJob.d.ts +2 -0
  7. package/dist/pipeline/agent/createAgentEventJob.js +74 -0
  8. package/dist/pipeline/agent/createAgentReviewJob.d.ts +2 -0
  9. package/dist/pipeline/agent/createAgentReviewJob.js +69 -0
  10. package/dist/pipeline/agent/createJobsForAgentContext.d.ts +2 -0
  11. package/dist/pipeline/agent/createJobsForAgentContext.js +12 -0
  12. package/dist/pipeline/agent/prompts.d.ts +10 -0
  13. package/dist/pipeline/agent/prompts.js +66 -0
  14. package/dist/pipeline/agent/shared.d.ts +8 -0
  15. package/dist/pipeline/agent/shared.js +29 -0
  16. package/dist/pipeline/agent/utils.d.ts +3 -0
  17. package/dist/pipeline/agent/utils.js +16 -0
  18. package/dist/pipeline/createAllJobs.d.ts +5 -1
  19. package/dist/pipeline/createAllJobs.js +32 -6
  20. package/dist/pipeline/createMainPipeline.js +10 -5
  21. package/dist/pipeline/gitlab/createGitlabJobs.d.ts +3 -3
  22. package/dist/pipeline/gitlab/createGitlabJobs.js +13 -11
  23. package/dist/pipeline/gitlab/createGitlabPipeline.js +7 -1
  24. package/dist/rules/index.d.ts +1 -0
  25. package/dist/rules/index.js +8 -3
  26. package/dist/tsconfig.tsbuildinfo +1 -1
  27. package/dist/types/agent.d.ts +7 -0
  28. package/dist/types/agent.js +5 -0
  29. package/dist/types/config.d.ts +2 -0
  30. package/dist/types/context.d.ts +7 -0
  31. package/dist/types/index.d.ts +2 -1
  32. package/dist/types/index.js +2 -1
  33. package/dist/types/jobs.d.ts +5 -1
  34. package/dist/types/jobs.js +1 -1
  35. package/examples/__snapshots__/cloud-run-health-check-defaults.test.ts.snap +66 -1
  36. package/examples/__snapshots__/cloud-run-health-check-only-startup.test.ts.snap +66 -1
  37. package/examples/__snapshots__/cloud-run-health-check.test.ts.snap +66 -1
  38. package/examples/__snapshots__/cloud-run-http2.test.ts.snap +66 -1
  39. package/examples/__snapshots__/cloud-run-llama.test.ts.snap +30 -1
  40. package/examples/__snapshots__/cloud-run-memory-limit.test.ts.snap +66 -1
  41. package/examples/__snapshots__/cloud-run-meteor-with-worker.test.ts.snap +66 -1
  42. package/examples/__snapshots__/cloud-run-nextjs.test.ts.snap +66 -1
  43. package/examples/__snapshots__/cloud-run-no-cpu-throttling.test.ts.snap +66 -1
  44. package/examples/__snapshots__/cloud-run-no-service.test.ts.snap +66 -1
  45. package/examples/__snapshots__/cloud-run-non-public.test.ts.snap +66 -1
  46. package/examples/__snapshots__/cloud-run-post-stop-job.test.ts.snap +66 -1
  47. package/examples/__snapshots__/cloud-run-service-custom-vpc-connector.test.ts.snap +66 -1
  48. package/examples/__snapshots__/cloud-run-service-custom-vpc.test.ts.snap +66 -1
  49. package/examples/__snapshots__/cloud-run-service-gen2.test.ts.snap +66 -1
  50. package/examples/__snapshots__/cloud-run-service-increase-timout.test.ts.snap +66 -1
  51. package/examples/__snapshots__/cloud-run-service-with-volumes.test.ts.snap +66 -1
  52. package/examples/__snapshots__/cloud-run-storybook.test.ts.snap +54 -1
  53. package/examples/__snapshots__/cloud-run-with-agents.test.ts.snap +1576 -0
  54. package/examples/__snapshots__/cloud-run-with-gpu.test.ts.snap +66 -1
  55. package/examples/__snapshots__/cloud-run-with-ngnix.test.ts.snap +66 -1
  56. package/examples/__snapshots__/cloud-run-with-sql-legacy-jobs.test.ts.snap +66 -1
  57. package/examples/__snapshots__/cloud-run-with-sql-multiple-dbs.test.ts.snap +170 -1
  58. package/examples/__snapshots__/cloud-run-with-sql-reuse-db.test.ts.snap +118 -1
  59. package/examples/__snapshots__/cloud-run-with-sql.test.ts.snap +66 -1
  60. package/examples/__snapshots__/cloud-run-with-worker.test.ts.snap +66 -1
  61. package/examples/__snapshots__/custom-build-job-with-tests.test.ts.snap +66 -1
  62. package/examples/__snapshots__/custom-build-job.test.ts.snap +54 -1
  63. package/examples/__snapshots__/custom-deploy.test.ts.snap +60 -1
  64. package/examples/__snapshots__/custom-envs.test.ts.snap +64 -1
  65. package/examples/__snapshots__/custom-sbom-java.test.ts.snap +54 -1
  66. package/examples/__snapshots__/custom-verify-job.test.ts.snap +74 -1
  67. package/examples/__snapshots__/git-submodule.test.ts.snap +66 -1
  68. package/examples/__snapshots__/kubernetes-application-customization.test.ts.snap +74 -1
  69. package/examples/__snapshots__/kubernetes-with-cloud-sql.test.ts.snap +74 -1
  70. package/examples/__snapshots__/kubernetes-with-jobs.test.ts.snap +134 -1
  71. package/examples/__snapshots__/kubernetes-with-mongodb.test.ts.snap +74 -1
  72. package/examples/__snapshots__/local-dot-env.test.ts.snap +66 -1
  73. package/examples/__snapshots__/meteor-kubernetes.test.ts.snap +74 -1
  74. package/examples/__snapshots__/multiline-var.test.ts.snap +178 -1
  75. package/examples/__snapshots__/native-app.test.ts.snap +102 -1
  76. package/examples/__snapshots__/node-build-with-custom-image.test.ts.snap +66 -1
  77. package/examples/__snapshots__/node-build-with-docker-additions.test.ts.snap +66 -1
  78. package/examples/__snapshots__/override-secrets.test.ts.snap +66 -1
  79. package/examples/__snapshots__/rails-k8s-with-worker-dockerfile.test.ts.snap +66 -1
  80. package/examples/__snapshots__/rails-k8s-with-worker.test.ts.snap +66 -1
  81. package/examples/__snapshots__/referencing-other-vars.test.ts.snap +178 -1
  82. package/examples/__snapshots__/wait-for-other-deploy.test.ts.snap +86 -1
  83. package/examples/__snapshots__/workspace-api-www-turbo-cache.test.ts.snap +98 -1
  84. package/examples/__snapshots__/workspace-api-www.test.ts.snap +98 -1
  85. package/examples/cloud-run-with-agents.test.ts +11 -0
  86. package/examples/cloud-run-with-agents.ts +36 -0
  87. package/package.json +1 -1
  88. package/src/bash/bashEscape.ts +6 -0
  89. package/src/pipeline/__tests__/__snapshots__/getPipelineStages.test.ts.snap +9 -0
  90. package/src/pipeline/agent/createAgentContext.ts +19 -0
  91. package/src/pipeline/agent/createAgentEventJob.ts +35 -0
  92. package/src/pipeline/agent/createAgentReviewJob.ts +33 -0
  93. package/src/pipeline/agent/createJobsForAgentContext.ts +7 -0
  94. package/src/pipeline/agent/prompts.ts +233 -0
  95. package/src/pipeline/agent/shared.ts +36 -0
  96. package/src/pipeline/agent/utils.ts +9 -0
  97. package/src/pipeline/createAllJobs.ts +20 -1
  98. package/src/pipeline/createJobsForComponent.ts +1 -0
  99. package/src/pipeline/createMainPipeline.ts +19 -4
  100. package/src/pipeline/gitlab/createGitlabJobs.ts +39 -30
  101. package/src/pipeline/gitlab/createGitlabPipeline.ts +9 -1
  102. package/src/rules/index.ts +7 -0
  103. package/src/types/agent.ts +7 -0
  104. package/src/types/config.ts +3 -0
  105. package/src/types/context.ts +8 -0
  106. package/src/types/index.ts +1 -0
  107. package/src/types/jobs.ts +6 -0
@@ -28,6 +28,11 @@ stages:
28
28
  - verify review
29
29
  - verify stage
30
30
  - verify prod
31
+ - agents
32
+ - agents dev
33
+ - agents review
34
+ - agents stage
35
+ - agents prod
31
36
  - rollback
32
37
  - rollback dev
33
38
  - rollback review
@@ -48,6 +53,10 @@ variables:
48
53
  workflow:
49
54
  name: $PIPELINE_ICON $PIPELINE_NAME
50
55
  rules:
56
+ - if: $CI_PIPELINE_SOURCE == "trigger"
57
+ variables:
58
+ PIPELINE_ICON: 🤖
59
+ PIPELINE_NAME: Thinking...
51
60
  - if: $CI_MERGE_REQUEST_ID
52
61
  variables:
53
62
  PIPELINE_ICON: 🐱🔨
@@ -59,7 +68,7 @@ workflow:
59
68
  - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CI_COMMIT_MESSAGE !~ /^chore\\(release\\).*/
60
69
  variables:
61
70
  PIPELINE_ICON: 🐱🔨
62
- PIPELINE_NAME: Main $CI_COMMIT_REF_NAME
71
+ PIPELINE_NAME: Main
63
72
  - when: always
64
73
  variables:
65
74
  PIPELINE_ICON: 🐱❓
@@ -108,7 +117,11 @@ api 🛡 audit:
108
117
  - cd api
109
118
  - yarn npm audit --environment production
110
119
  rules:
120
+ - when: never
121
+ if: $CI_PIPELINE_SOURCE == "trigger"
111
122
  - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CI_COMMIT_MESSAGE !~ /^chore\\(release\\).*/
123
+ - when: never
124
+ if: $CI_PIPELINE_SOURCE == "trigger"
112
125
  - if: $CI_MERGE_REQUEST_ID
113
126
  needs: []
114
127
  retry: &a1
@@ -152,7 +165,11 @@ api 👮 lint:
152
165
  paths:
153
166
  - api/node_modules
154
167
  rules:
168
+ - when: never
169
+ if: $CI_PIPELINE_SOURCE == "trigger"
155
170
  - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CI_COMMIT_MESSAGE !~ /^chore\\(release\\).*/
171
+ - when: never
172
+ if: $CI_PIPELINE_SOURCE == "trigger"
156
173
  - if: $CI_MERGE_REQUEST_ID
157
174
  needs: []
158
175
  retry: *a1
@@ -191,7 +208,11 @@ api 🧪 test:
191
208
  paths:
192
209
  - api/node_modules
193
210
  rules:
211
+ - when: never
212
+ if: $CI_PIPELINE_SOURCE == "trigger"
194
213
  - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CI_COMMIT_MESSAGE !~ /^chore\\(release\\).*/
214
+ - when: never
215
+ if: $CI_PIPELINE_SOURCE == "trigger"
195
216
  - if: $CI_MERGE_REQUEST_ID
196
217
  needs: []
197
218
  retry: *a1
@@ -254,6 +275,8 @@ api 🧪 test:
254
275
  when: always
255
276
  reports: {}
256
277
  rules:
278
+ - when: never
279
+ if: $CI_PIPELINE_SOURCE == "trigger"
257
280
  - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CI_COMMIT_MESSAGE !~ /^chore\\(release\\).*/
258
281
  needs: []
259
282
  retry: *a1
@@ -311,6 +334,8 @@ api 🧪 test:
311
334
  paths:
312
335
  - api/.yarn
313
336
  rules:
337
+ - when: never
338
+ if: $CI_PIPELINE_SOURCE == "trigger"
314
339
  - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CI_COMMIT_MESSAGE !~ /^chore\\(release\\).*/
315
340
  needs:
316
341
  - 'api 🔨 app | dev '
@@ -331,6 +356,8 @@ api 🧪 test:
331
356
  paths:
332
357
  - __sbom.json
333
358
  rules:
359
+ - when: never
360
+ if: $CI_PIPELINE_SOURCE == "trigger"
334
361
  - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CI_COMMIT_MESSAGE !~ /^chore\\(release\\).*/
335
362
  needs: []
336
363
  retry: *a1
@@ -461,6 +488,8 @@ api 🧪 test:
461
488
  reports:
462
489
  dotenv: gitlab_environment.env
463
490
  rules:
491
+ - when: never
492
+ if: $CI_PIPELINE_SOURCE == "trigger"
464
493
  - when: on_success
465
494
  if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CI_COMMIT_MESSAGE !~ /^chore\\(release\\).*/
466
495
  needs:
@@ -525,6 +554,8 @@ api 🧪 test:
525
554
  rules:
526
555
  - if: $CI_COMMIT_BRANCH =~ /^[0-9]+\\.([0-9]+|x)\\.x$/
527
556
  when: on_success
557
+ - when: never
558
+ if: $CI_PIPELINE_SOURCE == "trigger"
528
559
  - when: manual
529
560
  if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CI_COMMIT_MESSAGE !~ /^chore\\(release\\).*/
530
561
  needs: []
@@ -573,6 +604,8 @@ api 🧪 test:
573
604
  name: dev/api
574
605
  action: access
575
606
  rules:
607
+ - when: never
608
+ if: $CI_PIPELINE_SOURCE == "trigger"
576
609
  - when: manual
577
610
  if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CI_COMMIT_MESSAGE !~ /^chore\\(release\\).*/
578
611
  needs: []
@@ -637,6 +670,8 @@ api 🧪 test:
637
670
  when: always
638
671
  reports: {}
639
672
  rules:
673
+ - when: never
674
+ if: $CI_PIPELINE_SOURCE == "trigger"
640
675
  - if: $CI_MERGE_REQUEST_ID
641
676
  needs: []
642
677
  retry: *a1
@@ -694,6 +729,8 @@ api 🧪 test:
694
729
  paths:
695
730
  - api/.yarn
696
731
  rules:
732
+ - when: never
733
+ if: $CI_PIPELINE_SOURCE == "trigger"
697
734
  - if: $CI_MERGE_REQUEST_ID
698
735
  needs:
699
736
  - 'api 🔨 app | review '
@@ -714,6 +751,8 @@ api 🧪 test:
714
751
  paths:
715
752
  - __sbom.json
716
753
  rules:
754
+ - when: never
755
+ if: $CI_PIPELINE_SOURCE == "trigger"
717
756
  - if: $CI_MERGE_REQUEST_ID
718
757
  needs: []
719
758
  retry: *a1
@@ -845,6 +884,8 @@ api 🧪 test:
845
884
  reports:
846
885
  dotenv: gitlab_environment.env
847
886
  rules:
887
+ - when: never
888
+ if: $CI_PIPELINE_SOURCE == "trigger"
848
889
  - when: on_success
849
890
  if: $CI_MERGE_REQUEST_ID
850
891
  needs:
@@ -909,6 +950,8 @@ api 🧪 test:
909
950
  rules:
910
951
  - if: $CI_COMMIT_BRANCH =~ /^[0-9]+\\.([0-9]+|x)\\.x$/
911
952
  when: on_success
953
+ - when: never
954
+ if: $CI_PIPELINE_SOURCE == "trigger"
912
955
  - when: manual
913
956
  if: $CI_MERGE_REQUEST_ID
914
957
  needs: []
@@ -957,6 +1000,8 @@ api 🧪 test:
957
1000
  name: review/$CI_COMMIT_REF_NAME/api
958
1001
  action: access
959
1002
  rules:
1003
+ - when: never
1004
+ if: $CI_PIPELINE_SOURCE == "trigger"
960
1005
  - when: manual
961
1006
  if: $CI_MERGE_REQUEST_ID
962
1007
  needs: []
@@ -1021,6 +1066,8 @@ api 🧪 test:
1021
1066
  when: always
1022
1067
  reports: {}
1023
1068
  rules:
1069
+ - when: never
1070
+ if: $CI_PIPELINE_SOURCE == "trigger"
1024
1071
  - if: $CI_COMMIT_TAG
1025
1072
  needs: []
1026
1073
  retry: *a1
@@ -1078,6 +1125,8 @@ api 🧪 test:
1078
1125
  paths:
1079
1126
  - api/.yarn
1080
1127
  rules:
1128
+ - when: never
1129
+ if: $CI_PIPELINE_SOURCE == "trigger"
1081
1130
  - if: $CI_COMMIT_TAG
1082
1131
  needs:
1083
1132
  - 'api 🔨 app | stage '
@@ -1098,6 +1147,8 @@ api 🧪 test:
1098
1147
  paths:
1099
1148
  - __sbom.json
1100
1149
  rules:
1150
+ - when: never
1151
+ if: $CI_PIPELINE_SOURCE == "trigger"
1101
1152
  - if: $CI_COMMIT_TAG
1102
1153
  needs: []
1103
1154
  retry: *a1
@@ -1227,6 +1278,8 @@ api 🧪 test:
1227
1278
  reports:
1228
1279
  dotenv: gitlab_environment.env
1229
1280
  rules:
1281
+ - when: never
1282
+ if: $CI_PIPELINE_SOURCE == "trigger"
1230
1283
  - when: on_success
1231
1284
  if: $CI_COMMIT_TAG
1232
1285
  needs:
@@ -1285,6 +1338,8 @@ api 🧪 test:
1285
1338
  rules:
1286
1339
  - if: $CI_COMMIT_BRANCH =~ /^[0-9]+\\.([0-9]+|x)\\.x$/
1287
1340
  when: on_success
1341
+ - when: never
1342
+ if: $CI_PIPELINE_SOURCE == "trigger"
1288
1343
  - when: manual
1289
1344
  if: $CI_COMMIT_TAG
1290
1345
  needs: []
@@ -1333,6 +1388,8 @@ api 🧪 test:
1333
1388
  name: stage/api
1334
1389
  action: access
1335
1390
  rules:
1391
+ - when: never
1392
+ if: $CI_PIPELINE_SOURCE == "trigger"
1336
1393
  - when: manual
1337
1394
  if: $CI_COMMIT_TAG
1338
1395
  needs: []
@@ -1397,6 +1454,8 @@ api 🧪 test:
1397
1454
  when: always
1398
1455
  reports: {}
1399
1456
  rules:
1457
+ - when: never
1458
+ if: $CI_PIPELINE_SOURCE == "trigger"
1400
1459
  - if: $CI_COMMIT_TAG
1401
1460
  needs: []
1402
1461
  retry: *a1
@@ -1454,6 +1513,8 @@ api 🧪 test:
1454
1513
  paths:
1455
1514
  - api/.yarn
1456
1515
  rules:
1516
+ - when: never
1517
+ if: $CI_PIPELINE_SOURCE == "trigger"
1457
1518
  - if: $CI_COMMIT_TAG
1458
1519
  needs:
1459
1520
  - 'api 🔨 app | prod '
@@ -1474,6 +1535,8 @@ api 🧪 test:
1474
1535
  paths:
1475
1536
  - __sbom.json
1476
1537
  rules:
1538
+ - when: never
1539
+ if: $CI_PIPELINE_SOURCE == "trigger"
1477
1540
  - if: $CI_COMMIT_TAG
1478
1541
  needs: []
1479
1542
  retry: *a1
@@ -1603,6 +1666,8 @@ api 🧪 test:
1603
1666
  reports:
1604
1667
  dotenv: gitlab_environment.env
1605
1668
  rules:
1669
+ - when: never
1670
+ if: $CI_PIPELINE_SOURCE == "trigger"
1606
1671
  - when: manual
1607
1672
  if: $CI_COMMIT_TAG
1608
1673
  needs:
@@ -1661,6 +1726,8 @@ api 🧪 test:
1661
1726
  rules:
1662
1727
  - if: $CI_COMMIT_BRANCH =~ /^[0-9]+\\.([0-9]+|x)\\.x$/
1663
1728
  when: on_success
1729
+ - when: never
1730
+ if: $CI_PIPELINE_SOURCE == "trigger"
1664
1731
  - when: manual
1665
1732
  if: $CI_COMMIT_TAG
1666
1733
  needs: []
@@ -1709,6 +1776,8 @@ api 🧪 test:
1709
1776
  name: prod/api
1710
1777
  action: access
1711
1778
  rules:
1779
+ - when: never
1780
+ if: $CI_PIPELINE_SOURCE == "trigger"
1712
1781
  - when: manual
1713
1782
  if: $CI_COMMIT_TAG
1714
1783
  needs: []
@@ -1726,6 +1795,9 @@ create release:
1726
1795
  if: $CI_COMMIT_MESSAGE =~ /^chore\\(release\\).*/
1727
1796
  when: never
1728
1797
  - &a3
1798
+ if: $CI_PIPELINE_SOURCE == "trigger"
1799
+ when: never
1800
+ - &a4
1729
1801
  if: $CI_PIPELINE_SOURCE == "schedule"
1730
1802
  when: never
1731
1803
  - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $AUTO_RELEASE == "true"
@@ -1743,6 +1815,7 @@ create release:
1743
1815
  rules:
1744
1816
  - *a2
1745
1817
  - *a3
1818
+ - *a4
1746
1819
  - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
1747
1820
  when: manual
1748
1821
  - if: $CI_COMMIT_BRANCH =~ /^[0-9]+.([0-9]+|x).x$/