Repository navigation
Skip zig Ghostty helper builds in CI #2416
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| #!/usr/bin/env bash | ||
| # Regression test to keep CI macOS jobs from live-building the Ghostty helper. | ||
| set -euo pipefail | ||
|
|
||
| ROOT_DIR="$(cd "$(dirname "$0")/.." && pwd)" | ||
| WORKFLOW_FILE="$ROOT_DIR/.github/workflows/ci.yml" | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P2: This test validates CI behavior by grepping workflow YAML text ( Prompt for AI agents |
||
|
|
||
| check_job() { | ||
| local job_name="$1" | ||
| if ! awk -v job_name="$job_name" ' | ||
| $0 == " " job_name ":" { | ||
| in_job = 1 | ||
| next | ||
| } | ||
| in_job && $0 ~ /^ [^ ]/ { | ||
| exit found ? 0 : 1 | ||
| } | ||
| in_job && $0 ~ /CMUX_SKIP_ZIG_BUILD: 1/ { | ||
| found = 1 | ||
|
Comment on lines
+18
to
+19
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
This guard test only scans Useful? React with 👍 / 👎. |
||
| } | ||
| END { | ||
| if (!in_job || !found) { | ||
| exit 1 | ||
| } | ||
| } | ||
|
Comment on lines
+10
to
+25
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
cat >/tmp/ci_guard_false_positive.yml <<'YAML'
jobs:
tests:
runs-on: macos-latest
steps:
- run: echo "CMUX_SKIP_ZIG_BUILD: 1"
next-job:
runs-on: ubuntu-latest
YAML
echo "Current matcher (expected: fail, actual: passes -> bug):"
set +e
awk -v job_name="tests" '
$0 == " " job_name ":" { in_job = 1; next }
in_job && $0 ~ /^ [^ ]/ { exit found ? 0 : 1 }
in_job && $0 ~ /CMUX_SKIP_ZIG_BUILD: 1/ { found = 1 }
END { if (!in_job || !found) exit 1 }
' /tmp/ci_guard_false_positive.yml
echo "exit_code=$?"
set -eRepository: manaflow-ai/cmux Length of output: 128 🏁 Script executed: # Find the test file and examine it
fd "test_ci_skip_zig_build_guard.sh" -t fRepository: manaflow-ai/cmux Length of output: 97 🏁 Script executed: # If the file exists, read it
if [ -f "tests/test_ci_skip_zig_build_guard.sh" ]; then
wc -l "tests/test_ci_skip_zig_build_guard.sh"
echo "---"
cat -n "tests/test_ci_skip_zig_build_guard.sh"
else
echo "File not found"
fiRepository: manaflow-ai/cmux Length of output: 1163 🏁 Script executed: # List files in tests directory to understand the structure
ls -la tests/ 2>/dev/null || echo "tests directory not found"Repository: manaflow-ai/cmux Length of output: 8497 🏁 Script executed: # Find and check the CI workflow file
ls -la .github/workflows/ci.yml
wc -l .github/workflows/ci.ymlRepository: manaflow-ai/cmux Length of output: 163 🏁 Script executed: # Read the CI workflow file to understand the job structure
head -100 .github/workflows/ci.ymlRepository: manaflow-ai/cmux Length of output: 2991 🏁 Script executed: # Look specifically for the "tests" job and how env is structured
grep -A 30 "^ tests:" .github/workflows/ci.yml | head -40Repository: manaflow-ai/cmux Length of output: 1077 🏁 Script executed: # Check the other jobs mentioned in the test
grep -A 15 "^ tests-build-and-lag:" .github/workflows/ci.yml
echo "---"
grep -A 15 "^ ui-regressions:" .github/workflows/ci.ymlRepository: manaflow-ai/cmux Length of output: 1144 🏁 Script executed: # Now test the proposed fix pattern to ensure it correctly identifies env section
cat > /tmp/test_proposed_fix.sh <<'EOF'
#!/bin/bash
cat >/tmp/ci_test.yml <<'YAML'
jobs:
tests:
runs-on: macos-latest
env:
CMUX_SKIP_ZIG_BUILD: 1
steps:
- run: echo "CMUX_SKIP_ZIG_BUILD: 1"
tests-build-and-lag:
runs-on: macos-latest
env:
CMUX_SKIP_ZIG_BUILD: 1
steps:
- run: echo "something"
ui-regressions:
runs-on: macos-latest
env:
CMUX_SKIP_ZIG_BUILD: 1
steps:
- run: echo "something"
bad-job:
runs-on: macos-latest
steps:
- run: echo "CMUX_SKIP_ZIG_BUILD: 1"
YAML
# Test the proposed awk pattern for each job
for job in "tests" "tests-build-and-lag" "ui-regressions" "bad-job"; do
echo "Testing job: $job"
set +e
awk -v job_name="$job" '
$0 == " " job_name ":" {
in_job = 1
in_env = 0
found = 0
next
}
in_job && $0 ~ /^ [^ ]/ {
exit found ? 0 : 1
}
in_job && $0 ~ /^ env:[[:space:]]*$/ {
in_env = 1
next
}
in_job && in_env && $0 ~ /^ [^ ]/ {
in_env = 0
}
in_job && in_env && $0 ~ /^ CMUX_SKIP_ZIG_BUILD:[[:space:]]*"?1"?[[:space:]]*$/ {
found = 1
}
END {
if (!in_job || !found) {
exit 1
}
}
' /tmp/ci_test.yml
result=$?
echo "exit_code=$result"
set -e
echo ""
done
EOF
bash /tmp/test_proposed_fix.shRepository: manaflow-ai/cmux Length of output: 212 🏁 Script executed: # Test the CURRENT broken pattern to confirm it produces false positives
cat > /tmp/test_current_broken.sh <<'EOF'
#!/bin/bash
cat >/tmp/ci_test.yml <<'YAML'
jobs:
tests:
runs-on: macos-latest
env:
CMUX_SKIP_ZIG_BUILD: 1
steps:
- run: echo "CMUX_SKIP_ZIG_BUILD: 1"
tests-build-and-lag:
runs-on: macos-latest
env:
CMUX_SKIP_ZIG_BUILD: 1
steps:
- run: echo "something"
ui-regressions:
runs-on: macos-latest
env:
CMUX_SKIP_ZIG_BUILD: 1
steps:
- run: echo "something"
bad-job:
runs-on: macos-latest
steps:
- run: echo "CMUX_SKIP_ZIG_BUILD: 1"
YAML
# Test the CURRENT broken awk pattern for each job
for job in "tests" "tests-build-and-lag" "ui-regressions" "bad-job"; do
echo "Testing job: $job (CURRENT broken pattern)"
set +e
awk -v job_name="$job" '
$0 == " " job_name ":" { in_job = 1; next }
in_job && $0 ~ /^ [^ ]/ { exit found ? 0 : 1 }
in_job && $0 ~ /CMUX_SKIP_ZIG_BUILD: 1/ { found = 1 }
END { if (!in_job || !found) exit 1 }
' /tmp/ci_test.yml
result=$?
echo "exit_code=$result"
set -e
echo ""
done
EOF
bash /tmp/test_current_broken.shRepository: manaflow-ai/cmux Length of output: 312 Constrain the awk check to job-level The current matcher accepts The proposed fix constrains the pattern to match only within the 🔧 Proposed fix check_job() {
local job_name="$1"
if ! awk -v job_name="$job_name" '
$0 == " " job_name ":" {
in_job = 1
+ in_env = 0
+ found = 0
next
}
in_job && $0 ~ /^ [^ ]/ {
exit found ? 0 : 1
}
- in_job && $0 ~ /CMUX_SKIP_ZIG_BUILD: 1/ {
+ in_job && $0 ~ /^ env:[[:space:]]*$/ {
+ in_env = 1
+ next
+ }
+ in_job && in_env && $0 ~ /^ [^ ]/ {
+ in_env = 0
+ }
+ in_job && in_env && $0 ~ /^ CMUX_SKIP_ZIG_BUILD:[[:space:]]*"?1"?[[:space:]]*$/ {
found = 1
}
END {
if (!in_job || !found) {
exit 1🤖 Prompt for AI Agents |
||
| ' "$WORKFLOW_FILE"; then | ||
| echo "FAIL: $job_name in ci.yml must set CMUX_SKIP_ZIG_BUILD: 1" >&2 | ||
| exit 1 | ||
| fi | ||
| } | ||
|
|
||
| check_job "tests" | ||
| check_job "tests-build-and-lag" | ||
| check_job "ui-regressions" | ||
|
|
||
| echo "PASS: CI macOS jobs skip zig Ghostty helper builds" | ||
|
Comment on lines
+1
to
+36
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
This script opens That said, the repository already has several guard tests ( Context Used: CLAUDE.md (source) Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time! |
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Setting
CMUX_SKIP_ZIG_BUILD: 1at thetestsjob level also affects thexcodebuildinvocation insidetests/test_bundled_ghostty_theme_picker_helper.sh. Inscripts/build-ghostty-cli-helper.sh, that env path emits a stubbin/ghosttythat exits with failure, so the “bundled Ghostty theme picker helper regression” now only verifies executable presence of a stub and can no longer catch a broken runtime helper. This weakens an existing regression check and can let helper breakage pass CI unnoticed.Useful? React with 👍 / 👎.