You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by GitBox <gi...@apache.org> on 2022/09/14 23:58:51 UTC

[GitHub] [nifi] emiliosetiadarma opened a new pull request, #6420: NIFI-10240: Implemented checking of property dependencies in ProcessC…

emiliosetiadarma opened a new pull request, #6420:
URL: https://github.com/apache/nifi/pull/6420

   …ontext and ValidationContext, properties with an unsatisfied dependency will be ignored. Implemented system tests to test this new feature
   
   - If a processor attempts to obtain the property of a value from the `ProcessContext` that is missing a dependency during runtime, it should return `null`
   - If a processor attempts to obtain the property of a value that is missing a dependency during validation, it should return `null`
   - These 'ignored' properties that are missing dependencies still persist in the flow configuration
   
   <!-- 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-10240](https://issues.apache.org/jira/browse/NIFI-10240)
   
   # 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 8
     - [x] JDK 11
     - [x] JDK 17
   
   ### Licensing
   
   - [ ] 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)
   - [ ] New dependencies are documented in applicable `LICENSE` and `NOTICE` files
   
   ### Documentation
   
   - [ ] 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


[GitHub] [nifi] emiliosetiadarma commented on pull request #6420: NIFI-10240: Implemented checking of property dependencies in ProcessC…

Posted by GitBox <gi...@apache.org>.
emiliosetiadarma commented on PR #6420:
URL: https://github.com/apache/nifi/pull/6420#issuecomment-1253951056

   Hey @markap14, thanks for the comments. Will spin this off into another Jira and make a ListenSyslog specific change for this issue! I think I can make changes to make sure that calling getProperty will return null with the use of `isDependencySatisfied`. Will close this PR and spin this off to another


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


[GitHub] [nifi] emiliosetiadarma closed pull request #6420: NIFI-10240: Implemented checking of property dependencies in ProcessC…

Posted by GitBox <gi...@apache.org>.
emiliosetiadarma closed pull request #6420: NIFI-10240: Implemented checking of property dependencies in ProcessC…
URL: https://github.com/apache/nifi/pull/6420


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


[GitHub] [nifi] markap14 commented on pull request #6420: NIFI-10240: Implemented checking of property dependencies in ProcessC…

Posted by GitBox <gi...@apache.org>.
markap14 commented on PR #6420:
URL: https://github.com/apache/nifi/pull/6420#issuecomment-1251568321

   @emiliosetiadarma I think we need to be careful here. This is updating the API, but I'm not sure this is the right abstraction.
   The `resolveIrrelevantProperties` is a bit of a leaky abstraction. It's not clear when and where this should be called. The lifecycle doesn't really fit. Additionally, I don't think the `containsCyclicDependencies` is really necessary here, at least in this context.
   The framework already has the logic to avoid performing validation against properties that are not used (see https://github.com/apache/nifi/blob/main/nifi-api/src/main/java/org/apache/nifi/components/AbstractConfigurableComponent.java#L99-L102).
   
   The problem here is a bug in the ListenSyslog Processor. It is specifically checking this:
   ```
           final String protocol = validationContext.getProperty(PROTOCOL).getValue();
           final SSLContextService sslContextService = validationContext.getProperty(SSL_CONTEXT_SERVICE).asControllerService(SSLContextService.class);
   
           if (UDP_VALUE.getValue().equals(protocol) && sslContextService != null) {
               results.add(new ValidationResult.Builder()
                       .explanation("SSL can not be used with UDP")
                       .valid(false).subject("SSL Context").build());
           }
   ```
   This made sense when it was written, as there was no ability to make one property depend on another. However, later the SSLContext Service property became dependent on the protocol property. When this happened, this whole block of code should have been removed.
   
   I do think it's reasonable to update the code such that calling `getProperty(...)` will return a `PropertyValue` with a `null` value if the dependency is not satisfied. However, I think we can do this more simply by making use of the `isDependencySatisfied` method as illustrated  above in AbstractConfigurableComponent. I also think it should be addressed as a separate Jira, as this Jira is really pointing out a bug that is specific to ListenSyslog.


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


[GitHub] [nifi] markap14 commented on pull request #6420: NIFI-10240: Implemented checking of property dependencies in ProcessC…

Posted by GitBox <gi...@apache.org>.
markap14 commented on PR #6420:
URL: https://github.com/apache/nifi/pull/6420#issuecomment-1251534828

   Will Review


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