Repository navigation
ci(nightly): harden local cache fallback - #30130
teamleaderleo merged 0 commit into
Conversation
|
Review (codex gpt-6.1-sol xhigh, router-review): BLOCK at 89ce9b3 BLOCK at 89ce9b3 Visual verdict: no images; Leo tries the build
|
|
Review (subagent matcher_delta_review): SHIP at b900bb9.\n\nFollow-up delta retains remote service and cache plugin failure diagnostics while keeping the error-line filter. Targeted matcher and nightly retry tests pass. |
There was a problem hiding this comment.
3 issues found across 4 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="scripts/cmux-next/lib/compilation-cache.sh">
<violation number="1" location="scripts/cmux-next/lib/compilation-cache.sh:90">
P2: This matcher misses failures whose verb precedes the service name, such as `failed to connect to remote service` or `failed to send request to cache plugin`, so recoverable fleet-cache failures remain red instead of retrying locally. Match the failure forms on either side of `remote service` and `cache plugin`.</violation>
<violation number="2" location="scripts/cmux-next/lib/compilation-cache.sh:90">
P2: This predicate still treats arbitrary source-provided diagnostic text as a runtime cache failure: `#error("remote service unavailable")` triggers the local retry. Distinguish cache failures using a diagnostic/category that cannot be supplied by source code, or remove these ambiguous generic phrases from this predicate.</violation>
</file>
<file name="tests/test_ci_fleet_compilation_cache.py">
<violation number="1" location="tests/test_ci_fleet_compilation_cache.py:152">
P2: This regression test verifies a second build but not that the retry uses the local cache. Record each stub invocation's arguments and assert the first includes fleet settings while the retry omits them.</violation>
</file>
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
| [[ -f "$1" ]] || return 1 | ||
| local diag='^([^[:space:]]+: )?(fatal )?error: ' errors | ||
| errors="$(awk '/^xcodebuild exit status:/ { exit } { print }' "$1" | grep -E "$diag" || true)" | ||
| grep -Eqi 'CAS error encountered during|cannot (create|open) (the )?CAS|failed to (load .* from CAS|open .*CAS|replay cached diagnostics)|cannot create cache key for compilation|((compilation|remote) cache).*(error|failed|unavailable)|((remote service|cache plugin).*(error|failed|unavailable))' <<<"$errors" |
There was a problem hiding this comment.
P2: This matcher misses failures whose verb precedes the service name, such as failed to connect to remote service or failed to send request to cache plugin, so recoverable fleet-cache failures remain red instead of retrying locally. Match the failure forms on either side of remote service and cache plugin.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At scripts/cmux-next/lib/compilation-cache.sh, line 90:
<comment>This matcher misses failures whose verb precedes the service name, such as `failed to connect to remote service` or `failed to send request to cache plugin`, so recoverable fleet-cache failures remain red instead of retrying locally. Match the failure forms on either side of `remote service` and `cache plugin`.</comment>
<file context>
@@ -78,6 +78,18 @@ cmux_next_cas_failed() {
+ [[ -f "$1" ]] || return 1
+ local diag='^([^[:space:]]+: )?(fatal )?error: ' errors
+ errors="$(awk '/^xcodebuild exit status:/ { exit } { print }' "$1" | grep -E "$diag" || true)"
+ grep -Eqi 'CAS error encountered during|cannot (create|open) (the )?CAS|failed to (load .* from CAS|open .*CAS|replay cached diagnostics)|cannot create cache key for compilation|((compilation|remote) cache).*(error|failed|unavailable)|((remote service|cache plugin).*(error|failed|unavailable))' <<<"$errors"
+}
+
</file context>
| grep -Eqi 'CAS error encountered during|cannot (create|open) (the )?CAS|failed to (load .* from CAS|open .*CAS|replay cached diagnostics)|cannot create cache key for compilation|((compilation|remote) cache).*(error|failed|unavailable)|((remote service|cache plugin).*(error|failed|unavailable))' <<<"$errors" | |
| grep -Eqi 'CAS error encountered during|cannot (create|open) (the )?CAS|failed to (load .* from CAS|open .*CAS|replay cached diagnostics)|cannot create cache key for compilation|((compilation|remote) cache).*(error|failed|unavailable)|((remote service|cache plugin).*(error|failed|unavailable))|(failed|could not) .* (remote service|cache plugin)' <<<"$errors" |
| ): | ||
| result, count = self._run_nightly_release_stub(diagnostic) | ||
| self.assertEqual(result.returncode, 0, result.stderr) | ||
| self.assertEqual(count.read_text().strip(), "2") |
There was a problem hiding this comment.
P2: This regression test verifies a second build but not that the retry uses the local cache. Record each stub invocation's arguments and assert the first includes fleet settings while the retry omits them.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At tests/test_ci_fleet_compilation_cache.py, line 152:
<comment>This regression test verifies a second build but not that the retry uses the local cache. Record each stub invocation's arguments and assert the first includes fleet settings while the retry omits them.</comment>
<file context>
@@ -100,12 +104,64 @@ def test_nightly_xcode_command_receives_shared_settings(self):
+ ):
+ result, count = self._run_nightly_release_stub(diagnostic)
+ self.assertEqual(result.returncode, 0, result.stderr)
+ self.assertEqual(count.read_text().strip(), "2")
+
+ result, count = self._run_nightly_release_stub("error: use of unresolved identifier 'cas'")
</file context>
| [[ -f "$1" ]] || return 1 | ||
| local diag='^([^[:space:]]+: )?(fatal )?error: ' errors | ||
| errors="$(awk '/^xcodebuild exit status:/ { exit } { print }' "$1" | grep -E "$diag" || true)" | ||
| grep -Eqi 'CAS error encountered during|cannot (create|open) (the )?CAS|failed to (load .* from CAS|open .*CAS|replay cached diagnostics)|cannot create cache key for compilation|((compilation|remote) cache).*(error|failed|unavailable)|((remote service|cache plugin).*(error|failed|unavailable))' <<<"$errors" |
There was a problem hiding this comment.
P2: This predicate still treats arbitrary source-provided diagnostic text as a runtime cache failure: #error("remote service unavailable") triggers the local retry. Distinguish cache failures using a diagnostic/category that cannot be supplied by source code, or remove these ambiguous generic phrases from this predicate.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At scripts/cmux-next/lib/compilation-cache.sh, line 90:
<comment>This predicate still treats arbitrary source-provided diagnostic text as a runtime cache failure: `#error("remote service unavailable")` triggers the local retry. Distinguish cache failures using a diagnostic/category that cannot be supplied by source code, or remove these ambiguous generic phrases from this predicate.</comment>
<file context>
@@ -78,6 +78,18 @@ cmux_next_cas_failed() {
+ [[ -f "$1" ]] || return 1
+ local diag='^([^[:space:]]+: )?(fatal )?error: ' errors
+ errors="$(awk '/^xcodebuild exit status:/ { exit } { print }' "$1" | grep -E "$diag" || true)"
+ grep -Eqi 'CAS error encountered during|cannot (create|open) (the )?CAS|failed to (load .* from CAS|open .*CAS|replay cached diagnostics)|cannot create cache key for compilation|((compilation|remote) cache).*(error|failed|unavailable)|((remote service|cache plugin).*(error|failed|unavailable))' <<<"$errors"
+}
+
</file context>
b900bb9 to
c4daae1
Compare
Bugbot needs on-demand usage enabledBugbot uses usage-based billing for this team and requires on-demand usage to be enabled. A team admin can enable on-demand usage in the Cursor dashboard. |
154bac7 to
c4daae1
Compare
The nightly Release fallback now retries only when compiler diagnostics identify a real CAS or compilation-cache failure. Successful cache setup output and unrelated compiler errors no longer trigger a second build. The local retry also omits an empty settings array safely under macOS Bash 3.2 with
set -u.Leo said, “it feels like you guys always forget about incremental builds and the external SSDs.” This follow-up keeps the warm local cache available while avoiding a false green from retrying an ordinary compile failure.
This branch is stacked on #30107 (
ci(nightly): retry local cache after fleet CAS failure) and should land after that PR. Runtime regression coverage exercises both a CAS failure that retries and an unrelated compiler error that remains red.Validation:
python3 -m unittest tests/test_ci_fleet_compilation_cache.py(8 tests)git diff --checkAgent session: agent session
🤖 Generated with Claude Code