Skip to content

Fix/14 inspector exception handling#44

Merged
AK11105 merged 2 commits into
mainfrom
fix/14-inspector-exception-handling
May 18, 2026
Merged

Fix/14 inspector exception handling#44
AK11105 merged 2 commits into
mainfrom
fix/14-inspector-exception-handling

Conversation

@AK11105
Copy link
Copy Markdown
Owner

@AK11105 AK11105 commented May 18, 2026

Summary

Fix inspector subprocess crashing on any unhandled exception and killing the entire deploy command.

Changes

  • Wrapped the pickle-based inspection path in a top-level try/except inside _INSPECT_SCRIPT — on failure emits degraded metadata (
    framework="unknown") instead of a non-zero exit
  • inspect_artifact() now issues warnings.warn when partial metadata is returned, rather than raising ValueError

Type

  • Bug fix

Testing

  • pytest passes (5 inspector tests pass)
  • Coverage ≥ 70% (pre-existing project-wide threshold issue, unrelated)
  • Tested manually — verified corrupt .pkl returns degraded metadata with warning instead of crashing

Related Issues

Closes #14

AK11105 added 2 commits May 18, 2026 20:19
Wrap the pickle inspection path in a top-level try/except so any
unhandled exception (corrupt file, missing dependency, bad pickle)
emits degraded metadata with framework=unknown rather than crashing
the subprocess and killing the deploy command.

inspect_artifact() now issues a warnings.warn when partial metadata is
returned, allowing the deploy flow to continue.

Closes #14
test_inspect_invalid_file previously asserted ValueError was raised on
a corrupt pickle. Updated to assert the new contract: degraded metadata
with framework=unknown and a warnings.warn instead of an exception.
@AK11105 AK11105 requested a review from atkaridarshan04 May 18, 2026 15:05
@atkaridarshan04 atkaridarshan04 added the bug Something isn't working label May 18, 2026
Copy link
Copy Markdown
Collaborator

@atkaridarshan04 atkaridarshan04 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Approveed

@atkaridarshan04 atkaridarshan04 added this to the v1 milestone May 18, 2026
@AK11105 AK11105 merged commit 8ac4708 into main May 18, 2026
8 checks passed
@AK11105 AK11105 deleted the fix/14-inspector-exception-handling branch May 18, 2026 17:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Inspector exits non-zero and discards all metadata on any exception

2 participants