Surface controller services left disabled by schedule_all_controllers#410
Merged
Merged
Conversation
When enabling, NiFi silently skips INVALID controller services, so schedule_all_controllers could report success while leaving services disabled. It now checks for any controller left in a non-ENABLED state after an enable and, by default, logs a warning naming them; with the new opt-in strict=True it raises ValueError instead. Default behaviour and return type are unchanged, and the disable path is untouched. Adds tests for the all-valid (no warning), default-warn, and strict-raise paths using the existing INVALID controller fixture.
pvillard31
approved these changes
Jul 9, 2026
pvillard31
left a comment
Contributor
There was a problem hiding this comment.
Clean, backward-compatible fix that turns a previously silent failure into an explicit warning (or an opt-in raise via strict=True), backed by focused tests covering the all-valid, warning, and strict paths.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #410 +/- ##
==========================================
+ Coverage 76.93% 76.97% +0.03%
==========================================
Files 41 41
Lines 4869 4877 +8
==========================================
+ Hits 3746 3754 +8
Misses 1123 1123 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Summary
When enabling, NiFi silently skips controller services that are INVALID (they cannot be enabled).
canvas.schedule_all_controllers(..., "ENABLED")waited only for VALID controllers and then returned the activation entity, so the call could report success while leaving one or more services disabled — with no error, warning, or signal to the caller. For automated upgrade/enable flows this makes a real failure state easy to miss.Change
schedule_all_controllers(pg_id, scheduled, strict=False):strict=Trueit raisesValueErrorinstead — giving automation a deterministic signal.ActivateControllerServicesEntity). The disable path is untouched.Tests
tests/test_canvas.py(single-user profile):strict=True, it raisesValueError.Uses the existing
StandardSSLContextServicefixture to produce a deterministic INVALID controller.Verified locally:
make test NIPYAPI_PROFILE=single-user PYTEST_ARGS="-k schedule_all_controllers"→ 3 passed;make lint→ flake8 clean, pylint 10.00/10.