@norskvideo/ctl-dev-kit 0.2.33 → 0.2.35

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.
@@ -208,6 +208,31 @@ jobs:
208
208
  # in here and breaks a schema handed across the instance boundary.
209
209
  bun node_modules/@norskvideo/ctl-dev-kit/conventions/zod-singleton.ts
210
210
  '
211
+ # licenseTemplate.json records the entry a licence is minted from: this
212
+ # product at the image CI builds. One naming another image mints a licence
213
+ # that entitles nothing, first seen as a refused launch at the customer.
214
+ # The Studio checks pair this with check-product-name (the compose asks
215
+ # for what is recorded); an sdk-app names itself in its own handshake, so
216
+ # there is no Studio declaration to lint. Cheap, no secrets, every PR.
217
+ #
218
+ # The image name is CI's own rule: PUBLISH_IMAGE when set, else the build
219
+ # script's IMAGE_TAG default, tag stripped -- a licence matches the repo
220
+ # part alone, never the tag.
221
+ - name: Check this repo records its own licence
222
+ run: |
223
+ set -euo pipefail
224
+ product="$(sed -nE 's/.*PRODUCT_NAME[[:space:]]*=[[:space:]]*"([^"]+)".*/\1/p' src/product/version.ts | head -1)"
225
+ [ -n "$product" ] || { echo "::error::could not read PRODUCT_NAME from src/product/version.ts"; exit 1; }
226
+ pub="$(sed -nE 's/^[[:space:]]*PUBLISH_IMAGE:[[:space:]]*"?([^" ]*)"?[[:space:]]*$/\1/p' .github/workflows/build-image.yml | head -1)"
227
+ def="$(sed -nE 's/.*IMAGE_TAG:-([^}]+)\}.*/\1/p' deployment/build-image.sh | head -1)"
228
+ ref="${pub:-$def}"
229
+ # A colon is a tag only after the last slash (a registry host may carry a port).
230
+ image="${ref%:*}"
231
+ case "${ref##*/}" in *:*) ;; *) image="$ref" ;; esac
232
+ [ -n "$image" ] || { echo "::error::could not determine the image this repo builds"; exit 1; }
233
+ nix develop .#build --command bun \
234
+ node_modules/@norskvideo/ctl-dev-kit/licence/check-template.ts \
235
+ licenseTemplate.json "$product" "$image"
211
236
  - name: Reap the containers this job launched
212
237
  # Whatever the tests did. A teardown cut short by a test timeout leaves
213
238
  # its instance running on the shared Docker daemon (see JOB_REAP_STEP in
@@ -228,12 +228,17 @@ jobs:
228
228
  # licence was never minted should say so in seconds, by name.
229
229
  #
230
230
  # The product name is the repo's own PRODUCT_NAME, not the short board key
231
- # above (`funke` vs `funke-pegasus`): the licence names the product.
231
+ # above (`funke` vs `funke-pegasus`): the licence names the product. A
232
+ # Studio product keeps it in shared/src/version.ts, an sdk-app (norsk-relay)
233
+ # in src/product/version.ts; the first that exists is read.
232
234
  - name: Check the licence entitles this product
233
235
  run: |
234
236
  set -euo pipefail
235
- product="$(sed -nE 's/.*PRODUCT_NAME[[:space:]]*=[[:space:]]*"([^"]+)".*/\1/p' shared/src/version.ts | head -1)"
236
- [ -n "$product" ] || { echo "::error::could not read PRODUCT_NAME from shared/src/version.ts"; exit 1; }
237
+ vf=""
238
+ for f in shared/src/version.ts src/product/version.ts; do [ -f "$f" ] && { vf="$f"; break; }; done
239
+ [ -n "$vf" ] || { echo "::error::no shared/src/version.ts or src/product/version.ts"; exit 1; }
240
+ product="$(sed -nE 's/.*PRODUCT_NAME[[:space:]]*=[[:space:]]*"([^"]+)".*/\1/p' "$vf" | head -1)"
241
+ [ -n "$product" ] || { echo "::error::could not read PRODUCT_NAME from $vf"; exit 1; }
237
242
  nix develop .#build --command bun \
238
243
  node_modules/@norskvideo/ctl-dev-kit/licence/check-entitlement.ts \
239
244
  "$RUNNER_TEMP/norsk-license.json" "$product"
@@ -241,14 +246,17 @@ jobs:
241
246
  # Instance launch docker-composes the media + studio images; on a cold
242
247
  # runner the first pull overruns the per-test timeout. Pre-pull them (tags
243
248
  # from manifest.seed.json), plus whatever the repo lists in the optional
244
- # scripts/smoke/prepull-extra.sh hook (a driver image, a sidecar).
249
+ # scripts/smoke/prepull-extra.sh hook (a driver image, a sidecar). An
250
+ # sdk-app has no Studio pair and no seed: its hook pulls its engine.
245
251
  - name: Pre-pull the media + studio images
246
252
  run: |
247
253
  set -euo pipefail
248
- for img in "$(jq -r '.latest.media' manifest.seed.json)" "$(jq -r '.latest.studio' manifest.seed.json)"; do
249
- echo "pre-pulling $img"
250
- docker pull "$img"
251
- done
254
+ if [ -f manifest.seed.json ]; then
255
+ for img in "$(jq -r '.latest.media' manifest.seed.json)" "$(jq -r '.latest.studio' manifest.seed.json)"; do
256
+ echo "pre-pulling $img"
257
+ docker pull "$img"
258
+ done
259
+ fi
252
260
  if [ -x scripts/smoke/prepull-extra.sh ]; then
253
261
  echo "running scripts/smoke/prepull-extra.sh"
254
262
  ./scripts/smoke/prepull-extra.sh
@@ -263,6 +271,12 @@ jobs:
263
271
  env:
264
272
  NORSK_CTL_BINARY: ${{ runner.temp }}/norsk-ctl
265
273
  NORSK_LICENSE_FILE: ${{ runner.temp }}/norsk-license.json
274
+ # A direct-SDK product's (sdk-app's) licence identity: the sdk-client
275
+ # cert + key it answers the engine's V2 handshake with, base64, as repo
276
+ # secrets. Studio carries its own baked identity, so a Studio product
277
+ # sets neither and these arrive empty.
278
+ NORSK_SDK_CLIENT_CERT_B64: ${{ secrets.NORSK_SDK_CLIENT_CERT_B64 }}
279
+ NORSK_SDK_CLIENT_KEY_B64: ${{ secrets.NORSK_SDK_CLIENT_KEY_B64 }}
266
280
  # Where the harness copies each instance's full engine logs
267
281
  # (/var/log/norsk -> debug.json, host-mounted under the store) before
268
282
  # teardown nukes them, plus — since ctl-test-harness 0.1.60 — each
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@norskvideo/ctl-dev-kit",
3
- "version": "0.2.33",
3
+ "version": "0.2.35",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  "./create-product": "./create-product/create-product.ts",