Repository navigation
ci: skip the Mac wrapper and remote-daemon lanes for ci.yml routing edits #14145
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 |
|---|---|---|
|
|
@@ -145,13 +145,20 @@ jobs: | |
| fi | ||
| # Keep both sides of renames visible to path-based guard routing. | ||
| # A guarded file moved into docs/ must still run its owning checks. | ||
| rm -f /tmp/cmux-ci-base-workflow.yml | ||
| if ! git diff --no-renames --name-only "$BASE_SHA" "$MERGE_SHA" > /tmp/cmux-ci-changed-files.txt; then | ||
| # Absence means unavailable; an existing empty file means a known empty diff. | ||
| rm -f /tmp/cmux-ci-changed-files.txt | ||
| echo "Could not compute PR diff; running all CI areas." >&2 | ||
| emit_all_areas | ||
| exit 0 | ||
| fi | ||
| # The standalone route compares ci.yml job by job with this base. | ||
| # Absence means unavailable, and that step then fails open. | ||
| if grep -Fxq '.github/workflows/ci.yml' /tmp/cmux-ci-changed-files.txt; then | ||
| git show "$BASE_SHA:.github/workflows/ci.yml" > /tmp/cmux-ci-base-workflow.yml \ | ||
| || rm -f /tmp/cmux-ci-base-workflow.yml | ||
| fi | ||
| # The changed lines of cmuxTests/, so choose_ci_suite.py can tell | ||
| # which declarations a test edit touched. Absent reads as "every | ||
| # line of each changed file". | ||
|
|
@@ -426,15 +433,15 @@ jobs: | |
| browser=false | ||
| remote_daemon=false | ||
| remote_daemon_native=false | ||
| ci_workflow_changed=false | ||
| if [ -f /tmp/cmux-ci-changed-files.txt ]; then | ||
| while IFS= read -r path; do | ||
| case "$path" in | ||
| .github/workflows/ci.yml) | ||
| claude_wrapper=true | ||
| # The caller owns both reusable jobs' conditions and targets. | ||
| # The caller owns the browser job's condition and target; | ||
| # that lane runs on Linux. The Mac lanes are judged below. | ||
| browser=true | ||
| remote_daemon=true | ||
| remote_daemon_native=true | ||
| ci_workflow_changed=true | ||
| ;; | ||
| Resources/bin/cmux-claude-wrapper|tests/test_claude_wrapper_hooks.py|tests/node_runtime.py|scripts/ci/run_python_test_lane.py|scripts/ci/test_execution_registry.py) | ||
| # Not tests/test-execution.toml: every new test registers | ||
|
|
@@ -461,6 +468,65 @@ jobs: | |
| remote_daemon=true | ||
| remote_daemon_native=true | ||
| fi | ||
| # ci.yml runs the wrapper lane inline and calls remote-daemon.yml with | ||
| # its native_tests input. Only an edit to that job, or to the | ||
| # triggers, env and permissions before `jobs:`, changes what a Mac | ||
| # lane runs. Edits to the routing, status and Linux jobs decide only | ||
| # whether it runs, which the Linux guard tests already check. A | ||
| # missing or unreadable base, a duplicate job, or a YAML alias in the | ||
| # lane's job selects both lanes. | ||
| if [ "$ci_workflow_changed" = true ]; then | ||
| if python3 - /tmp/cmux-ci-base-workflow.yml .github/workflows/ci.yml \ | ||
| > /tmp/cmux-ci-standalone-callers.txt <<'PY' | ||
| import re | ||
| import sys | ||
|
|
||
| def jobs(path: str) -> tuple[str, dict[str, str]]: | ||
| text = open(path, encoding="utf-8").read() | ||
| preamble, marker, body = text.partition("\njobs:\n") | ||
| if not marker: | ||
| raise SystemExit(1) | ||
| blocks: dict[str, str] = {} | ||
| for block in re.split(r"(?m)^ (?=[A-Za-z0-9_-]+:\s*$)", body): | ||
| name = block.partition(":")[0] | ||
| if not block.strip(): | ||
| continue | ||
| if name in blocks: | ||
| raise SystemExit(1) | ||
| blocks[name] = block | ||
| return preamble, blocks | ||
|
|
||
| (base_preamble, base_jobs), (head_preamble, head_jobs) = jobs(sys.argv[1]), jobs(sys.argv[2]) | ||
| alias = re.compile(r"(?m)(?:<<:|[:-])\s*\*[A-Za-z0-9_.-]+\s*$") | ||
|
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. 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win Recognize aliases followed by YAML comments. The end-of-line pattern does not match a valid alias such as 🤖 Prompt for AI Agents |
||
| for job in ("claude-wrapper", "remote-daemon"): | ||
| base_block, head_block = base_jobs.get(job, ""), head_jobs.get(job, "") | ||
| if ( | ||
| base_preamble != head_preamble | ||
| or base_block != head_block | ||
| or alias.search(base_block) | ||
| or alias.search(head_block) | ||
| ): | ||
| print(job) | ||
| PY | ||
| then | ||
| callers="$(tr '\n' ' ' < /tmp/cmux-ci-standalone-callers.txt)" | ||
| echo "ci.yml changed; Mac lane callers that differ: ${callers:-none}" | ||
| case " $callers " in | ||
| *" claude-wrapper "*) claude_wrapper=true ;; | ||
| esac | ||
| case " $callers " in | ||
| *" remote-daemon "*) | ||
| remote_daemon=true | ||
| remote_daemon_native=true | ||
| ;; | ||
| esac | ||
| else | ||
| echo "Could not compare ci.yml with its base; running the Mac standalone lanes." | ||
| claude_wrapper=true | ||
| remote_daemon=true | ||
| remote_daemon_native=true | ||
| fi | ||
| fi | ||
| { | ||
| echo "claude_wrapper=$claude_wrapper" | ||
| echo "browser=$browser" | ||
|
|
||
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.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
Repository: manaflow-ai/cmux
Length of output: 3369
🏁 Script executed:
Repository: manaflow-ai/cmux
Length of output: 19395
Compare post-
jobs:workflow settings separately from job blocks.A valid top-level setting after the
jobsmapping is absorbed into the final parsed block. In this workflow, that block isclaude-wrapper, so the parser selects only that Mac lane. Theremote-daemonlane can remain unselected even though the setting applies to the whole workflow.Parse top-level keys after
jobs:separately, then compare them with the preamble and both Mac job blocks.🤖 Prompt for AI Agents