Skip to content

ci: run the page and ui sections on pull requests, add a same-look check - #3500

Merged
BaseMax merged 10 commits into
mainfrom
ci/ui-pr-gate
Nov 16, 2026
Merged

BaseMax merged 10 commits into
mainfrom
ci/ui-pr-gate

Conversation

@BaseMax

@BaseMax BaseMax commented Nov 16, 2026 •

Copy link
Copy Markdown
Member

Adds a light, path-filtered pull request gate for the page and ui test sections (en and fa), and a nightly web vs native same-look check.

What changed

  • .github/workflows/ui-pr-gate.yml: runs on pull requests, pushes to main, nightly and by hand. A changes job filters on std/gui/{ui,style,flow,color,paint,typeset,window,reactive}, std/layout, compiler/sal_layout, compiler/semantic/sema_layout*.salam, tools/salam/style-.tsv, tests//page, tests/*/ui and the gate's own files. The compiler is built once from the PR with the pinned 0.6.3 seed (about 3.5 minutes on a hosted runner) and cached on a hash of compiler/, std/, VERSION and the build script, then shared as an artifact. Six legs run headless (page en and fa split in two shards, ui en and fa). A final UI and pages gate job is the one to make required, since it also passes when the filter skipped everything.
  • tools/bash/ui-gate-run.sh: runs a section, puts a 150 s limit on every compiler call, and fails only on failures that are not in tools/ui-gate-known-failures.txt.
  • tools/ui-gate-known-failures.txt: the failing tests on main today (18 ui en, 17 ui fa, 146 page en, 160 page fa, from the baseline built at 6f9e114). Both sections are red on main right now (the style-standard migration is in flight), so a plain gate would block every PR. The list only shrinks: delete a name when its fix lands. Two page error tests hang the compiler on main (runtime_layout_if_not_bool, static_layout_if); the per-call limit turns that into a normal failure instead of a 40 minute stall.
  • .github/workflows/ui-look-check.yml and tools/bash/ui-look-check.sh: nightly and manual, not required. Renders the pages in tools/ui-look/pages as web (headless Chrome screenshot of salam page build output) and native (the program --ui=native generates, drawn by ui.RenderPage and saved with paint.SavePNG, because the SALAM_UI_SCRIPT shot driver is not in std on main), then compares with ImageMagick under a percent tolerance. Reports and diff images are uploaded. It reports only unless strict is set.

Examples

A page in the look corpus:

page:
    title = "Form"
    box:
        padding = 20
        background = #ffffff
        heading: font size = 28 content = "Sign in" end
        button: content = "Continue" padding = 10 background = #3366aa color = #ffffff radius = 6 end
    end
end

Tested

  • actionlint, zizmor, shellcheck and prek on the changed files.
  • The page and ui sections were run locally with the main baseline compiler to produce the known-failure lists (page en 1340 passed 146 failed, page fa 1238 passed 160 failed, ui 0 of 35).
  • The native half of the look check was run locally with the baseline compiler; the web half needs Chrome, which this box does not have, so it is unverified until the first nightly run. The corpus uses only the vocabulary the baseline accepts (no padding = 8, 16 or border = 2, solid, c yet); extend the pages as the standard lands.
  • Review comments addressed: compare errors are no longer reported as passes, the cache key includes std, and the native render no longer depends on the script driver.

Summary by CodeRabbit

  • Tests
    • Added automated checks for page and interface behavior in English and Persian, including visual comparisons between web and native renders.
    • Added sample Cards, Form, and List pages to the page-test suite.
    • Test reports now summarize results and include available screenshots and visual differences. Known test failures are tracked so newly detected failures can be identified.

Copilot AI balanced review requested due to automatic review settings November 16, 2026 12:47
@vercel

vercel Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
salam Error Error Nov 17, 2026 1:19pm UTC

@coderabbitai

coderabbitai Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

Explain Change →

Caution

Review failed

The pull request is closed.

Walkthrough

The pull request adds a GitHub Actions gate for English and Persian UI tests, a shell runner that checks failures against a known list, and a workflow that compares web and native renders of three Salam pages.

Changes: UI test gate

Layer / File(s) Summary
Test gate runner
tools/bash/ui-gate-run.sh, tools/ui-gate-known-failures.txt
The runner extracts failing test names and compares them with the known-failure list. It can list failures, and it reports an error if the run produces no RESULT: line.
Test gate workflow
.github/workflows/ui-pr-gate.yml
The workflow detects relevant changes, builds or restores a compiler, runs English and Persian page tests in shards and UI tests without shards, then checks job results.

Page visual comparison

Layer / File(s) Summary
Render and compare pages
tools/bash/ui-look-check.sh, tools/ui-look/pages/*
The script captures web and native renders of Salam pages and compares fitted screenshots. It writes per-page outputs and a report. The Cards, Form, and List pages provide the comparison inputs.
Visual check workflow
.github/workflows/ui-look-check.yml
The workflow prepares the compiler and image tools, runs the comparison, adds its report to the step summary, and uploads available outputs.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Other

Sequence Diagram(s)

sequenceDiagram
  participant Check as ui-look-check.sh
  participant Compiler as SALAM compiler
  participant Browser as Chromium
  participant Renderer as Native renderer
  participant Compare as ImageMagick
  Check->>Compiler: Build web HTML
  Check->>Browser: Capture web screenshot
  Check->>Compiler: Dump page program and build native screenshot program
  Check->>Renderer: Run native screenshot program
  Check->>Compare: Compare fitted screenshots
Loading

Suggested reviewers: bdadmehr0, erfangnu

Merge Risk: Low · up to d4b99

This adds a PR gate for UI and page tests and a nightly visual comparison. It does not affect shipped behavior. The gate can silently pass if its known-failure list is deleted or unreadable, and the seed compiler pin is not enforced. Both are small fixes that are worth making before relying on the gate.

- [ ] Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The native screenshot path is unsupported, comparison errors can be misreported as passes, and cache keys omit standard-library dependencies, undermining the render checks and CI verification.

4 open issues
What changed in this PR

Adds CI coverage for Salam’s page and native UI features, plus a nightly comparison of web and native rendering.

Changes:

  • Adds a path-filtered gate running page and UI test sections in English and Persian.
  • Adds a screenshot comparison script and scheduled workflow with configurable tolerance.
  • Adds three sample pages for visual comparisons.
File Description
.github/​workflows/​ui-pr-gate.yml Builds the compiler and gates page/UI test results.
.github/​workflows/​ui-look-check.yml Schedules render comparisons and uploads artifacts.
tools/​bash/​ui-look-check.sh Captures and compares web/native screenshots.
tools/​ui-look/​pages/​cards.salam Exercises components and flex card layout.
tools/​ui-look/​pages/​form.salam Exercises text and button styling.
tools/​ui-look/​pages/​list.salam Exercises stacked boxes and backgrounds.

Review effort: Balanced

Comment thread tools/bash/ui-look-check.sh Outdated
Comment on lines +149 to +150
printf 'shot %s\nquit\n' "$work/native.png" >"$work/shot.script"
(cd "$work" && SALAM_WINDOW_BACKEND=headless SALAM_UI_SCRIPT="$work/shot.script" timeout 60 ./app) >"$work/native-run.log" 2>&1
Comment thread tools/bash/ui-look-check.sh Outdated
Comment on lines +159 to +160
diffpx=$($IM_COMPARE -metric AE -fuzz "${FUZZ}%" "$work/web-fit.png" "$work/native-fit.png" "$OUT/$name-diff.png" 2>&1 | awk '{ print int($1) }')
case "$diffpx" in '' | *[!0-9]*) diffpx=$((W * H)) ;; esac
Comment thread .github/workflows/ui-look-check.yml Resolved
Comment thread .github/workflows/ui-pr-gate.yml Resolved
@BaseMax
BaseMax marked this pull request as ready for review November 16, 2026 14:33
@BaseMax
BaseMax requested a review from a team as a code owner November 16, 2026 14:33
@github-actions

github-actions Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor
sha=dca23efe9211b225da9d97ba79dc21ea1ecdbeca

🤖 Salam AI review

Verdict: 🛠️ Changes needed before merging

commit dca23ef · 8 files · +963 −0 · model salam

Summary

This pull request adds a path-filtered PR and main-branch gate for the page and ui test sections, plus a nightly/manual workflow that compares web and native renders of a small Salam UI corpus. The overall approach is sensible for a currently-red baseline: it builds and caches a PR compiler, shards runs, treats per-test hangs as failures, and suppresses only failures listed in tools/ui-gate-known-failures.txt. The implementation is mostly sound, but there are a couple of concrete convention/verification gaps in the added Salam pages and in parts of the diff that cannot be fully reviewed.

What changed

  • Adds .github/workflows/ui-pr-gate.yml to detect relevant UI/page changes, build the compiler once from the PR (seeded from 0.6.3, cached on compiler/std/VERSION/build-script hashes), run sharded headless page/ui tests, and expose a final aggregate UI and pages gate job.
  • Adds tools/bash/ui-gate-run.sh and tools/ui-gate-known-failures.txt so the gate fails only on regressions not already present on main, with per-test and whole-run timeouts to contain hangs.
  • Adds .github/workflows/ui-look-check.yml, tools/bash/ui-look-check.sh, and three Salam pages under tools/ui-look/pages/ for a nightly/manual web-vs-native screenshot comparison.

Review

  • tools/ui-look/pages/cards.salam:1, tools/ui-look/pages/form.salam:1, tools/ui-look/pages/list.salam:1: these new Salam source files start with a block comment/license header and do not begin with // lang: en (or the Persian equivalent). If the repository convention requires every Salam source file to declare its language on the first line, please add the appropriate marker so the files follow the standard layout.
  • .github/workflows/ui-pr-gate.yml:74-79, .github/workflows/ui-look-check.yml:52-56: both workflows install/build dependencies but rely on prior steps or system state for some tools (e.g. Chrome is assumed present in the look-check job). That may be fine on ubuntu-24.04, but it is worth confirming the runner image guarantees; if not, install the missing dependencies explicitly to avoid flaky environment failures.
  • tools/bash/ui-look-check.sh (overall): deriving the native render program from SALAM_NATIVE_DUMP=1 output via text filtering/rewriting is a pragmatic workaround, but it is tightly coupled to compiler output shape. This is acceptable for a non-required nightly check, though it may need maintenance when compiler diagnostics or dump formatting change.

Tests

  • I did not run a build, tests, or workflows.
  • The PR description reports local baseline runs and notes the web half of the look check is unverified without Chrome in that environment; the first nightly/manual run will be important validation.

Risks

  • The diff for tools/bash/ui-look-check.sh and tools/ui-gate-known-failures.txt was truncated in the review input, so I could not verify the end of the comparison/reporting logic (including the claimed handling of compare errors) or inspect the full known-failure list.
  • Because the gate suppresses a large baseline (tools/ui-gate-known-failures.txt), correctness depends on that list staying accurate and shrinking as fixes land; regressions matching an existing entry would remain masked until the entry is removed.

⚠️ This review was written automatically by an AI and may contain mistakes. It is a helper for maintainers, not a replacement for a human review: check the code yourself before merging.

@vercel

vercel Bot commented Nov 16, 2026

Copy link
Copy Markdown

Deployment failed for project salam with the following error:

Resource is limited - try again in 1 day (more than 100, code: "api-deployments-free-per-day").

Learn More: https://vercel.com/salamlang?upgradeToPro=build-rate-limit

@vercel

vercel Bot commented Nov 16, 2026

Copy link
Copy Markdown

Deployment failed for project salam with the following error:

Resource is limited - try again in 24 hours (more than 100, code: "api-deployments-free-per-day").

Learn More: https://vercel.com/salamlang?upgradeToPro=build-rate-limit

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants