Repository navigation
fix(compose): guard non-mapping service field in extension manifests - #5953
Closed
vaibhavsrv wants to merge 1 commit into
Closed
vaibhavsrv wants to merge 1 commit into
vaibhavsrv wants to merge 1 commit into
Conversation
This was referenced Sep 20, 2026
Collaborator
|
Thanks for this contribution. |
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.
Fixes #5712
Why this matters
In
ods/scripts/resolve-compose-stack.sh, both built-in extension discovery and user extension (data/user-extensions/) discovery evaluate extension manifests for GPU backend compatibility and compose fragment paths. In both loops,serviceis retrieved viamanifest.get("service", {})followed immediately byservice.get("gpu_backends", ...).If an extension manifest contains a scalar or list value for
service:(such asservice: "oops"or hand-edited / corrupted backup restoration),manifest.get("service")returns the non-dict object. Whenservice.get(...)is evaluated, Python raises an uncaughtAttributeError: 'str' object has no attribute 'get'. Because the--skip-brokenhandler only classifies YAML/JSON syntax errors,KeyError, andTypeErroras recoverable,AttributeErrorpropagates unhandled and causes the resolver to crash on every CLI invocation, bricking commands likeods status,ods start, etc.This change explicitly guards
serviceto verifyisinstance(service, dict)before dereferencing child properties in both loops. Whenserviceis not a mapping, a warning is printed to stderr and the invalid extension is skipped without crashing the stack resolver.Validation
service: "oops"causedresolve-compose-stack.shto crash withAttributeError: 'str' object has no attribute 'get'with exit code 1 even when--skip-brokenwas specified.ods/tests/test_resolve_compose_service_mapping.pyverifies that both scalar strings and list structures forservice:emit a non-fatal warning to stderr and allow stack resolution to complete successfully with exit code 0.test_resolve_compose_service_mapping.pyandtest-resolve-compose-resilient.shpass cleanly. Wired into Linux CI workflow under the compose resolution test step.Overlap check
--skip-broken.resolve-compose-stack.sh.Risk / AI disclosure
AI-assisted investigation, implementation, and test regressions. This strengthens defensive schema validation on parsed extension manifests to prevent unhandled Python exceptions. Independent human review and platform/runtime qualification remain gates. No running configuration, deployment or upstream merge changed.
Follow-up integration evidence
Composed with #5871, #5951, and #5952 at HEAD without conflicts. Production and test diffs passed together; resolver and compose contracts remain intact.
Backlog composition was local-only (production/test diffs, excluding workflow/Makefile wiring); it is not an upstream merge or independent human approval. Declared live-review gates remain open.