From 84d58011f13bf753a238bf24408ceb5bec04c6b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20=C3=81ngel?= Date: Tue, 28 Apr 2026 11:02:27 -0400 Subject: [PATCH] ci: address CLI smoke review feedback --- .github/workflows/ci.yml | 63 ++++++----- .../core/src/lint/rules/composition.test.ts | 103 ------------------ packages/core/src/lint/rules/composition.ts | 47 -------- 3 files changed, 38 insertions(+), 175 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 95ea2fc03..8336fe9af 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -220,83 +220,96 @@ jobs: cli-smoke-required: name: "CLI smoke (required)" needs: changes + if: needs.changes.outputs.code == 'true' runs-on: ubuntu-latest timeout-minutes: 25 steps: - - name: Skip when no code changed - if: needs.changes.outputs.code != 'true' - run: echo "No code changes; CLI smoke required check passes." - - uses: actions/checkout@v4 - if: needs.changes.outputs.code == 'true' with: lfs: true - uses: oven-sh/setup-bun@v2 - if: needs.changes.outputs.code == 'true' - uses: actions/setup-node@v4 - if: needs.changes.outputs.code == 'true' with: node-version: 22 - name: Install FFmpeg - if: needs.changes.outputs.code == 'true' run: | sudo apt-get update sudo apt-get install -y ffmpeg - name: Install dependencies - if: needs.changes.outputs.code == 'true' run: bun install --frozen-lockfile - name: Build monorepo - if: needs.changes.outputs.code == 'true' run: bun run build - - name: Smoke-test CLI from monorepo source - if: needs.changes.outputs.code == 'true' + - name: Create smoke input video run: | + set -euo pipefail + ffmpeg -hide_banner -loglevel error \ + -f lavfi -i testsrc2=size=640x360:rate=30 \ + -f lavfi -i sine=frequency=880:sample_rate=48000 \ + -t 3 \ + -c:v libx264 \ + -pix_fmt yuv420p \ + -c:a aac \ + -shortest \ + -y /tmp/hf-cli-input.mp4 + test -s /tmp/hf-cli-input.mp4 + + - name: Smoke-test CLI from monorepo source + run: | + set -euo pipefail rm -rf /tmp/hf-cli-inside bun run --filter @hyperframes/cli dev -- init /tmp/hf-cli-inside \ - --example blank \ + --example warm-grain \ + --video /tmp/hf-cli-input.mp4 \ + --skip-transcribe \ --non-interactive \ --skip-skills bun run --filter @hyperframes/cli dev -- lint /tmp/hf-cli-inside bun run --filter @hyperframes/cli dev -- validate /tmp/hf-cli-inside --timeout 1000 bun run --filter @hyperframes/cli dev -- render /tmp/hf-cli-inside \ - --quality draft \ - --workers 1 \ - --strict-all \ + --quality standard \ + --workers auto \ + --strict \ --output /tmp/hf-cli-inside/renders/inside.mp4 test -s /tmp/hf-cli-inside/renders/inside.mp4 - name: Pack CLI tarball - if: needs.changes.outputs.code == 'true' run: | + set -euo pipefail mkdir -p /tmp/hf-cli-pack cd packages/cli - npm pack --pack-destination /tmp/hf-cli-pack + PACKED_TARBALL="$(npm pack --pack-destination /tmp/hf-cli-pack | tail -n 1)" + test -n "$PACKED_TARBALL" + test -f "/tmp/hf-cli-pack/$PACKED_TARBALL" + echo "HF_CLI_TARBALL=/tmp/hf-cli-pack/$PACKED_TARBALL" >> "$GITHUB_ENV" - name: Install packed CLI outside monorepo - if: needs.changes.outputs.code == 'true' - run: npm install -g --prefix /tmp/hf-cli-global /tmp/hf-cli-pack/hyperframes-cli-*.tgz + run: | + set -euo pipefail + npm install -g --prefix /tmp/hf-cli-global "$HF_CLI_TARBALL" - name: Smoke-test packed CLI outside monorepo - if: needs.changes.outputs.code == 'true' run: | + set -euo pipefail export PATH="/tmp/hf-cli-global/bin:$PATH" rm -rf /tmp/hf-cli-outside hyperframes init /tmp/hf-cli-outside \ - --example blank \ + --example warm-grain \ + --video /tmp/hf-cli-input.mp4 \ + --skip-transcribe \ --non-interactive \ --skip-skills hyperframes lint /tmp/hf-cli-outside hyperframes validate /tmp/hf-cli-outside --timeout 1000 hyperframes render /tmp/hf-cli-outside \ - --quality draft \ - --workers 1 \ - --strict-all \ + --quality standard \ + --workers auto \ + --strict \ --output /tmp/hf-cli-outside/renders/outside.mp4 test -s /tmp/hf-cli-outside/renders/outside.mp4 diff --git a/packages/core/src/lint/rules/composition.test.ts b/packages/core/src/lint/rules/composition.test.ts index bc274bf32..025fcc53a 100644 --- a/packages/core/src/lint/rules/composition.test.ts +++ b/packages/core/src/lint/rules/composition.test.ts @@ -2,109 +2,6 @@ import { describe, it, expect } from "vitest"; import { lintHyperframeHtml } from "../hyperframeLinter.js"; describe("composition rules", () => { - describe("subcomposition guidance", () => { - it("warns when a composition file is over 300 lines", () => { - const html = Array.from({ length: 301 }, (_, i) => - i === 0 ? "" : ``, - ).join("\n"); - - const result = lintHyperframeHtml(html); - const finding = result.findings.find((f) => f.code === "composition_file_too_large"); - expect(finding).toBeDefined(); - expect(finding?.severity).toBe("warning"); - }); - - it("does not warn when a composition file is exactly 300 lines", () => { - const html = Array.from({ length: 300 }, (_, i) => - i === 0 ? "" : ``, - ).join("\n"); - - const result = lintHyperframeHtml(html); - const finding = result.findings.find((f) => f.code === "composition_file_too_large"); - expect(finding).toBeUndefined(); - }); - - it("warns when more than 3 timed elements share the same track", () => { - const html = ` - -
-
A
-
B
-
C
-
D
-
- -`; - - const result = lintHyperframeHtml(html); - const finding = result.findings.find((f) => f.code === "timeline_track_too_dense"); - expect(finding).toBeDefined(); - expect(finding?.severity).toBe("warning"); - expect(finding?.message).toContain("Track 0 has 4 timed elements"); - }); - - it("does not warn when 3 timed elements share the same track", () => { - const html = ` - -
-
A
-
B
-
C
-
- -`; - - const result = lintHyperframeHtml(html); - const finding = result.findings.find((f) => f.code === "timeline_track_too_dense"); - expect(finding).toBeUndefined(); - }); - - it("does not warn when timed elements are split across tracks", () => { - const html = ` - -
-
A
-
B
-
C
-
D
-
- -`; - - const result = lintHyperframeHtml(html); - const finding = result.findings.find((f) => f.code === "timeline_track_too_dense"); - expect(finding).toBeUndefined(); - }); - - it("does not count the root composition element as a timed track element", () => { - const html = ` - -
-
A
-
B
-
C
-
- -`; - - const result = lintHyperframeHtml(html); - const finding = result.findings.find((f) => f.code === "timeline_track_too_dense"); - expect(finding).toBeUndefined(); - }); - }); - it("reports info for composition with external CDN script dependency", () => { const html = `