skuba 13.0.0-subpath-imports-20250722044721 → 13.0.0-subpath-imports-20251003044159

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 (268) hide show
  1. package/README.md +1 -2
  2. package/config/tsconfig.json +2 -1
  3. package/jest/moduleNameMapper.js +3 -11
  4. package/lib/cli/build/assets.js +4 -8
  5. package/lib/cli/build/assets.js.map +2 -2
  6. package/lib/cli/build/esbuild.d.ts +2 -1
  7. package/lib/cli/build/esbuild.js +5 -4
  8. package/lib/cli/build/esbuild.js.map +2 -2
  9. package/lib/cli/build/index.js +9 -5
  10. package/lib/cli/build/index.js.map +2 -2
  11. package/lib/cli/build/tsc.d.ts +9 -2
  12. package/lib/cli/build/tsc.js +76 -40
  13. package/lib/cli/build/tsc.js.map +3 -3
  14. package/lib/cli/configure/analyseDependencies.d.ts +2 -2
  15. package/lib/cli/configure/analyseDependencies.js.map +1 -1
  16. package/lib/cli/configure/analysis/package.d.ts +1 -1
  17. package/lib/cli/configure/analysis/package.js +1 -1
  18. package/lib/cli/configure/analysis/package.js.map +2 -2
  19. package/lib/cli/configure/ensureTemplateCompletion.d.ts +2 -2
  20. package/lib/cli/configure/ensureTemplateCompletion.js.map +1 -1
  21. package/lib/cli/configure/getEntryPoint.d.ts +2 -2
  22. package/lib/cli/configure/getEntryPoint.js.map +1 -1
  23. package/lib/cli/configure/getProjectType.d.ts +2 -2
  24. package/lib/cli/configure/getProjectType.js.map +1 -1
  25. package/lib/cli/configure/processing/configFile.d.ts +1 -1
  26. package/lib/cli/configure/processing/configFile.js +48 -6
  27. package/lib/cli/configure/processing/configFile.js.map +2 -2
  28. package/lib/cli/configure/processing/package.js +8 -2
  29. package/lib/cli/configure/processing/package.js.map +2 -2
  30. package/lib/cli/init/getConfig.js +1 -1
  31. package/lib/cli/init/getConfig.js.map +2 -2
  32. package/lib/cli/init/git.js +1 -1
  33. package/lib/cli/init/git.js.map +2 -2
  34. package/lib/cli/init/index.js +4 -4
  35. package/lib/cli/init/index.js.map +3 -3
  36. package/lib/cli/lint/annotate/buildkite/eslint.js +1 -1
  37. package/lib/cli/lint/annotate/buildkite/eslint.js.map +2 -2
  38. package/lib/cli/lint/annotate/buildkite/index.js +1 -1
  39. package/lib/cli/lint/annotate/buildkite/index.js.map +2 -2
  40. package/lib/cli/lint/annotate/buildkite/internal.js +1 -1
  41. package/lib/cli/lint/annotate/buildkite/internal.js.map +2 -2
  42. package/lib/cli/lint/annotate/buildkite/prettier.js +1 -1
  43. package/lib/cli/lint/annotate/buildkite/prettier.js.map +2 -2
  44. package/lib/cli/lint/annotate/buildkite/tsc.js +1 -1
  45. package/lib/cli/lint/annotate/buildkite/tsc.js.map +2 -2
  46. package/lib/cli/lint/annotate/github/eslint.d.ts +1 -1
  47. package/lib/cli/lint/annotate/github/eslint.js.map +2 -2
  48. package/lib/cli/lint/annotate/github/index.js +3 -4
  49. package/lib/cli/lint/annotate/github/index.js.map +2 -2
  50. package/lib/cli/lint/annotate/github/internal.d.ts +1 -1
  51. package/lib/cli/lint/annotate/github/internal.js.map +2 -2
  52. package/lib/cli/lint/annotate/github/prettier.d.ts +1 -1
  53. package/lib/cli/lint/annotate/github/prettier.js.map +2 -2
  54. package/lib/cli/lint/annotate/github/tsc.d.ts +1 -1
  55. package/lib/cli/lint/annotate/github/tsc.js.map +2 -2
  56. package/lib/cli/lint/autofix.d.ts +1 -1
  57. package/lib/cli/lint/autofix.js +3 -3
  58. package/lib/cli/lint/autofix.js.map +2 -2
  59. package/lib/cli/lint/internal.js +1 -1
  60. package/lib/cli/lint/internal.js.map +2 -2
  61. package/lib/cli/lint/internalLints/patchRenovateConfig.js +3 -3
  62. package/lib/cli/lint/internalLints/patchRenovateConfig.js.map +2 -2
  63. package/lib/cli/lint/internalLints/refreshConfigFiles.js +5 -3
  64. package/lib/cli/lint/internalLints/refreshConfigFiles.js.map +2 -2
  65. package/lib/cli/lint/internalLints/upgrade/index.d.ts +2 -2
  66. package/lib/cli/lint/internalLints/upgrade/index.js.map +1 -1
  67. package/lib/{api/buildkite/md.js → cli/lint/internalLints/upgrade/patches/12.0.2/index.js} +13 -11
  68. package/lib/cli/lint/internalLints/upgrade/patches/12.0.2/index.js.map +7 -0
  69. package/lib/cli/lint/internalLints/upgrade/patches/12.0.2/unhandledRejections.d.ts +4 -0
  70. package/lib/cli/lint/internalLints/upgrade/patches/12.0.2/unhandledRejections.js +162 -0
  71. package/lib/cli/lint/internalLints/upgrade/patches/12.0.2/unhandledRejections.js.map +7 -0
  72. package/lib/cli/lint/internalLints/upgrade/patches/12.1.1/index.d.ts +2 -0
  73. package/lib/{api/net → cli/lint/internalLints/upgrade/patches/12.1.1}/index.js +12 -6
  74. package/lib/cli/lint/internalLints/upgrade/patches/12.1.1/index.js.map +7 -0
  75. package/lib/cli/lint/internalLints/upgrade/patches/12.1.1/patchJestSnapshots.d.ts +3 -0
  76. package/lib/cli/lint/internalLints/upgrade/patches/12.1.1/patchJestSnapshots.js +105 -0
  77. package/lib/cli/lint/internalLints/upgrade/patches/12.1.1/patchJestSnapshots.js.map +7 -0
  78. package/lib/cli/lint/internalLints/upgrade/patches/12.3.0/index.d.ts +2 -0
  79. package/lib/cli/lint/internalLints/upgrade/patches/12.3.0/index.js +40 -0
  80. package/lib/cli/lint/internalLints/upgrade/patches/12.3.0/index.js.map +7 -0
  81. package/lib/cli/lint/internalLints/upgrade/patches/12.3.0/patchApiTokenFromEnvironment.d.ts +3 -0
  82. package/lib/cli/lint/internalLints/upgrade/patches/12.3.0/patchApiTokenFromEnvironment.js +100 -0
  83. package/lib/cli/lint/internalLints/upgrade/patches/12.3.0/patchApiTokenFromEnvironment.js.map +7 -0
  84. package/lib/cli/lint/internalLints/upgrade/patches/12.3.0/patchDockerfileSyntaxDirective.d.ts +3 -0
  85. package/lib/cli/lint/internalLints/upgrade/patches/12.3.0/patchDockerfileSyntaxDirective.js +99 -0
  86. package/lib/cli/lint/internalLints/upgrade/patches/12.3.0/patchDockerfileSyntaxDirective.js.map +7 -0
  87. package/lib/cli/lint/internalLints/upgrade/patches/12.4.0/index.d.ts +2 -0
  88. package/lib/{api/buildkite → cli/lint/internalLints/upgrade/patches/12.4.0}/index.js +12 -9
  89. package/lib/cli/lint/internalLints/upgrade/patches/12.4.0/index.js.map +7 -0
  90. package/lib/cli/lint/internalLints/upgrade/patches/12.4.0/patchDockerfileCIVariable.d.ts +3 -0
  91. package/lib/cli/lint/internalLints/upgrade/patches/12.4.0/patchDockerfileCIVariable.js +101 -0
  92. package/lib/cli/lint/internalLints/upgrade/patches/12.4.0/patchDockerfileCIVariable.js.map +7 -0
  93. package/lib/cli/lint/internalLints/upgrade/patches/13.0.0/index.d.ts +2 -0
  94. package/lib/cli/lint/internalLints/upgrade/patches/{12.2.0 → 13.0.0}/index.js.map +1 -1
  95. package/lib/cli/lint/internalLints/upgrade/patches/13.0.0/rewriteSrcImports.d.ts +13 -0
  96. package/lib/cli/lint/internalLints/upgrade/patches/13.0.0/rewriteSrcImports.js +221 -0
  97. package/lib/cli/lint/internalLints/upgrade/patches/13.0.0/rewriteSrcImports.js.map +7 -0
  98. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/upgradeESLint.js +1 -1
  99. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/upgradeESLint.js.map +2 -2
  100. package/lib/cli/node/index.js +8 -2
  101. package/lib/cli/node/index.js.map +2 -2
  102. package/lib/cli/start/index.js +8 -2
  103. package/lib/cli/start/index.js.map +2 -2
  104. package/lib/cli/test/index.d.ts +1 -1
  105. package/lib/cli/test/index.js +18 -4
  106. package/lib/cli/test/index.js.map +2 -2
  107. package/lib/cli/test/reporters/github/annotations.d.ts +1 -1
  108. package/lib/cli/test/reporters/github/annotations.js.map +1 -1
  109. package/lib/cli/test/reporters/github/index.js +3 -4
  110. package/lib/cli/test/reporters/github/index.js.map +2 -2
  111. package/lib/index.d.ts +4 -4
  112. package/lib/index.js +4 -4
  113. package/lib/index.js.map +2 -2
  114. package/lib/utils/args.d.ts +2 -0
  115. package/lib/utils/args.js +5 -0
  116. package/lib/utils/args.js.map +2 -2
  117. package/lib/utils/dir.js +2 -2
  118. package/lib/utils/dir.js.map +3 -3
  119. package/lib/utils/manifest.d.ts +6 -2
  120. package/lib/utils/manifest.js +17 -8
  121. package/lib/utils/manifest.js.map +2 -2
  122. package/lib/utils/template.d.ts +1 -1
  123. package/package.json +21 -24
  124. package/template/base/_.prettierrc.js +1 -1
  125. package/template/base/_eslint.config.js +1 -1
  126. package/template/base/_pnpm-workspace.yaml +14 -3
  127. package/template/base/jest.config.ts +7 -12
  128. package/template/base/jest.setup.ts +1 -1
  129. package/template/express-rest-api/.buildkite/pipeline.yml +6 -0
  130. package/template/express-rest-api/.env +1 -1
  131. package/template/express-rest-api/.gantry/dev.yml +5 -1
  132. package/template/express-rest-api/.gantry/prod.yml +5 -1
  133. package/template/express-rest-api/Dockerfile +2 -2
  134. package/template/express-rest-api/Dockerfile.dev-deps +0 -2
  135. package/template/express-rest-api/README.md +5 -5
  136. package/template/express-rest-api/gantry.apply.yml +17 -1
  137. package/template/express-rest-api/package.json +11 -5
  138. package/template/express-rest-api/src/api/healthCheck.ts +2 -2
  139. package/template/express-rest-api/src/config.ts +7 -7
  140. package/template/express-rest-api/src/framework/logging.ts +11 -7
  141. package/template/express-rest-api/src/framework/metrics.ts +1 -1
  142. package/template/express-rest-api/src/listen.ts +6 -0
  143. package/template/express-rest-api/src/tracing.ts +56 -0
  144. package/template/greeter/Dockerfile +0 -2
  145. package/template/greeter/README.md +2 -2
  146. package/template/greeter/package.json +2 -2
  147. package/template/koa-rest-api/.buildkite/pipeline.yml +6 -0
  148. package/template/koa-rest-api/.env +1 -1
  149. package/template/koa-rest-api/.gantry/dev.yml +3 -3
  150. package/template/koa-rest-api/.gantry/prod.yml +3 -3
  151. package/template/koa-rest-api/Dockerfile +1 -1
  152. package/template/koa-rest-api/Dockerfile.dev-deps +0 -2
  153. package/template/koa-rest-api/README.md +6 -6
  154. package/template/koa-rest-api/gantry.apply.yml +15 -3
  155. package/template/koa-rest-api/package.json +13 -14
  156. package/template/koa-rest-api/src/api/healthCheck.ts +2 -2
  157. package/template/koa-rest-api/src/config.ts +7 -7
  158. package/template/koa-rest-api/src/framework/logging.ts +12 -8
  159. package/template/koa-rest-api/src/framework/metrics.ts +1 -1
  160. package/template/koa-rest-api/src/framework/server.test.ts +7 -8
  161. package/template/koa-rest-api/src/framework/server.ts +1 -4
  162. package/template/koa-rest-api/src/listen.ts +6 -0
  163. package/template/lambda-sqs-worker-cdk/.buildkite/pipeline.yml +6 -2
  164. package/template/lambda-sqs-worker-cdk/.env +1 -1
  165. package/template/lambda-sqs-worker-cdk/Dockerfile +0 -2
  166. package/template/lambda-sqs-worker-cdk/README.md +8 -8
  167. package/template/lambda-sqs-worker-cdk/infra/__snapshots__/appStack.test.ts.snap +54 -26
  168. package/template/lambda-sqs-worker-cdk/infra/appStack.test.ts +5 -22
  169. package/template/lambda-sqs-worker-cdk/infra/appStack.ts +16 -9
  170. package/template/lambda-sqs-worker-cdk/infra/config.ts +34 -20
  171. package/template/lambda-sqs-worker-cdk/infra/index.ts +1 -1
  172. package/template/lambda-sqs-worker-cdk/package.json +7 -9
  173. package/template/lambda-sqs-worker-cdk/src/app.test.ts +91 -51
  174. package/template/lambda-sqs-worker-cdk/src/app.ts +10 -9
  175. package/template/lambda-sqs-worker-cdk/src/config.ts +11 -16
  176. package/template/lambda-sqs-worker-cdk/src/framework/handler.test.ts +10 -5
  177. package/template/lambda-sqs-worker-cdk/src/framework/handler.ts +48 -24
  178. package/template/lambda-sqs-worker-cdk/src/framework/logging.ts +23 -11
  179. package/template/lambda-sqs-worker-cdk/src/framework/metrics.ts +1 -4
  180. package/template/lambda-sqs-worker-cdk/src/testing/handler.ts +4 -1
  181. package/template/oss-npm-package/.github/workflows/release.yml +7 -8
  182. package/template/oss-npm-package/.github/workflows/validate.yml +6 -6
  183. package/template/oss-npm-package/README.md +1 -1
  184. package/template/oss-npm-package/_package.json +0 -3
  185. package/template/oss-npm-package/skuba.template.js +1 -1
  186. package/lib/api/buildkite/annotate.d.ts +0 -28
  187. package/lib/api/buildkite/annotate.js +0 -62
  188. package/lib/api/buildkite/annotate.js.map +0 -7
  189. package/lib/api/buildkite/index.d.ts +0 -3
  190. package/lib/api/buildkite/index.js.map +0 -7
  191. package/lib/api/buildkite/md.d.ts +0 -6
  192. package/lib/api/buildkite/md.js.map +0 -7
  193. package/lib/api/git/commit.d.ts +0 -15
  194. package/lib/api/git/commit.js +0 -52
  195. package/lib/api/git/commit.js.map +0 -7
  196. package/lib/api/git/commitAllChanges.d.ts +0 -19
  197. package/lib/api/git/commitAllChanges.js +0 -83
  198. package/lib/api/git/commitAllChanges.js.map +0 -7
  199. package/lib/api/git/currentBranch.d.ts +0 -10
  200. package/lib/api/git/currentBranch.js +0 -59
  201. package/lib/api/git/currentBranch.js.map +0 -7
  202. package/lib/api/git/findRoot.d.ts +0 -9
  203. package/lib/api/git/findRoot.js +0 -52
  204. package/lib/api/git/findRoot.js.map +0 -7
  205. package/lib/api/git/getChangedFiles.d.ts +0 -20
  206. package/lib/api/git/getChangedFiles.js +0 -81
  207. package/lib/api/git/getChangedFiles.js.map +0 -7
  208. package/lib/api/git/index.d.ts +0 -12
  209. package/lib/api/git/index.js +0 -61
  210. package/lib/api/git/index.js.map +0 -7
  211. package/lib/api/git/isFileGitIgnored.d.ts +0 -4
  212. package/lib/api/git/isFileGitIgnored.js +0 -49
  213. package/lib/api/git/isFileGitIgnored.js.map +0 -7
  214. package/lib/api/git/log.d.ts +0 -19
  215. package/lib/api/git/log.js +0 -71
  216. package/lib/api/git/log.js.map +0 -7
  217. package/lib/api/git/pull.d.ts +0 -35
  218. package/lib/api/git/pull.js +0 -69
  219. package/lib/api/git/pull.js.map +0 -7
  220. package/lib/api/git/push.d.ts +0 -52
  221. package/lib/api/git/push.js +0 -70
  222. package/lib/api/git/push.js.map +0 -7
  223. package/lib/api/git/remote.d.ts +0 -20
  224. package/lib/api/git/remote.js +0 -73
  225. package/lib/api/git/remote.js.map +0 -7
  226. package/lib/api/git/reset.d.ts +0 -12
  227. package/lib/api/git/reset.js +0 -62
  228. package/lib/api/git/reset.js.map +0 -7
  229. package/lib/api/git/statusMatrix.d.ts +0 -7
  230. package/lib/api/git/statusMatrix.js +0 -47
  231. package/lib/api/git/statusMatrix.js.map +0 -7
  232. package/lib/api/github/checkRun.d.ts +0 -44
  233. package/lib/api/github/checkRun.js +0 -81
  234. package/lib/api/github/checkRun.js.map +0 -7
  235. package/lib/api/github/environment.d.ts +0 -17
  236. package/lib/api/github/environment.js +0 -48
  237. package/lib/api/github/environment.js.map +0 -7
  238. package/lib/api/github/index.d.ts +0 -7
  239. package/lib/api/github/index.js +0 -48
  240. package/lib/api/github/index.js.map +0 -7
  241. package/lib/api/github/issueComment.d.ts +0 -61
  242. package/lib/api/github/issueComment.js +0 -99
  243. package/lib/api/github/issueComment.js.map +0 -7
  244. package/lib/api/github/octokit.d.ts +0 -6
  245. package/lib/api/github/octokit.js +0 -42
  246. package/lib/api/github/octokit.js.map +0 -7
  247. package/lib/api/github/pullRequest.d.ts +0 -21
  248. package/lib/api/github/pullRequest.js +0 -69
  249. package/lib/api/github/pullRequest.js.map +0 -7
  250. package/lib/api/github/push.d.ts +0 -85
  251. package/lib/api/github/push.js +0 -166
  252. package/lib/api/github/push.js.map +0 -7
  253. package/lib/api/net/compose.d.ts +0 -4
  254. package/lib/api/net/compose.js +0 -51
  255. package/lib/api/net/compose.js.map +0 -7
  256. package/lib/api/net/index.d.ts +0 -1
  257. package/lib/api/net/index.js.map +0 -7
  258. package/lib/api/net/socket.d.ts +0 -5
  259. package/lib/api/net/socket.js +0 -68
  260. package/lib/api/net/socket.js.map +0 -7
  261. package/lib/api/net/waitFor.d.ts +0 -22
  262. package/lib/api/net/waitFor.js +0 -40
  263. package/lib/api/net/waitFor.js.map +0 -7
  264. package/lib/cli/lint/internalLints/upgrade/patches/12.2.0/rewriteSrcImports.d.ts +0 -6
  265. package/lib/cli/lint/internalLints/upgrade/patches/12.2.0/rewriteSrcImports.js +0 -104
  266. package/lib/cli/lint/internalLints/upgrade/patches/12.2.0/rewriteSrcImports.js.map +0 -7
  267. /package/lib/cli/lint/internalLints/upgrade/patches/{12.2.0 → 12.0.2}/index.d.ts +0 -0
  268. /package/lib/cli/lint/internalLints/upgrade/patches/{12.2.0 → 13.0.0}/index.js +0 -0
@@ -8,7 +8,7 @@ COPY . .
8
8
 
9
9
  RUN pnpm install --offline
10
10
  RUN pnpm build
11
- RUN pnpm install --offline --prod
11
+ RUN CI=true pnpm install --offline --prod
12
12
 
13
13
  ###
14
14
 
@@ -28,4 +28,4 @@ ARG PORT=8001
28
28
  ENV PORT=${PORT}
29
29
  EXPOSE ${PORT}
30
30
 
31
- CMD ["lib/listen.js"]
31
+ CMD ["--require", "./lib/tracing.js", "./lib/listen.js"]
@@ -1,5 +1,3 @@
1
- # syntax=docker/dockerfile:1.17
2
-
3
1
  FROM public.ecr.aws/docker/library/node:22-alpine AS dev-deps
4
2
 
5
3
  RUN --mount=type=bind,source=package.json,target=package.json \
@@ -70,19 +70,19 @@ pnpm start:debug
70
70
 
71
71
  This project is deployed through a [Buildkite pipeline](.buildkite/pipeline.yml).
72
72
 
73
- - Commits to a feature branch can be deployed to the dev environment by unblocking a step in the Buildkite UI
74
- - Commits to the default branch are automatically deployed to the dev and prod environments in sequence
73
+ - Commits to a feature branch can be deployed to the development environment by unblocking a step in the Buildkite UI
74
+ - Commits to the default branch are automatically deployed to the development and production environments in sequence
75
75
 
76
76
  To rapidly roll back a change,
77
77
  retry an individual deployment step from the previous build in Buildkite.
78
- Note that this will introduce drift between the head of the default Git branch and the live environment;
78
+ Note that this will introduce drift between the head of the default Git branch and the live deployments;
79
79
  use with caution and always follow up with a proper revert or fix in Git history.
80
80
 
81
81
  ## Support
82
82
 
83
83
  ### Dev
84
84
 
85
- TODO: add support links for the dev environment.
85
+ TODO: add support links for the dev deployment.
86
86
 
87
87
  <!--
88
88
  - CloudWatch dashboard
@@ -92,7 +92,7 @@ TODO: add support links for the dev environment.
92
92
 
93
93
  ### Prod
94
94
 
95
- TODO: add support links for the prod environment.
95
+ TODO: add support links for the prod deployment.
96
96
 
97
97
  <!--
98
98
  - CloudWatch dashboard
@@ -9,9 +9,14 @@ owner: '{{values "owner"}}'
9
9
  image: '{{values "image"}}'
10
10
 
11
11
  env:
12
- ENVIRONMENT: '{{values "environment"}}'
12
+ DEPLOYMENT: '{{values "deployment"}}'
13
13
  SERVICE: '{{values "service"}}'
14
14
 
15
+ DD_ENV: '{{values "env"}}'
16
+ DD_SERVICE: '{{values "service"}}'
17
+
18
+ OPENTELEMETRY_ENABLED: '{{values "openTelemetry.enabled"}}'
19
+
15
20
  {{if .Values.cloudwatchDashboardDisabled}}
16
21
  cloudwatchDashboardDisabled: {{values "cloudwatchDashboardDisabled"}}
17
22
  {{end}}
@@ -20,6 +25,17 @@ cloudwatchDashboardDisabled: {{values "cloudwatchDashboardDisabled"}}
20
25
  datadogSecretId: '{{values "datadogSecretId"}}'
21
26
  {{end}}
22
27
 
28
+ # Uncomment if the `tin` tier is acceptable for your SEEK Auth Sidecar logs
29
+ # The eeeoh log forwarder bypasses Amazon CloudWatch for cost savings
30
+ # logSink:
31
+ # forwarder: eeeoh
32
+ # splunkIndex: '{{values "logSink.splunkIndex"}}'
33
+
34
+ openTelemetry:
35
+ datadogEnvironmentName: '{{values "env"}}'
36
+ enabled: {{values "openTelemetry.enabled"}}
37
+ useGantryServiceName: true
38
+
23
39
  {{if .Values.pagerDutyEndpoint}}
24
40
  pagerDutyEndpoint: '{{values "pagerDutyEndpoint"}}'
25
41
  {{end}}
@@ -19,22 +19,28 @@
19
19
  "test:watch": "skuba test --watch"
20
20
  },
21
21
  "dependencies": {
22
- "@seek/logger": "^10.0.0",
22
+ "@opentelemetry/api": "^1.9.0",
23
+ "@opentelemetry/core": "^2.0.0",
24
+ "@opentelemetry/exporter-trace-otlp-grpc": "^0.205.0",
25
+ "@opentelemetry/instrumentation-aws-sdk": "^0.60.0",
26
+ "@opentelemetry/instrumentation-http": "^0.205.0",
27
+ "@opentelemetry/propagator-b3": "^2.0.0",
28
+ "@opentelemetry/sdk-node": "^0.205.0",
29
+ "@seek/logger": "^11.1.0",
23
30
  "express": "^5.0.0",
24
- "hot-shots": "^10.0.0",
25
- "seek-datadog-custom-metrics": "^4.6.3",
31
+ "hot-shots": "^11.0.0",
32
+ "seek-datadog-custom-metrics": "^6.0.0",
26
33
  "skuba-dive": "^2.0.0"
27
34
  },
28
35
  "devDependencies": {
29
36
  "@types/express": "^5.0.0",
30
37
  "@types/node": "^22.13.10",
31
38
  "@types/supertest": "^6.0.0",
32
- "mime": "^4.0.1",
33
39
  "pino-pretty": "^13.0.0",
34
40
  "skuba": "*",
35
41
  "supertest": "^7.0.0"
36
42
  },
37
- "packageManager": "pnpm@10.12.4",
43
+ "packageManager": "pnpm@10.17.1",
38
44
  "engines": {
39
45
  "node": ">=22"
40
46
  }
@@ -3,8 +3,8 @@ import type { Handler } from 'express';
3
3
  /**
4
4
  * Signifies that the API is available to serve requests.
5
5
  *
6
- * The deployment environment calls this endpoint to see if the container is
7
- * unhealthy and needs to be recycled.
6
+ * The workload hosting environment calls this endpoint to see if the container
7
+ * is unhealthy and needs to be recycled.
8
8
  */
9
9
  export const healthCheckHandler: Handler = (_req, res) => {
10
10
  res.send('');
@@ -1,7 +1,7 @@
1
1
  import { Env } from 'skuba-dive';
2
2
 
3
3
  interface Config {
4
- environment: Environment;
4
+ deployment: Deployment;
5
5
 
6
6
  logLevel: string;
7
7
  name: string;
@@ -11,17 +11,17 @@ interface Config {
11
11
  port: number | null;
12
12
  }
13
13
 
14
- type Environment = (typeof environments)[number];
14
+ type Deployment = (typeof deployments)[number];
15
15
 
16
16
  const dev = '<%- devGantryEnvironmentName %>';
17
17
  const prod = '<%- prodGantryEnvironmentName %>';
18
18
 
19
- const environments = ['local', 'test', dev, prod] as const;
19
+ const deployments = ['local', 'test', dev, prod] as const;
20
20
 
21
- const environment = Env.oneOf(environments)('ENVIRONMENT');
21
+ const deployment = Env.oneOf(deployments)('DEPLOYMENT');
22
22
 
23
23
  /* istanbul ignore next: config verification makes more sense in a smoke test */
24
- const configs: Record<Environment, () => Omit<Config, 'environment'>> = {
24
+ const configs: Record<Deployment, () => Omit<Config, 'deployment'>> = {
25
25
  local: () => ({
26
26
  logLevel: 'debug',
27
27
  name: '<%- serviceName %>',
@@ -60,6 +60,6 @@ const configs: Record<Environment, () => Omit<Config, 'environment'>> = {
60
60
  };
61
61
 
62
62
  export const config: Config = {
63
- ...configs[environment](),
64
- environment,
63
+ ...configs[deployment](),
64
+ deployment,
65
65
  };
@@ -1,17 +1,21 @@
1
- import createLogger from '@seek/logger';
1
+ import { createLogger } from '@seek/logger';
2
2
 
3
3
  import { config } from '#src/config.js';
4
4
 
5
5
  export const logger = createLogger({
6
- base: {
7
- environment: config.environment,
8
- version: config.version,
6
+ eeeoh: {
7
+ /**
8
+ * TODO: choose an appropriate Datadog log tier.
9
+ *
10
+ * https://github.com/seek-oss/logger/blob/master/docs/eeeoh.md#datadog-log-tiers
11
+ */
12
+ datadog: 'tin',
13
+ team: '<%- teamName %>',
14
+ use: 'environment',
9
15
  },
10
16
 
11
17
  level: config.logLevel,
12
18
 
13
- name: config.name,
14
-
15
19
  transport:
16
- config.environment === 'local' ? { target: 'pino-pretty' } : undefined,
20
+ config.deployment === 'local' ? { target: 'pino-pretty' } : undefined,
17
21
  });
@@ -7,5 +7,5 @@ import { config } from '#src/config.js';
7
7
 
8
8
  /* istanbul ignore next: StatsD client is not our responsibility */
9
9
  export const metricsClient = createStatsDClient(StatsD, config, (err) =>
10
- logger.error({ err }, 'StatsD error'),
10
+ logger.error(err, 'StatsD error'),
11
11
  );
@@ -19,3 +19,9 @@ const listener = app.listen(config.port, () => {
19
19
  // https://docs.aws.amazon.com/elasticloadbalancing/latest/application/application-load-balancers.html#connection-idle-timeout
20
20
  // AWS recommends setting an application timeout larger than the load balancer
21
21
  listener.keepAliveTimeout = 31000;
22
+
23
+ // Report unhandled rejections instead of crashing the process
24
+ // Make sure to monitor these reports and alert as appropriate
25
+ process.on('unhandledRejection', (err) =>
26
+ logger.error(err, 'Unhandled promise rejection'),
27
+ );
@@ -0,0 +1,56 @@
1
+ /**
2
+ * OpenTelemetry tracing initialisation. This is a standalone TS/JS module that is not
3
+ * referenced by application source code directly. It is required at runtime using the
4
+ * node command's `--require` argument, see Dockerfile for details.
5
+ */
6
+
7
+ import { propagation } from '@opentelemetry/api';
8
+ import { CompositePropagator } from '@opentelemetry/core';
9
+ import { OTLPTraceExporter } from '@opentelemetry/exporter-trace-otlp-grpc';
10
+ import { AwsInstrumentation } from '@opentelemetry/instrumentation-aws-sdk';
11
+ import { HttpInstrumentation } from '@opentelemetry/instrumentation-http';
12
+ import { B3InjectEncoding, B3Propagator } from '@opentelemetry/propagator-b3';
13
+ import { NodeSDK } from '@opentelemetry/sdk-node';
14
+
15
+ const app = 'opentelemetry';
16
+ const log = (level: string, msg: string, extra = {}) => {
17
+ const toLog = { msg, level, app, time: new Date().toISOString(), ...extra };
18
+ console.log(JSON.stringify(toLog)); // eslint-disable-line no-console
19
+ };
20
+
21
+ const main = () => {
22
+ // Use B3 propagation to ensure proper propagation between systems that use
23
+ // OpenTelemetry and native Datadog APM, such as Istio/Envoy.
24
+ propagation.setGlobalPropagator(
25
+ new CompositePropagator({
26
+ propagators: [
27
+ new B3Propagator(),
28
+ new B3Propagator({ injectEncoding: B3InjectEncoding.MULTI_HEADER }),
29
+ ],
30
+ }),
31
+ );
32
+
33
+ const sdk = new NodeSDK({
34
+ traceExporter: new OTLPTraceExporter(),
35
+ autoDetectResources: false,
36
+ instrumentations: [new HttpInstrumentation(), new AwsInstrumentation()],
37
+ });
38
+
39
+ sdk.start();
40
+
41
+ process.on('SIGTERM', () => {
42
+ sdk
43
+ .shutdown()
44
+ .then(() => log('info', 'OpenTelemetry successfully terminated'))
45
+ .catch((err: Error) =>
46
+ log('error', 'OpenTelemetry failed to terminate', { err }),
47
+ )
48
+ .finally(() => process.exit(0)); // eslint-disable-line no-process-exit
49
+ });
50
+ };
51
+
52
+ if (process.env.OPENTELEMETRY_ENABLED === 'true') {
53
+ main();
54
+ } else {
55
+ log('info', 'OpenTelemetry not enabled');
56
+ }
@@ -1,5 +1,3 @@
1
- # syntax=docker/dockerfile:1.17
2
-
3
1
  FROM public.ecr.aws/docker/library/node:22-alpine AS dev-deps
4
2
 
5
3
  RUN --mount=type=bind,source=package.json,target=package.json \
@@ -75,7 +75,7 @@ For inspiration in this space, check out:
75
75
 
76
76
  ### Dev
77
77
 
78
- TODO: add support links for the dev environment.
78
+ TODO: add support links for the dev deployment.
79
79
 
80
80
  <!--
81
81
  - CloudWatch dashboard
@@ -85,7 +85,7 @@ TODO: add support links for the dev environment.
85
85
 
86
86
  ### Prod
87
87
 
88
- TODO: add support links for the prod environment.
88
+ TODO: add support links for the prod deployment.
89
89
 
90
90
  <!--
91
91
  - CloudWatch dashboard
@@ -23,9 +23,9 @@
23
23
  },
24
24
  "devDependencies": {
25
25
  "@types/node": "^22.13.10",
26
- "skuba": "13.0.0-subpath-imports-20250722044721"
26
+ "skuba": "13.0.0-subpath-imports-20251003044159"
27
27
  },
28
- "packageManager": "pnpm@10.12.4",
28
+ "packageManager": "pnpm@10.17.1",
29
29
  "engines": {
30
30
  "node": ">=22"
31
31
  }
@@ -77,6 +77,9 @@ steps:
77
77
  queue: <%- devBuildkiteQueueName %>
78
78
  label: 🤞 Deploy Dev
79
79
  concurrency_group: <%- teamName %>/deploy/gantry/<%- devGantryEnvironmentName %>
80
+ env:
81
+ DD_DEPLOYMENT_ENVIRONMENT: development
82
+ DD_DEPLOYMENT_SERVICE: <%- serviceName %>
80
83
  key: deploy-dev
81
84
  plugins:
82
85
  - seek-jobs/gantry#v4.0.0:
@@ -93,6 +96,9 @@ steps:
93
96
  branches: ${BUILDKITE_PIPELINE_DEFAULT_BRANCH}
94
97
  concurrency_group: <%- teamName %>/deploy/gantry/<%- prodGantryEnvironmentName %>
95
98
  depends_on: deploy-dev
99
+ env:
100
+ DD_DEPLOYMENT_ENVIRONMENT: production
101
+ DD_DEPLOYMENT_SERVICE: <%- serviceName %>
96
102
  plugins:
97
103
  - seek-jobs/gantry#v4.0.0:
98
104
  command: apply
@@ -1 +1 @@
1
- ENVIRONMENT=local
1
+ DEPLOYMENT=local
@@ -1,4 +1,5 @@
1
- environment: dev
1
+ deployment: dev
2
+ env: development
2
3
 
3
4
  maxInstanceCount: 1
4
5
  minInstanceCount: 1
@@ -7,5 +8,4 @@ minInstanceCount: 1
7
8
  cloudwatchDashboardDisabled: true
8
9
 
9
10
  openTelemetry:
10
- datadogEnvironmentName: development
11
- enabled: false
11
+ enabled: true
@@ -1,8 +1,8 @@
1
- environment: prod
1
+ deployment: prod
2
+ env: production
2
3
 
3
4
  maxInstanceCount: 10
4
5
  minInstanceCount: 3
5
6
 
6
7
  openTelemetry:
7
- datadogEnvironmentName: production
8
- enabled: false
8
+ enabled: true
@@ -8,7 +8,7 @@ COPY . .
8
8
 
9
9
  RUN pnpm install --offline
10
10
  RUN pnpm build
11
- RUN pnpm install --offline --prod
11
+ RUN CI=true pnpm install --offline --prod
12
12
 
13
13
  ###
14
14
 
@@ -1,5 +1,3 @@
1
- # syntax=docker/dockerfile:1.17
2
-
3
1
  FROM public.ecr.aws/docker/library/node:22-alpine AS dev-deps
4
2
 
5
3
  RUN --mount=type=bind,source=package.json,target=package.json \
@@ -29,7 +29,7 @@ It uses the [Koa] middleware framework and common SEEK packages.
29
29
  Resource APIs enable synchronous interactions and serve as the backbone of SEEK's general service architecture.
30
30
 
31
31
  The `koa-rest-api` template is modelled after a hypothetical service for posting and retrieving job advertisements.
32
- It's stubbed out with in-memory [storage](src/storage) which can observed by standing up an environment with multiple instances.
32
+ It's stubbed out with in-memory [storage](src/storage) which can observed by standing up a deployment with multiple instances.
33
33
  Storage is local to each instance, so load balancing across the instances may render a read inconsistent with a previous write.
34
34
  This would be replaced with an external data store in production.
35
35
 
@@ -75,19 +75,19 @@ pnpm start:debug
75
75
 
76
76
  This project is deployed through a [Buildkite pipeline](.buildkite/pipeline.yml).
77
77
 
78
- - Commits to a feature branch can be deployed to the dev environment by unblocking a step in the Buildkite UI
79
- - Commits to the default branch are automatically deployed to the dev and prod environments in sequence
78
+ - Commits to a feature branch can be deployed to the development environment by unblocking a step in the Buildkite UI
79
+ - Commits to the default branch are automatically deployed to the development and production environments in sequence
80
80
 
81
81
  To rapidly roll back a change,
82
82
  retry an individual deployment step from the previous build in Buildkite.
83
- Note that this will introduce drift between the head of the default Git branch and the live environment;
83
+ Note that this will introduce drift between the head of the default Git branch and the live deployment;
84
84
  use with caution and always follow up with a proper revert or fix in Git history.
85
85
 
86
86
  ## Support
87
87
 
88
88
  ### Dev
89
89
 
90
- TODO: add support links for the dev environment.
90
+ TODO: add support links for the dev deployment.
91
91
 
92
92
  <!--
93
93
  - CloudWatch dashboard
@@ -97,7 +97,7 @@ TODO: add support links for the dev environment.
97
97
 
98
98
  ### Prod
99
99
 
100
- TODO: add support links for the prod environment.
100
+ TODO: add support links for the prod deployment.
101
101
 
102
102
  <!--
103
103
  - CloudWatch dashboard
@@ -9,10 +9,14 @@ owner: '{{values "owner"}}'
9
9
  image: '{{values "image"}}'
10
10
 
11
11
  env:
12
- ENVIRONMENT: '{{values "environment"}}'
13
- OPENTELEMETRY_ENABLED: '{{.Values.openTelemetry.enabled | default false}}'
12
+ DEPLOYMENT: '{{values "deployment"}}'
14
13
  SERVICE: '{{values "service"}}'
15
14
 
15
+ DD_ENV: '{{values "env"}}'
16
+ DD_SERVICE: '{{values "service"}}'
17
+
18
+ OPENTELEMETRY_ENABLED: '{{values "openTelemetry.enabled"}}'
19
+
16
20
  {{if .Values.cloudwatchDashboardDisabled}}
17
21
  cloudwatchDashboardDisabled: {{values "cloudwatchDashboardDisabled"}}
18
22
  {{end}}
@@ -21,9 +25,17 @@ cloudwatchDashboardDisabled: {{values "cloudwatchDashboardDisabled"}}
21
25
  datadogSecretId: '{{values "datadogSecretId"}}'
22
26
  {{end}}
23
27
 
28
+ # Uncomment if the `tin` tier is acceptable for your SEEK Auth Sidecar logs
29
+ # The eeeoh log forwarder bypasses Amazon CloudWatch for cost savings
30
+ # logSink:
31
+ # forwarder: eeeoh
32
+ # splunkIndex: '{{values "logSink.splunkIndex"}}'
33
+
24
34
  openTelemetry:
25
- datadogEnvironmentName: '{{values "openTelemetry.datadogEnvironmentName"}}'
35
+ datadogEnvironmentName: '{{values "env"}}'
26
36
  enabled: {{values "openTelemetry.enabled"}}
37
+ useGantryServiceName: true
38
+
27
39
  {{if .Values.pagerDutyEndpoint}}
28
40
  pagerDutyEndpoint: '{{values "pagerDutyEndpoint"}}'
29
41
  {{end}}
@@ -20,37 +20,36 @@
20
20
  },
21
21
  "dependencies": {
22
22
  "@koa/bodyparser": "^6.0.0",
23
- "@koa/router": "^13.0.0",
23
+ "@koa/router": "^14.0.0",
24
24
  "@opentelemetry/api": "^1.9.0",
25
25
  "@opentelemetry/core": "^2.0.0",
26
- "@opentelemetry/exporter-trace-otlp-grpc": "^0.203.0",
27
- "@opentelemetry/instrumentation-aws-sdk": "^0.56.0",
28
- "@opentelemetry/instrumentation-http": "^0.203.0",
26
+ "@opentelemetry/exporter-trace-otlp-grpc": "^0.205.0",
27
+ "@opentelemetry/instrumentation-aws-sdk": "^0.60.0",
28
+ "@opentelemetry/instrumentation-http": "^0.205.0",
29
29
  "@opentelemetry/propagator-b3": "^2.0.0",
30
- "@opentelemetry/sdk-node": "^0.203.0",
31
- "@seek/logger": "^10.0.0",
32
- "hot-shots": "^10.0.0",
33
- "koa": "^2.16.1",
30
+ "@opentelemetry/sdk-node": "^0.205.0",
31
+ "@seek/logger": "^11.1.0",
32
+ "hot-shots": "^11.0.0",
33
+ "koa": "^3.0.1",
34
34
  "koa-compose": "^4.1.0",
35
- "seek-datadog-custom-metrics": "^4.6.3",
36
- "seek-koala": "^7.0.0",
35
+ "seek-datadog-custom-metrics": "^6.0.0",
36
+ "seek-koala": "^7.1.0",
37
37
  "skuba-dive": "^2.0.0",
38
- "zod": "^3.25.67"
38
+ "zod": "^4.0.0"
39
39
  },
40
40
  "devDependencies": {
41
41
  "@types/chance": "^1.1.3",
42
42
  "@types/co-body": "^6.1.3",
43
- "@types/koa": "^2.13.4",
43
+ "@types/koa": "^3.0.0",
44
44
  "@types/koa__router": "^12.0.0",
45
45
  "@types/node": "^22.13.10",
46
46
  "@types/supertest": "^6.0.0",
47
47
  "chance": "^1.1.8",
48
- "mime": "^4.0.1",
49
48
  "pino-pretty": "^13.0.0",
50
49
  "skuba": "*",
51
50
  "supertest": "^7.0.0"
52
51
  },
53
- "packageManager": "pnpm@10.12.4",
52
+ "packageManager": "pnpm@10.17.1",
54
53
  "engines": {
55
54
  "node": ">=22"
56
55
  }
@@ -3,8 +3,8 @@ import type { Middleware } from '#src/types/koa.js';
3
3
  /**
4
4
  * Signifies that the API is available to serve requests.
5
5
  *
6
- * The deployment environment calls this endpoint to see if the container is
7
- * unhealthy and needs to be recycled.
6
+ * The workload hosting environment calls this endpoint to see if the container
7
+ * is unhealthy and needs to be recycled.
8
8
  */
9
9
  export const healthCheckHandler: Middleware = (ctx) => {
10
10
  ctx.state.skipRequestLogging = true;
@@ -1,7 +1,7 @@
1
1
  import { Env } from 'skuba-dive';
2
2
 
3
3
  interface Config {
4
- environment: Environment;
4
+ deployment: Deployment;
5
5
 
6
6
  logLevel: string;
7
7
  name: string;
@@ -11,17 +11,17 @@ interface Config {
11
11
  port: number | null;
12
12
  }
13
13
 
14
- type Environment = (typeof environments)[number];
14
+ type Deployment = (typeof deployments)[number];
15
15
 
16
16
  const dev = '<%- devGantryEnvironmentName %>';
17
17
  const prod = '<%- prodGantryEnvironmentName %>';
18
18
 
19
- const environments = ['local', 'test', dev, prod] as const;
19
+ const deployments = ['local', 'test', dev, prod] as const;
20
20
 
21
- const environment = Env.oneOf(environments)('ENVIRONMENT');
21
+ const deployment = Env.oneOf(deployments)('DEPLOYMENT');
22
22
 
23
23
  /* istanbul ignore next: config verification makes more sense in a smoke test */
24
- const configs: Record<Environment, () => Omit<Config, 'environment'>> = {
24
+ const configs: Record<Deployment, () => Omit<Config, 'deployment'>> = {
25
25
  local: () => ({
26
26
  logLevel: 'debug',
27
27
  name: '<%- serviceName %>',
@@ -62,6 +62,6 @@ const configs: Record<Environment, () => Omit<Config, 'environment'>> = {
62
62
  };
63
63
 
64
64
  export const config: Config = {
65
- ...configs[environment](),
66
- environment,
65
+ ...configs[deployment](),
66
+ deployment,
67
67
  };
@@ -1,4 +1,4 @@
1
- import createLogger, { createDestination } from '@seek/logger';
1
+ import { createDestination, createLogger } from '@seek/logger';
2
2
  import { RequestLogging } from 'seek-koala';
3
3
 
4
4
  import { config } from '#src/config.js';
@@ -9,26 +9,30 @@ const { createContextMiddleware, mixin } =
9
9
  export const contextMiddleware = createContextMiddleware();
10
10
 
11
11
  const { destination, stdoutMock } = createDestination({
12
- mock: config.environment === 'test',
12
+ mock: config.deployment === 'test',
13
13
  });
14
14
 
15
15
  export { stdoutMock };
16
16
 
17
17
  export const logger = createLogger(
18
18
  {
19
- base: {
20
- environment: config.environment,
21
- version: config.version,
19
+ eeeoh: {
20
+ /**
21
+ * TODO: choose an appropriate Datadog log tier.
22
+ *
23
+ * https://github.com/seek-oss/logger/blob/master/docs/eeeoh.md#datadog-log-tiers
24
+ */
25
+ datadog: 'tin',
26
+ team: '<%- teamName %>',
27
+ use: 'environment',
22
28
  },
23
29
 
24
30
  mixin,
25
31
 
26
32
  level: config.logLevel,
27
33
 
28
- name: config.name,
29
-
30
34
  transport:
31
- config.environment === 'local' ? { target: 'pino-pretty' } : undefined,
35
+ config.deployment === 'local' ? { target: 'pino-pretty' } : undefined,
32
36
  },
33
37
  destination,
34
38
  );
@@ -7,5 +7,5 @@ import { config } from '#src/config.js';
7
7
 
8
8
  /* istanbul ignore next: StatsD client is not our responsibility */
9
9
  export const metricsClient = createStatsDClient(StatsD, config, (err) =>
10
- logger.error({ err }, 'StatsD error'),
10
+ logger.error(err, 'StatsD error'),
11
11
  );