Skip to content

Conversation

@Chaffelson
Copy link
Owner

@Chaffelson Chaffelson commented Jan 25, 2026

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
  • 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.

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
Copy link

codecov bot commented Jan 25, 2026

Codecov Report

❌ Patch coverage is 96.42857% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 76.81%. Comparing base (811aa9c) to head (efbbbad).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
nipyapi/cli.py 33.33% 2 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

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_config helpers to discover valid static keys and validate DTO property updates.
  • Enhance update_controller with an auto_disable flow (disable → update → restore) and recovery on update failure.
  • Extend prepare_parameter_with_asset to 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
@Chaffelson Chaffelson merged commit 54c8d74 into main Jan 25, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants