feat: add Processor and Controller Service Property helpers#405
Merged
Chaffelson merged 5 commits intomainfrom Jan 25, 2026
Merged
feat: add Processor and Controller Service Property helpers#405Chaffelson merged 5 commits intomainfrom
Chaffelson merged 5 commits intomainfrom
Conversation
Add validation helpers to prevent accidental dynamic property creation when configuring processors and controller services. NiFi silently accepts any property name and creates dynamic properties for unknown keys, which can cause hard-to-debug issues. New functions: - prepare_processor_config: Discover valid property keys or prepare a validated ProcessorConfigDTO - prepare_controller_config: Same for controller services Enhancements: - update_controller: Add auto_disable parameter to automatically disable/re-enable during updates, with error recovery - cli: Disable pager for --help output to prevent agent hangs
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #405 +/- ##
==========================================
+ Coverage 76.56% 76.81% +0.24%
==========================================
Files 41 41
Lines 4780 4831 +51
==========================================
+ Hits 3660 3711 +51
Misses 1120 1120 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Add `assets` parameter to accept a list of asset dicts, enabling linking multiple assets to a single parameter (e.g., JMS client JARs). Maintains backward compatibility with existing single-asset usage.
Cover the except block when both the update fails and the attempt to re-enable the controller also fails.
- Move urllib3 import to module level with other imports - Replace conditional PAGER check with os.environ.setdefault() to eliminate branch coverage issue while preserving behavior
There was a problem hiding this comment.
Pull request overview
Adds configuration/validation helpers to reduce accidental dynamic-property creation in NiFi component updates, and extends parameter asset handling to support multiple referenced assets.
Changes:
- Add
prepare_processor_config/prepare_controller_confighelpers to discover valid static keys and validate DTO property updates. - Enhance
update_controllerwith anauto_disableflow (disable → update → restore) and recovery on update failure. - Extend
prepare_parameter_with_assetto support multiple assets with validation; add related test coverage and adjust CLI pager behavior.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
nipyapi/canvas.py |
Adds config preparation/validation helpers and update_controller(auto_disable=...) logic. |
nipyapi/parameters.py |
Extends parameter asset references to support multiple assets and validates argument combinations. |
nipyapi/cli.py |
Sets a default PAGER to avoid interactive paging behavior. |
tests/test_canvas.py |
Adds tests for new config helpers and controller auto-disable behavior, plus property value semantics. |
tests/test_parameters.py |
Adds tests for multi-asset parameters and validation errors. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Only set PAGER=cat when help is requested or in non-interactive/CI mode - Use sorted() for deterministic error messages in property validation - Improve docstring accuracy for optional parameters in prepare_parameter_with_asset
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.
Add validation helpers to prevent accidental dynamic property creation when configuring processors and controller services. NiFi silently accepts any property name and creates dynamic properties for unknown keys, which can cause hard-to-debug issues.
New functions:
Enhancements:
assetsparameter to accept a list of asset dicts, enabling linking multiple assets to a single parameter (e.g., JMS client JARs). Maintains backward compatibility with existing single-asset usage.