Skip to content

[Visual Test] Label preflight pagination aborts workflow before screenshot capture on run #30887567592 #970

Description

@MichaelFisher1997

Workflow run

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

Head SHA: 8d205ff0b27a951ac7136cb72796ecd8e2e91ed4 (the only commit on dev: the nix flake → devenv migration, PR #951)

Exact failure

The failure is not in Vulkan or screenshot readback. The game command never ran, so build-output.log was never created. The diagnose agent found the workspace contained only weston.log (weston startup, then caught signal 15 from the Stop headless Wayland compositor step), no screenshot.png, and no captured log.

The failing step is Ensure visual-test label exists at .github/workflows/visual-test.yml:55-66. It runs:

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

The gh label list invocation returns the GitHub default 30 labels per page. The repository currently has 41 labels, and run-visual-test is on page 2. The precheck therefore reports the label as missing even though it exists. The subsequent gh label create then fails with:

label with name "run-visual-test" already exists; use `--force` to update its color and description

Because the step uses set -euo pipefail (it runs via the gh CLI which exits non-zero on a duplicate create), the step exits 1. Subsequent steps (Setup Lavapipe Vulkan, Run menu screenshot capture, the screenshot existence check, the golden-image diff, the artifact uploads) are skipped. Only the Stop headless Wayland compositor step runs (it has if: always()), and it kills the weston process with SIGTERM — which is the signal recorded in weston.log:62.

Why there is no Vulkan, swapchain, or screenshot error

VulkanSwapchain.createSwapchain at modules/engine-graphics/src/vulkan_swapchain.zig:127, the headless 1920x1080 color-attachment image at the same file lines 128-174, screenshot-mode init at src/game/app.zig:268-276, HomeScreen.init at modules/game-ui/src/screens/home.zig:33-40, and screenshot.requestCapture at modules/engine-graphics/src/vulkan/screenshot.zig:24-44 were never executed. The Zig binary was never launched; only the YAML pipeline ran.

Additional observations

  • gh label list --repo OpenStaticFish/ZigCraft --limit 100 returns 41 labels; the default gh label list returns 30. run-visual-test is at index 31 of 41, so the page-1-only check cannot see it. Verified locally on dev.
  • The previous issue [Visual Test] Label pagination aborts workflow before screenshot capture #968 (run #30795834741) described the same root cause. That issue is still OPEN and the Ensure visual-test label exists step in visual-test.yml has not been modified since the devenv migration commit 8d205ff (the only commit on dev), so the regression is recurring.
  • The diagnose prompt is also stale but did not cause this run failure: .github/prompts/visual-test-diagnose.md:7 says screenshot.ppm, while the actual command at .github/workflows/visual-test.yml:81 uses the supported screenshot.png. The current encoder would still reject .ppm at modules/engine-graphics/src/vulkan/screenshot.zig:39 if a future run reverted to .ppm.

Suggested fix

Make the bootstrap idempotent without relying on paginated list output:

- name: Ensure visual-test labels exist
  run: |
    gh label create "visual-test" \
      --description "Issues from automated visual regression tests" \
      --color "E06C75" \
      --force
    gh label create "run-visual-test" \
      --description "Run deterministic visual regression workflow on a PR" \
      --color "E06C75" \
      --force
  env:
    GH_TOKEN: ${{ secrets.OPENCODE_PAT }}

Alternatively, query each exact label through gh api repos/$GITHUB_REPOSITORY/labels/<name> before creating it, or add --limit 100 to the existing gh label list call to cover the current page count.

Also update .github/prompts/visual-test-diagnose.md to describe the actual PNG output path and the current HomeScreen module at modules/game-ui/src/screens/home.zig (the prompt still references the old src/game/screens/home.zig).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghotfixvisual-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