Fix apply: warnings must not mark a clean apply as failed#1565
Open
lileding wants to merge 1 commit into
Open
Conversation
apply_plan computed `ok = not diagnostics and ...`, which treats ANY diagnostic -- including warning-severity ones -- as failure. On hosts without bmake the local oracle profile emits a single W_APPLY_ORACLE_SKIPPED warning, so every dops-mode port's apply was reported as failed (ok=False) even though all ops applied cleanly with zero errors. compose then surfaced this as `E_COMPOSE_APPLY_FAILED: 0 op(s) failed [no per-op detail]`. Only error-severity diagnostics (or a failed op) should mark apply as failed. Real oracle failures (E_APPLY_ORACLE_FAILED) and CI unavailability keep yielding ok=False. Add a regression test for the warning-only oracle-skip case. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
composereportsE_COMPOSE_APPLY_FAILED: <origin>: 0 op(s) failed [no per-op detail]for every dops-mode port, even though all ops apply cleanly (applied_ops == total_ops,errors == 0) and the generated output is correct.Root cause
apply_plan(scripts/generator/dportsv3/engine/apply.py) computed:not diagnosticsrequires the diagnostics list to be completely empty, but warning-severity diagnostics live in that same list. On a host withoutbmake, the defaultlocaloracle profile emits a single warningW_APPLY_ORACLE_SKIPPED("bmake not found in PATH"). That lone warning flipsoktoFalse, so compose reports the apply as failed — with zero failed ops and zero errors, hence the self-contradictory "0 op(s) failed" message.This is not specific to any one port: it affects every dops-mode port on any host where the oracle emits a warning (e.g.
bmakeabsent). It went unnoticed because the apply test-suite runs withoracle_profile="off", which never populates diagnostics.Fix
Only error-severity diagnostics (or a genuinely failed op) mark the apply as failed:
Warnings are still recorded and surfaced; they just no longer masquerade as failures. Real oracle failures (
E_APPLY_ORACLE_FAILED) and CI-profile unavailability (E_APPLY_ORACLE_UNAVAILABLE) remain error-severity and still yieldok=False.Test
Adds
test_apply_plan_local_unavailable_oracle_warning_keeps_ok: a clean apply whose only diagnostic is a warning-severity oracle skip must keepok=True, with the warning still present. Verified red-before / green-after.🤖 Generated with Claude Code