@norskvideo/ctl-dev-kit 0.1.62 → 0.1.64

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.
@@ -78,6 +78,31 @@ jobs:
78
78
  bun run docs:check
79
79
  '
80
80
 
81
+ # Does this repo's licence template still describe this repo? A template
82
+ # naming the wrong product, or an imageRef the build never produces, mints
83
+ # a licence that entitles nothing -- and the first sign of that is a
84
+ # 60-second readiness timeout at launch, indistinguishable from a product
85
+ # that failed to start. Cheap, no secrets, every PR.
86
+ #
87
+ # The image name is CI's own rule: PUBLISH_IMAGE when set, else the build
88
+ # script's IMAGE_TAG default, tag stripped -- a licence matches the repo
89
+ # part alone, never the tag.
90
+ - name: Check the licence template matches this repo
91
+ run: |
92
+ set -euo pipefail
93
+ product="$(sed -nE 's/.*PRODUCT_NAME[[:space:]]*=[[:space:]]*"([^"]+)".*/\1/p' shared/src/version.ts | head -1)"
94
+ [ -n "$product" ] || { echo "::error::could not read PRODUCT_NAME from shared/src/version.ts"; exit 1; }
95
+ pub="$(sed -nE 's/^[[:space:]]*PUBLISH_IMAGE:[[:space:]]*"?([^" ]*)"?[[:space:]]*$/\1/p' .github/workflows/build-image.yml | head -1)"
96
+ def="$(sed -nE 's/.*IMAGE_TAG:-([^}]+)\}.*/\1/p' deployment/build-image.sh | head -1)"
97
+ ref="${pub:-$def}"
98
+ # A colon is a tag only after the last slash (a registry host may carry a port).
99
+ image="${ref%:*}"
100
+ case "${ref##*/}" in *:*) ;; *) image="$ref" ;; esac
101
+ [ -n "$image" ] || { echo "::error::could not determine the image this repo builds"; exit 1; }
102
+ nix develop .#build --command bun \
103
+ node_modules/@norskvideo/ctl-dev-kit/licence/check-template.ts \
104
+ licenseTemplate.json "$product" "$image"
105
+
81
106
  # Report this pipeline's result to the aggregated product CI dashboard
82
107
  # (id3as/ci-workflows) instead of posting its own pony — the dashboard renders
83
108
  # the pony/emoji from the dispatched result. !cancelled() so a real pass/fail
@@ -88,13 +88,37 @@ jobs:
88
88
  echo "NORSK_TEST_HOST=host.docker.internal" >> "$GITHUB_ENV"
89
89
  echo "NORSK_NET_REACH=direct" >> "$GITHUB_ENV"
90
90
  echo "NORSK_CTL_PRODUCT_REACH=container-address" >> "$GITHUB_ENV"
91
+ echo "NORSK_RUNNER_OWNS_DOCKER=false" >> "$GITHUB_ENV"
91
92
  else
92
93
  echo "TOPO: hostname is not a container -> runner is host-based"
93
94
  echo "NORSK_TEST_HOST=localhost" >> "$GITHUB_ENV"
94
95
  echo "NORSK_NET_REACH=publish" >> "$GITHUB_ENV"
95
96
  echo "NORSK_CTL_PRODUCT_REACH=host" >> "$GITHUB_ENV"
97
+ echo "NORSK_RUNNER_OWNS_DOCKER=true" >> "$GITHUB_ENV"
96
98
  fi
97
99
 
100
+ # `product add --image` publishes the control plane on 127.0.0.1:14321 and
101
+ # the container is a singleton that outlives its daemon, so a job killed
102
+ # after registering -- this workflow cancels its own superseded runs --
103
+ # strands it holding the port and every later job here fails to bind. One
104
+ # leaked on 2026-08-30 and took out the next nine smoke and integration
105
+ # jobs across four repos before a human cleared it. The harness teardown
106
+ # closes the clean-exit half; nothing but this can heal a runner that is
107
+ # already poisoned, because a SIGKILLed job runs no teardown.
108
+ #
109
+ # Gated on the daemon being this runner's own. The GPU box runs several
110
+ # runners as sibling CONTAINERS against one host daemon, where a blanket
111
+ # reap would kill a concurrent job's control plane.
112
+ - name: Reap a stranded product control plane
113
+ if: ${{ env.NORSK_RUNNER_OWNS_DOCKER == 'true' }}
114
+ run: |
115
+ set -uo pipefail
116
+ stale="$(docker ps -aq --filter 'name=^norsk-product-')"
117
+ [ -n "$stale" ] || { echo "no stranded control plane"; exit 0; }
118
+ echo "::warning::reaping a stranded product control plane -- a previous job did not tear its own down"
119
+ docker inspect --format '{{.Name}} {{.State.Status}} {{.Config.Image}}' $stale || true
120
+ docker rm -f $stale || true
121
+
98
122
  - name: Write the Norsk license (from the org secret)
99
123
  env:
100
124
  NORSK_LICENSE_V2: ${{ secrets.NORSK_LICENSE_V2 }}
package/package.json CHANGED
@@ -1,21 +1,22 @@
1
1
  {
2
2
  "name": "@norskvideo/ctl-dev-kit",
3
- "version": "0.1.62",
3
+ "version": "0.1.64",
4
4
  "type": "module",
5
5
  "exports": {
6
- "./package.json": "./package.json",
7
- "./testing/invariants": "./testing/invariants.ts",
8
- "./testing/byte-snapshot": "./testing/byte-snapshot.ts",
9
6
  "./create-product": "./create-product/create-product.ts",
10
- "./docs/path-existence": "./docs/path-existence.ts",
11
- "./docs/splice-generated": "./docs/splice-generated.ts",
12
7
  "./doc-guide": "./doc-guide/doc-guide.js",
13
8
  "./doc-guide/build-manual": "./doc-guide/build-manual.js",
14
9
  "./doc-guide/bundle": "./doc-guide/bundle.js",
15
- "./doc-guide/prose-bundle": "./doc-guide/prose-bundle.js",
16
10
  "./doc-guide/guides-config": "./doc-guide/guides-config.js",
17
11
  "./doc-guide/instance-proxy": "./doc-guide/instance-proxy.js",
18
- "./doc-guide/live-browser": "./doc-guide/live-browser.js"
12
+ "./doc-guide/live-browser": "./doc-guide/live-browser.js",
13
+ "./doc-guide/prose-bundle": "./doc-guide/prose-bundle.js",
14
+ "./docs/path-existence": "./docs/path-existence.ts",
15
+ "./docs/splice-generated": "./docs/splice-generated.ts",
16
+ "./licence/check-template": "./licence/check-template.ts",
17
+ "./package.json": "./package.json",
18
+ "./testing/byte-snapshot": "./testing/byte-snapshot.ts",
19
+ "./testing/invariants": "./testing/invariants.ts"
19
20
  },
20
21
  "bin": {
21
22
  "ctl-dev-kit": "./create-product/cli.ts"