@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 @@ web 🛡 audit:
108
117
  - cd app
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 @@ web 👮 lint:
152
165
  paths:
153
166
  - app/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 @@ web 🧪 test:
191
208
  paths:
192
209
  - app/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
@@ -264,6 +285,8 @@ web 🧪 test:
264
285
  when: always
265
286
  reports: {}
266
287
  rules:
288
+ - when: never
289
+ if: $CI_PIPELINE_SOURCE == "trigger"
267
290
  - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CI_COMMIT_MESSAGE !~ /^chore\\(release\\).*/
268
291
  needs: []
269
292
  retry: *a1
@@ -308,6 +331,8 @@ web 🧪 test:
308
331
  - docker push $DOCKER_CACHE_IMAGE
309
332
  - collapseable_section_end "docker-push"
310
333
  rules:
334
+ - when: never
335
+ if: $CI_PIPELINE_SOURCE == "trigger"
311
336
  - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CI_COMMIT_MESSAGE !~ /^chore\\(release\\).*/
312
337
  needs:
313
338
  - 'web 🔨 app | dev '
@@ -328,6 +353,8 @@ web 🧪 test:
328
353
  paths:
329
354
  - __sbom.json
330
355
  rules:
356
+ - when: never
357
+ if: $CI_PIPELINE_SOURCE == "trigger"
331
358
  - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CI_COMMIT_MESSAGE !~ /^chore\\(release\\).*/
332
359
  needs: []
333
360
  retry: *a1
@@ -472,6 +499,8 @@ web 🧪 test:
472
499
  reports:
473
500
  dotenv: gitlab_environment.env
474
501
  rules:
502
+ - when: never
503
+ if: $CI_PIPELINE_SOURCE == "trigger"
475
504
  - when: on_success
476
505
  if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CI_COMMIT_MESSAGE !~ /^chore\\(release\\).*/
477
506
  needs:
@@ -535,6 +564,8 @@ web 🧪 test:
535
564
  rules:
536
565
  - if: $CI_COMMIT_BRANCH =~ /^[0-9]+\\.([0-9]+|x)\\.x$/
537
566
  when: on_success
567
+ - when: never
568
+ if: $CI_PIPELINE_SOURCE == "trigger"
538
569
  - when: manual
539
570
  if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CI_COMMIT_MESSAGE !~ /^chore\\(release\\).*/
540
571
  needs: []
@@ -582,6 +613,8 @@ web 🧪 test:
582
613
  name: dev/web
583
614
  action: access
584
615
  rules:
616
+ - when: never
617
+ if: $CI_PIPELINE_SOURCE == "trigger"
585
618
  - when: manual
586
619
  if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CI_COMMIT_MESSAGE !~ /^chore\\(release\\).*/
587
620
  needs: []
@@ -656,6 +689,8 @@ web 🧪 test:
656
689
  when: always
657
690
  reports: {}
658
691
  rules:
692
+ - when: never
693
+ if: $CI_PIPELINE_SOURCE == "trigger"
659
694
  - if: $CI_MERGE_REQUEST_ID
660
695
  needs: []
661
696
  retry: *a1
@@ -700,6 +735,8 @@ web 🧪 test:
700
735
  - docker push $DOCKER_CACHE_IMAGE
701
736
  - collapseable_section_end "docker-push"
702
737
  rules:
738
+ - when: never
739
+ if: $CI_PIPELINE_SOURCE == "trigger"
703
740
  - if: $CI_MERGE_REQUEST_ID
704
741
  needs:
705
742
  - 'web 🔨 app | review '
@@ -720,6 +757,8 @@ web 🧪 test:
720
757
  paths:
721
758
  - __sbom.json
722
759
  rules:
760
+ - when: never
761
+ if: $CI_PIPELINE_SOURCE == "trigger"
723
762
  - if: $CI_MERGE_REQUEST_ID
724
763
  needs: []
725
764
  retry: *a1
@@ -865,6 +904,8 @@ web 🧪 test:
865
904
  reports:
866
905
  dotenv: gitlab_environment.env
867
906
  rules:
907
+ - when: never
908
+ if: $CI_PIPELINE_SOURCE == "trigger"
868
909
  - when: on_success
869
910
  if: $CI_MERGE_REQUEST_ID
870
911
  needs:
@@ -928,6 +969,8 @@ web 🧪 test:
928
969
  rules:
929
970
  - if: $CI_COMMIT_BRANCH =~ /^[0-9]+\\.([0-9]+|x)\\.x$/
930
971
  when: on_success
972
+ - when: never
973
+ if: $CI_PIPELINE_SOURCE == "trigger"
931
974
  - when: manual
932
975
  if: $CI_MERGE_REQUEST_ID
933
976
  needs: []
@@ -975,6 +1018,8 @@ web 🧪 test:
975
1018
  name: review/$CI_COMMIT_REF_NAME/web
976
1019
  action: access
977
1020
  rules:
1021
+ - when: never
1022
+ if: $CI_PIPELINE_SOURCE == "trigger"
978
1023
  - when: manual
979
1024
  if: $CI_MERGE_REQUEST_ID
980
1025
  needs: []
@@ -1049,6 +1094,8 @@ web 🧪 test:
1049
1094
  when: always
1050
1095
  reports: {}
1051
1096
  rules:
1097
+ - when: never
1098
+ if: $CI_PIPELINE_SOURCE == "trigger"
1052
1099
  - if: $CI_COMMIT_TAG
1053
1100
  needs: []
1054
1101
  retry: *a1
@@ -1093,6 +1140,8 @@ web 🧪 test:
1093
1140
  - docker push $DOCKER_CACHE_IMAGE
1094
1141
  - collapseable_section_end "docker-push"
1095
1142
  rules:
1143
+ - when: never
1144
+ if: $CI_PIPELINE_SOURCE == "trigger"
1096
1145
  - if: $CI_COMMIT_TAG
1097
1146
  needs:
1098
1147
  - 'web 🔨 app | stage '
@@ -1113,6 +1162,8 @@ web 🧪 test:
1113
1162
  paths:
1114
1163
  - __sbom.json
1115
1164
  rules:
1165
+ - when: never
1166
+ if: $CI_PIPELINE_SOURCE == "trigger"
1116
1167
  - if: $CI_COMMIT_TAG
1117
1168
  needs: []
1118
1169
  retry: *a1
@@ -1256,6 +1307,8 @@ web 🧪 test:
1256
1307
  reports:
1257
1308
  dotenv: gitlab_environment.env
1258
1309
  rules:
1310
+ - when: never
1311
+ if: $CI_PIPELINE_SOURCE == "trigger"
1259
1312
  - when: on_success
1260
1313
  if: $CI_COMMIT_TAG
1261
1314
  needs:
@@ -1313,6 +1366,8 @@ web 🧪 test:
1313
1366
  rules:
1314
1367
  - if: $CI_COMMIT_BRANCH =~ /^[0-9]+\\.([0-9]+|x)\\.x$/
1315
1368
  when: on_success
1369
+ - when: never
1370
+ if: $CI_PIPELINE_SOURCE == "trigger"
1316
1371
  - when: manual
1317
1372
  if: $CI_COMMIT_TAG
1318
1373
  needs: []
@@ -1360,6 +1415,8 @@ web 🧪 test:
1360
1415
  name: stage/web
1361
1416
  action: access
1362
1417
  rules:
1418
+ - when: never
1419
+ if: $CI_PIPELINE_SOURCE == "trigger"
1363
1420
  - when: manual
1364
1421
  if: $CI_COMMIT_TAG
1365
1422
  needs: []
@@ -1435,6 +1492,8 @@ web 🧪 test:
1435
1492
  when: always
1436
1493
  reports: {}
1437
1494
  rules:
1495
+ - when: never
1496
+ if: $CI_PIPELINE_SOURCE == "trigger"
1438
1497
  - if: $CI_COMMIT_TAG
1439
1498
  needs: []
1440
1499
  retry: *a1
@@ -1479,6 +1538,8 @@ web 🧪 test:
1479
1538
  - docker push $DOCKER_CACHE_IMAGE
1480
1539
  - collapseable_section_end "docker-push"
1481
1540
  rules:
1541
+ - when: never
1542
+ if: $CI_PIPELINE_SOURCE == "trigger"
1482
1543
  - if: $CI_COMMIT_TAG
1483
1544
  needs:
1484
1545
  - 'web 🔨 app | prod '
@@ -1499,6 +1560,8 @@ web 🧪 test:
1499
1560
  paths:
1500
1561
  - __sbom.json
1501
1562
  rules:
1563
+ - when: never
1564
+ if: $CI_PIPELINE_SOURCE == "trigger"
1502
1565
  - if: $CI_COMMIT_TAG
1503
1566
  needs: []
1504
1567
  retry: *a1
@@ -1660,6 +1723,8 @@ web 🧪 test:
1660
1723
  reports:
1661
1724
  dotenv: gitlab_environment.env
1662
1725
  rules:
1726
+ - when: never
1727
+ if: $CI_PIPELINE_SOURCE == "trigger"
1663
1728
  - when: manual
1664
1729
  if: $CI_COMMIT_TAG
1665
1730
  needs:
@@ -1718,6 +1783,8 @@ web 🧪 test:
1718
1783
  rules:
1719
1784
  - if: $CI_COMMIT_BRANCH =~ /^[0-9]+\\.([0-9]+|x)\\.x$/
1720
1785
  when: on_success
1786
+ - when: never
1787
+ if: $CI_PIPELINE_SOURCE == "trigger"
1721
1788
  - when: manual
1722
1789
  if: $CI_COMMIT_TAG
1723
1790
  needs: []
@@ -1766,6 +1833,8 @@ web 🧪 test:
1766
1833
  name: prod/web
1767
1834
  action: access
1768
1835
  rules:
1836
+ - when: never
1837
+ if: $CI_PIPELINE_SOURCE == "trigger"
1769
1838
  - when: manual
1770
1839
  if: $CI_COMMIT_TAG
1771
1840
  needs: []
@@ -1783,6 +1852,9 @@ create release:
1783
1852
  if: $CI_COMMIT_MESSAGE =~ /^chore\\(release\\).*/
1784
1853
  when: never
1785
1854
  - &a3
1855
+ if: $CI_PIPELINE_SOURCE == "trigger"
1856
+ when: never
1857
+ - &a4
1786
1858
  if: $CI_PIPELINE_SOURCE == "schedule"
1787
1859
  when: never
1788
1860
  - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $AUTO_RELEASE == "true"
@@ -1800,6 +1872,7 @@ create release:
1800
1872
  rules:
1801
1873
  - *a2
1802
1874
  - *a3
1875
+ - *a4
1803
1876
  - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
1804
1877
  when: manual
1805
1878
  - if: $CI_COMMIT_BRANCH =~ /^[0-9]+.([0-9]+|x).x$/