Skip to content

fix: accept STATELESS_GROUP affected components and normalise port failures (1.8.1) - #420

Merged
Chaffelson merged 2 commits into
mainfrom
fix/1.8.1-stateless-group-port-failures
Oct 24, 2026
Merged

Chaffelson merged 2 commits into
mainfrom
fix/1.8.1-stateless-group-port-failures

Conversation

@Chaffelson

@Chaffelson Chaffelson commented Oct 24, 2026 •

Copy link
Copy Markdown
Owner

Summary

Patch release candidate for 1.8.1. Fixes #419 and fixes #418.

  • AffectedComponentEntity.reference_type rejects STATELESS_GROUP, breaking parameter provider fetch/apply on flows with stateless groups #419: AffectedComponentEntity.reference_type rejects STATELESS_GROUP. NiFi returns STATELESS_GROUP for components in stateless process groups. The NiFi 2.12.0 OpenAPI spec omits it from AffectedComponentEntity.referenceType, though AffectedComponentDTO has it. So fetching or applying a parameter provider on a flow with stateless groups raised ValueError while deserialising the response, before the apply was submitted.
    • Upstream: NIFI-16464, fixed by apache/nifi#11811 (merged to main, so in a future NiFi release).
    • Fix: restore the spec augmentation nifi_affected_component_reference_type.py, which mirrors the DTO enum into the entity, then make augment-openapi gen-clients against the committed 2.12.0 base spec.
    • The regeneration changes only nipyapi/nifi/models/affected_component_entity.py, by one line. The resulting values and order match the merged upstream annotation.
    • The augmentation is a no-op once the upstream spec has the value. Its docstring says to remove it at the regeneration that picks up NIFI-16464.
    • We chose this over generating from the upstream merge commit: main is a 2.13.0-SNAPSHOT that is 126 commits past 2.12.0, with new model fields and endpoints a 2.12 server doesn't have.
  • ci.verify_config returns port failures as strings; controller and processor failures are dicts #418: ci.verify_config port failures were plain strings. Port validation has returned port_results[*].failures as plain strings since it was introduced in 1.7.0, while controller and processor results use {"step", "explanation"} dicts. We are changing ports to the same shape ("step": "Port validation") for consistency, so callers can handle every result row the same way.
    • Impact is narrow. It only affects callers that read the individual port failure items, and only when a port is invalid. Checks on verified, failed_count or a row's success are unaffected, and valid ports still return failures: [].
    • No other nipyapi code reads port failures. Callers that parsed the strings should read explanation; this is noted in the history.

docs/history.rst has the dated 1.8.1 (2026-10-24) entry.

Test plan

  • make lint: 10.00/10. All pre-commit hooks pass (black, isort, flake8, pylint).
  • make augment-openapi gen-clients: regenerated diff is the single AffectedComponentEntity enum line.
  • New tests/test_generated_models.py::test_affected_component_accepts_stateless_group.
  • tests/test_ci.py::test_verify_config_with_invalid_port now asserts the failure shape.
  • make test NIPYAPI_PROFILE=single-user (NiFi 2.12.0): 777 passed, 33 skipped, 1 failed.
    • The failure, test_versioning.py::test_update_git_flow_ver_to_latest, passes when run alone. It is order-dependent in the GitHub-registry tests, and the versioning code is untouched.
  • CI matrix (single-user py3.9–3.12, LDAP, mTLS), CodeQL, codecov and the RTD preview are all green.

…ilures

* Add a spec augmentation that mirrors AffectedComponentDTO.referenceType's
  enum into AffectedComponentEntity, and regenerate. NiFi returns
  STATELESS_GROUP for components in stateless process groups, but the 2.12.0
  OpenAPI spec omits it from the entity (NIFI-16464, fixed upstream in
  apache/nifi#11811), so parameter provider fetch/apply raised ValueError on
  flows with stateless groups. Only affected_component_entity.py changes.
  Remove the augmentation when generating from a NiFi release with the fix.
* verify_config: return port failures as {"step", "explanation"} dicts, like
  controller and processor failures, instead of plain strings.

Fixes #419
Fixes #418
@codecov

codecov Bot commented Oct 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.30%. Comparing base (3743318) to head (63d8cf3).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #420      +/-   ##
==========================================
+ Coverage   78.27%   78.30%   +0.02%     
==========================================
  Files          41       41              
  Lines        5115     5116       +1     
==========================================
+ Hits         4004     4006       +2     
+ Misses       1111     1110       -1     

☔ View full report in Codecov by Harness.
📢 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.

@Chaffelson
Chaffelson merged commit 8969791 into main Oct 24, 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

1 participant