Skip to content

[Visual Test] Label preflight pagination skips Lavapipe screenshot capture on run #30522565636 #960

Description

@MichaelFisher1997

Workflow

https://github.com/OpenStaticFish/ZigCraft/actions/runs/30522565636

Symptom

The workspace post-run contained only weston.log; build-output.log and screenshot.png are both absent. Because Run menu screenshot capture (line 73-87 of .github/workflows/visual-test.yml) is reached only after every prior step succeeds, no Zig/Vulkan/Lavapipe/SDL output was captured. The visible step outputs read:

screenshot_exists=false
exists=false   # build-output.log check

There is no error: ..., no Vulkan device log, no Lavapipe ICD resolution output, no screenshot path-format error — the screenshot step itself never ran.

Diagnosis

Same root cause as #945, #946, #947, #949, #950, #952, #954, #956, #958 (all reproduces of the same preflight bug, with PR #957 still proposing the fix on dev). .github/workflows/visual-test.yml:55-68 is the offending step:

- name: Ensure visual-test label exists
  run: |
    if ! gh label list --json name --jq '.[].name' | grep -q '^visual-test$'; then
      gh label create "visual-test" \
        --description "Issues from automated visual regression tests" \
        --color "E06C75"
    fi
    if ! gh label list --json name --jq '.[].name' | grep -q '^run-visual-test$'; then
      gh label create "run-visual-test" \
        --description "Run deterministic visual regression workflow on a PR" \
        --color "E06C75"
    fi
  env:
    GH_TOKEN: ${{ secrets.OPENCODE_PAT }}
  • gh label list --json name defaults to 30 entries per page. The repository now has 41+ labels, so visual-test and run-visual-test (which sit on page 2 — see https://github.com/OpenStaticFish/ZigCraft/labels?page=2) are not returned.
  • The if ! ... | grep -q '^visual-test$' guard therefore evaluates true and the script tries to create both labels.
  • gh label create returns label with name "..." already exists; use --force to update its color and description and exits 1.
  • The step has no continue-on-error: true, so all subsequent steps are skipped: Setup Lavapipe Vulkan, Run menu screenshot capture (line 73-87), Check screenshot exists (line 89-97), Check build log exists (line 117-120). Only Start headless Wayland compositor (line 32-33) had already run, leaving weston.log as the sole artifact.

The diagnosis prompt's screenshot.ppm hypothesis is stale for this run: .github/workflows/visual-test.yml:81 already passes -Dscreenshot-path=screenshot.png, and modules/engine-graphics/src/vulkan/screenshot.zig:262-268 (detectScreenshotFormat) accepts that extension. The Zig/Vulkan/screenshot code is never exercised because the preflight short-circuits the job first.

Suggested fix (drop-in)

- name: Ensure visual-test label exists
  run: |
    set -euo pipefail
    existing=$(gh label list --json name --paginate --jq '.[].name')
    echo "$existing" | grep -q '^visual-test$' || gh label create "visual-test" \
      --description "Issues from automated visual regression tests" \
      --color "E06C75"
    echo "$existing" | grep -q '^run-visual-test$' || gh label create "run-visual-test" \
      --description "Run deterministic visual regression workflow on a PR" \
      --color "E06C75"
  env:
    GH_TOKEN: ${{ secrets.OPENCODE_PAT }}

--paginate is the robust variant (no label-count assumption); --limit 100 is equivalent for the current state. This patch is compatible with the still-open PR #957.

Defensive follow-ups worth considering

  • Add continue-on-error: true (or simply || true around gh label create) to Ensure visual-test label exists so a future regression in label bootstrap cannot silently hide Zig/Vulkan/screenshot failures.
  • Optionally lift label bootstrap out of visual-test.yml into a one-off bootstrap workflow so it never gates the screenshot path again.

Tracking

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghotfixquestionFurther information is requestedvisual-testIssues from automated visual regression tests

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions