@norskvideo/ctl-dev-kit 0.2.24 → 0.2.25

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.
@@ -186,7 +186,14 @@ jobs:
186
186
  for attempt in 1 2 3 4 5; do
187
187
  if git push origin HEAD:main; then exit 0; fi
188
188
  echo "push rejected (attempt $attempt) - rebasing onto latest origin/main"
189
- git fetch origin main
189
+ # --unshallow, not a plain fetch: these runners keep their .git
190
+ # between jobs, and a commit an earlier job fetched at depth 1 stays
191
+ # recorded as parentless. A plain fetch does not re-fetch an object it
192
+ # already holds, so main's tip can look like an unrelated root and the
193
+ # rebase replays our base commit over it -- add/add conflicts on every
194
+ # file it touches (playout + studio, 2026-10-03). The fallback covers
195
+ # a repo that is already complete, where --unshallow is refused.
196
+ git fetch --unshallow origin main 2>/dev/null || git fetch origin main
190
197
  git rebase origin/main || { git rebase --abort; echo "rebase hit a real conflict; aborting"; exit 1; }
191
198
  done
192
199
  echo "push still failing after 5 rebase attempts"; exit 1
@@ -318,7 +318,14 @@ jobs:
318
318
  for attempt in 1 2 3 4 5; do
319
319
  if git push origin HEAD:main; then exit 0; fi
320
320
  echo "push rejected (attempt $attempt) - rebasing onto latest origin/main"
321
- git fetch origin main
321
+ # --unshallow, not a plain fetch: these runners keep their .git
322
+ # between jobs, and a commit an earlier job fetched at depth 1 stays
323
+ # recorded as parentless. A plain fetch does not re-fetch an object it
324
+ # already holds, so main's tip can look like an unrelated root and the
325
+ # rebase replays our base commit over it -- add/add conflicts on every
326
+ # file it touches (playout + studio, 2026-10-03). The fallback covers
327
+ # a repo that is already complete, where --unshallow is refused.
328
+ git fetch --unshallow origin main 2>/dev/null || git fetch origin main
322
329
  git rebase origin/main || { git rebase --abort; echo "rebase hit a real conflict; aborting"; exit 1; }
323
330
  done
324
331
  echo "push still failing after 5 rebase attempts"; exit 1
@@ -265,6 +265,28 @@ export function lockfileRefreshCanFail(yaml: string): number[] {
265
265
  return out;
266
266
  }
267
267
 
268
+ /** `- name:` lines of steps that rebase onto a fetched branch without first
269
+ * unshallowing.
270
+ *
271
+ * The self-hosted runners keep each repo's .git between jobs, and
272
+ * actions/checkout fetches at depth 1, so a commit an earlier job fetched is
273
+ * left recorded as parentless. A plain `git fetch` will not re-fetch an object
274
+ * it already holds, so when that commit is main's tip the rebase sees two
275
+ * unrelated roots and replays our base commit over it: add/add conflicts on
276
+ * every file, read as "a real conflict". It failed playout's sync-dev-kit and
277
+ * studio's upgrade-latest that way on 2026-10-03. `--unshallow` re-fetches the
278
+ * parents and clears the stale boundary. */
279
+ export function rebaseWithoutUnshallow(yaml: string): number[] {
280
+ const lines = yaml.split("\n");
281
+ const out: number[] = [];
282
+ lines.forEach((text, i) => {
283
+ if (!/^\s+- name:/.test(text)) return;
284
+ const body = stepBody(lines, i);
285
+ if (/\bgit rebase\b/.test(body) && !/git fetch --unshallow\b/.test(body)) out.push(i + 1);
286
+ });
287
+ return out;
288
+ }
289
+
268
290
  /** A `ctl-candidate` validation that another candidate, or its own retry, can
269
291
  * cancel.
270
292
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@norskvideo/ctl-dev-kit",
3
- "version": "0.2.24",
3
+ "version": "0.2.25",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  "./create-product": "./create-product/create-product.ts",