fix: reject incompatible default_value types for numeric/bool gizmo knobs#82
Merged
Merged
Conversation
ec0e27a to
6f9dde5
Compare
There was a problem hiding this comment.
Pull request overview
This PR addresses Nuke .gizmo generation failures caused by emitting invalid default-value lines for numeric/bool knobs (notably when workflow params have default_value=""), by filtering defaults based on type and adding regression tests around the behavior.
Changes:
- Add type-guards in
NukeGizmoBuilder._write_input_knobso only correctly-typed defaults are written forbool/float/intknobs. - Add unit tests covering empty-string defaults,
Nonedefaults, valid defaults, and mismatched default types for numeric/bool knobs.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
publish_gizmo/nuke_gizmo_builder.py |
Adds type checks before emitting defaults for bool/float/int knobs to prevent malformed gizmo output. |
tests/unit/test_nuke_gizmo_builder.py |
Introduces regression tests to ensure invalid defaults don’t emit value lines and valid defaults remain preserved. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Closes #77. Dynamically added parameters on Nuke Start/End Flow nodes have default_value="" which is invalid for int/float/bool knobs. Passing this to add_int_knob etc. wrote an empty default line that broke Nuke's TCL parser. Guard each knob branch with isinstance so only correctly-typed defaults are emitted. Mismatched types (including empty strings) are silently dropped.
6f9dde5 to
e32b381
Compare
collindutter
approved these changes
Jun 17, 2026
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.
Closes #77.
Dynamically added parameters on Nuke Start/End Flow nodes have default_value="" which is invalid for int/float/bool knobs. Passing this to add_int_knob etc. wrote an empty default line that broke Nuke's TCL parser.
Guard each knob branch with isinstance so only correctly-typed defaults are emitted. Mismatched types (including empty strings) are silently dropped.