You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "EndzeitBegins (via GitHub)" <gi...@apache.org> on 2025/04/06 13:46:53 UTC
[PR] NIFI-14436 TestRunner ensures properties with unsatisfied dependencies are not used [nifi]
EndzeitBegins opened a new pull request, #9851:
URL: https://github.com/apache/nifi/pull/9851
<!-- Licensed to the Apache Software Foundation (ASF) under one or more -->
<!-- contributor license agreements. See the NOTICE file distributed with -->
<!-- this work for additional information regarding copyright ownership. -->
<!-- The ASF licenses this file to You under the Apache License, Version 2.0 -->
<!-- (the "License"); you may not use this file except in compliance with -->
<!-- the License. You may obtain a copy of the License at -->
<!-- http://www.apache.org/licenses/LICENSE-2.0 -->
<!-- Unless required by applicable law or agreed to in writing, software -->
<!-- distributed under the License is distributed on an "AS IS" BASIS, -->
<!-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -->
<!-- See the License for the specific language governing permissions and -->
<!-- limitations under the License. -->
# Summary
[NIFI-14436](https://issues.apache.org/jira/browse/NIFI-14436)
Adjusts the `TestRunner` to ensure properties whose dependencies are not satisfied are not used. See [NIFI-14400](https://issues.apache.org/jira/browse/NIFI-14400) for more background on the motivation behind this change.
The added behaviour is opt-out using `runner.setProhibitUseOfPropertiesWithUnsatisfiedDependencies(false)`. There are several existing components which do not conform to the new check. These are to be addressed in separate PRs under NIFI-14437 or a sub-task thereof.
# Tracking
Please complete the following tracking steps prior to pull request creation.
### Issue Tracking
- [x] [Apache NiFi Jira](https://issues.apache.org/jira/browse/NIFI) issue created
### Pull Request Tracking
- [x] Pull Request title starts with Apache NiFi Jira issue number, such as `NIFI-00000`
- [x] Pull Request commit message starts with Apache NiFi Jira issue number, as such `NIFI-00000`
### Pull Request Formatting
- [x] Pull Request based on current revision of the `main` branch
- [x] Pull Request refers to a feature branch with one commit containing changes
# Verification
Please indicate the verification steps performed prior to pull request creation.
### Build
- [x] Build completed using `mvn clean install -P contrib-check`
- [x] JDK 21
### Licensing
- [x] New dependencies are compatible with the [Apache License 2.0](https://apache.org/licenses/LICENSE-2.0) according to the [License Policy](https://www.apache.org/legal/resolved.html)
- [x] New dependencies are documented in applicable `LICENSE` and `NOTICE` files
### Documentation
- [x] Documentation formatting appears as expected in rendered files
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] NIFI-14436 TestRunner ensures properties with unsatisfied dependencies are not used [nifi]
Posted by "pvillard31 (via GitHub)" <gi...@apache.org>.
pvillard31 commented on PR #9851:
URL: https://github.com/apache/nifi/pull/9851#issuecomment-2789011371
Thanks for this amazing work @EndzeitBegins - I will definitely spend time reviewing asap after I'm done with some other tasks.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] NIFI-14436 TestRunner ensures properties with unsatisfied dependencies are not used [nifi]
Posted by "exceptionfactory (via GitHub)" <gi...@apache.org>.
exceptionfactory merged PR #9851:
URL: https://github.com/apache/nifi/pull/9851
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] NIFI-14436 TestRunner ensures properties with unsatisfied dependencies are not used [nifi]
Posted by "EndzeitBegins (via GitHub)" <gi...@apache.org>.
EndzeitBegins commented on PR #9851:
URL: https://github.com/apache/nifi/pull/9851#issuecomment-2783661641
Alright. Then I'll continuously append commits addressing the different components to this PR instead.
That way, changes should still be relatively easy to track while all work is kept under a single PR and may be squashed before merge if desired.
Sounds good to both of you @pvillard31 & @exceptionfactory?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] NIFI-14436 TestRunner ensures properties with unsatisfied dependencies are not used [nifi]
Posted by "exceptionfactory (via GitHub)" <gi...@apache.org>.
exceptionfactory commented on PR #9851:
URL: https://github.com/apache/nifi/pull/9851#issuecomment-2783796368
> Alright. Then I'll continuously append commits addressing the different components to this PR instead. In the meantime I'll mark the PR as draft.
>
> That way, changes should still be relatively easy to track while all work is kept under a single PR and may be squashed before merge if desired. Sounds good to both of you @pvillard31 & @exceptionfactory?
That sounds like a good plan, thanks @EndzeitBegins!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] NIFI-14436 TestRunner ensures properties with unsatisfied dependencies are not used [nifi]
Posted by "EndzeitBegins (via GitHub)" <gi...@apache.org>.
EndzeitBegins commented on PR #9851:
URL: https://github.com/apache/nifi/pull/9851#issuecomment-2788961248
I refactored all components where the added check failed and removed the opt-out functionality.
Most changes were straightforward, primarily involving conditional property checks or adjustments to the execution path. In rare instances, tests revealed that the processor relied on a specific property (or its default value) even when the dependency constraint was unmet. In these cases, I removed the constraint entirely.
I have rebased these changes onto the latest `main` branch to resolve merge conflicts. While system tests encountered issues yesterday due to changes merged into `main`, a subsequent rebase appears to have resolved these problems.
I'd appreciate it if you could take a look, @pvillard31 & @exceptionfactory.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] NIFI-14436 TestRunner ensures properties with unsatisfied dependencies are not used [nifi]
Posted by "pvillard31 (via GitHub)" <gi...@apache.org>.
pvillard31 commented on PR #9851:
URL: https://github.com/apache/nifi/pull/9851#issuecomment-2782805925
Hey @EndzeitBegins - thanks for putting this together!
While I understand the multi steps approach, I feel like we should not even allow the option to opt-out. I looked at some of the cases where the problem is exhibited and in those cases it would not trigger a bug (ie. we do try to get the value of the property even if the dependency is not satisfied but we later check the dependency or if the returned value is null), it's more about having a better code structure.
I'm happy to collaborate with you to fix the places where we have the failure if you'd like to divide and conquer. Let me know.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] NIFI-14436 TestRunner ensures properties with unsatisfied dependencies are not used [nifi]
Posted by "EndzeitBegins (via GitHub)" <gi...@apache.org>.
EndzeitBegins commented on PR #9851:
URL: https://github.com/apache/nifi/pull/9851#issuecomment-2782923557
Thank you for the fast feedback @pvillard31!
Yes, most places I've looked at can be resolved relatively easy with some changes in code structure.
Actually, I started incorporating some refactoring initially, but looking at the amount of places where such code structure changes were needed, I assumed it would be best to split up the work into multiple Jira tickets / PRs.
That way, the places that need refactoring are relatively easy to track and its less hard to keep track of the changes.
The opt-out possibility I just deemed an additional benefits in regards of easing migrations for component developers. However, if you're not in favour of it, with your help we most likely can tackle the refactoring needed before the next release so that the opt-out option never ships to any component developer.
Nonetheless, I would prefer to distinguish between introducing the check and refactoring of the components. Having the check in place would also allow to split up work on separate parts of the code base more easily, without interfering each other.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org