[jira] [Commented] (NIFI-716) Framework allows you to define two properties with the same name

2015-06-23 Thread Aldrin Piri (JIRA)

[ 
https://issues.apache.org/jira/browse/NIFI-716?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14597736#comment-14597736
 ] 

Aldrin Piri commented on NIFI-716:
--

Certainly seems like this would not infringe on any wanted experience/desired 
behavior.  One point of consideration that comes to mind is the interaction 
between defined/dynamic properties and how they interrelate.  Not sure 
where/when the check would be applied but could potentially see some conflicts.

 Framework allows you to define two properties with the same name
 

 Key: NIFI-716
 URL: https://issues.apache.org/jira/browse/NIFI-716
 Project: Apache NiFi
  Issue Type: Bug
  Components: Core Framework
Affects Versions: 0.1.0
Reporter: Dan Bress
Priority: Minor
  Labels: beginner, newbie

 If you are lazy and copy and paste a PropertyDescriptor and forget to change 
 the value assigned to name(), the framework(test or regular) does not detect 
 this and proceeds happily.
 It would be great if this situation was detected as soon as possible, and 
 either mark the processor as invalid, or fail to consider it as a possible 
 processor.
 Example
 {code}
 public static final PropertyDescriptor MIN_SIZE = new 
 PropertyDescriptor.Builder()
 .name(Minimum Group Size)
 .description(The minimum size of for the bundle)
 .required(true)
 .defaultValue(0 B)
 .addValidator(StandardValidators.DATA_SIZE_VALIDATOR)
 .build();
 public static final PropertyDescriptor MAX_SIZE = new 
 PropertyDescriptor.Builder()
 .name(Minimum Group Size)
 .description(The maximum size for the bundle. If not specified, there is no 
 maximum.)
 .required(false)
 .addValidator(StandardValidators.DATA_SIZE_VALIDATOR)
 .build();
 {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (NIFI-716) Framework allows you to define two properties with the same name

2015-06-23 Thread Dan Bress (JIRA)

[ 
https://issues.apache.org/jira/browse/NIFI-716?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14597757#comment-14597757
 ] 

Dan Bress commented on NIFI-716:


Mark,
  +1 on catching this as soon as possible(like in the test runner)

   I agree with your thinking about making it invalid, the only reason I was 
iffy on this was because this is a situation where a component is invalid, and 
you (as a user) cannot do anything to make it valid.  But hopefully this type 
of bug would never get past a developer and to a user.

   I'm wondering if we could have some type of ComponentAnalyzer that could run 
some of these checks for us.  Maybe its a maven plugin?  Maybe its done as part 
of the TestRunner?  I could see it checking these common things I mess up all 
the time(p.s. I know sometimes there are valid cases for doing some of the 
things I forget to do, so not sure how to handle that)

# Defining two PropertyDescriptors with the same name
# Defining two PropertyDescriptors with the same description
# Defining two Relationships with the same name
## this is a slightly different behavior than with PropertyDescriptor, but an 
issue none the less
# Defining a PropertyDescriptor, but not adding it to either supported or 
supported dynamic properties
# Defining a Relationship, but not adding it to the list of relationships
# Defining a Processor/ControllerService/ReportingTask but not adding it to the 
service file.
# Not using descriptive annotations(@CapabilityDescription, @Tags)

 Framework allows you to define two properties with the same name
 

 Key: NIFI-716
 URL: https://issues.apache.org/jira/browse/NIFI-716
 Project: Apache NiFi
  Issue Type: Bug
  Components: Core Framework
Affects Versions: 0.1.0
Reporter: Dan Bress
Priority: Minor
  Labels: beginner, newbie

 If you are lazy and copy and paste a PropertyDescriptor and forget to change 
 the value assigned to name(), the framework(test or regular) does not detect 
 this and proceeds happily.
 It would be great if this situation was detected as soon as possible, and 
 either mark the processor as invalid, or fail to consider it as a possible 
 processor.
 Example
 {code}
 public static final PropertyDescriptor MIN_SIZE = new 
 PropertyDescriptor.Builder()
 .name(Minimum Group Size)
 .description(The minimum size of for the bundle)
 .required(true)
 .defaultValue(0 B)
 .addValidator(StandardValidators.DATA_SIZE_VALIDATOR)
 .build();
 public static final PropertyDescriptor MAX_SIZE = new 
 PropertyDescriptor.Builder()
 .name(Minimum Group Size)
 .description(The maximum size for the bundle. If not specified, there is no 
 maximum.)
 .required(false)
 .addValidator(StandardValidators.DATA_SIZE_VALIDATOR)
 .build();
 {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (NIFI-716) Framework allows you to define two properties with the same name

2015-06-23 Thread Mark Payne (JIRA)

[ 
https://issues.apache.org/jira/browse/NIFI-716?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14597770#comment-14597770
 ] 

Mark Payne commented on NIFI-716:
-

Dan,

All good ideas. We actually already have a ticket, NIFI-34, that deals with 
having the Mock Framework detect a lot of these types of things. Please check 
out that ticket and add anything to it that you think is appropriate for the 
mock framework to do.

re: forgetting to do something vs. a valid case of intentionally not doing 
it... I think we could handle that by having an override for 
TestRunners.newTestRunner(Processor proc) that allows us to pass in something 
like: TestRunners.newTestRunner(Processor proc, CodeQualityChecks checks) and 
then have some sort of builder that allows us to turn specific checks on/off. 
That way, we can explicitly tell the test runner that we know we did something 
different than usual, but we want it that way.

 Framework allows you to define two properties with the same name
 

 Key: NIFI-716
 URL: https://issues.apache.org/jira/browse/NIFI-716
 Project: Apache NiFi
  Issue Type: Bug
  Components: Core Framework
Affects Versions: 0.1.0
Reporter: Dan Bress
Priority: Minor
  Labels: beginner, newbie

 If you are lazy and copy and paste a PropertyDescriptor and forget to change 
 the value assigned to name(), the framework(test or regular) does not detect 
 this and proceeds happily.
 It would be great if this situation was detected as soon as possible, and 
 either mark the processor as invalid, or fail to consider it as a possible 
 processor.
 This applies to Processors, ControllerServices and ReportingTasks
 Example
 {code}
 public static final PropertyDescriptor MIN_SIZE = new 
 PropertyDescriptor.Builder()
 .name(Minimum Group Size)
 .description(The minimum size of for the bundle)
 .required(true)
 .defaultValue(0 B)
 .addValidator(StandardValidators.DATA_SIZE_VALIDATOR)
 .build();
 public static final PropertyDescriptor MAX_SIZE = new 
 PropertyDescriptor.Builder()
 .name(Minimum Group Size)
 .description(The maximum size for the bundle. If not specified, there is no 
 maximum.)
 .required(false)
 .addValidator(StandardValidators.DATA_SIZE_VALIDATOR)
 .build();
 {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (NIFI-716) Framework allows you to define two properties with the same name

2015-06-23 Thread Mark Payne (JIRA)

[ 
https://issues.apache.org/jira/browse/NIFI-716?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14597714#comment-14597714
 ] 

Mark Payne commented on NIFI-716:
-

Dan,

I know that others have had this issue, as well. I wouldn't be opposed to 
marking the processor as invalid, but I definitely don't think we should avoid 
showing the Processor at all. If we did that, I think it would make things MUCH 
more confusing when the processor didn't show up. Marking as invalid at least 
provides the ability to display a nice explanation about what is wrong.

We should also make sure that the mock framework fails the unit test if we do 
TestRunners.newTestRunner(new ProcessorWithDuplicateProperty());

That way, we should catch the issue immediately and provide a nice explanation 
of what happened. Along the same lines, we should make sure in the mock 
framework that no two properties have the exact same description, either, as I 
could see someone copying  pasting and changing the name but not the 
description (though i wouldn't make the processor invalid in this case, in the 
actual flow - only in the mock framework).

 Framework allows you to define two properties with the same name
 

 Key: NIFI-716
 URL: https://issues.apache.org/jira/browse/NIFI-716
 Project: Apache NiFi
  Issue Type: Bug
  Components: Core Framework
Affects Versions: 0.1.0
Reporter: Dan Bress
Priority: Minor
  Labels: beginner, newbie

 If you are lazy and copy and paste a PropertyDescriptor and forget to change 
 the value assigned to name(), the framework(test or regular) does not detect 
 this and proceeds happily.
 It would be great if this situation was detected as soon as possible, and 
 either mark the processor as invalid, or fail to consider it as a possible 
 processor.
 Example
 {code}
 public static final PropertyDescriptor MIN_SIZE = new 
 PropertyDescriptor.Builder()
 .name(Minimum Group Size)
 .description(The minimum size of for the bundle)
 .required(true)
 .defaultValue(0 B)
 .addValidator(StandardValidators.DATA_SIZE_VALIDATOR)
 .build();
 public static final PropertyDescriptor MAX_SIZE = new 
 PropertyDescriptor.Builder()
 .name(Minimum Group Size)
 .description(The maximum size for the bundle. If not specified, there is no 
 maximum.)
 .required(false)
 .addValidator(StandardValidators.DATA_SIZE_VALIDATOR)
 .build();
 {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (NIFI-716) Framework allows you to define two properties with the same name

2015-06-23 Thread Mark Payne (JIRA)

[ 
https://issues.apache.org/jira/browse/NIFI-716?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14597795#comment-14597795
 ] 

Mark Payne commented on NIFI-716:
-

haha i thought you had copied  pasted it :)

Generated that ticket the last time that someone had this exact same problem of 
allowing two properties with the same name. Glad we came to the same 
conclusions!

 Framework allows you to define two properties with the same name
 

 Key: NIFI-716
 URL: https://issues.apache.org/jira/browse/NIFI-716
 Project: Apache NiFi
  Issue Type: Bug
  Components: Core Framework
Affects Versions: 0.1.0
Reporter: Dan Bress
Priority: Minor
  Labels: beginner, newbie

 If you are lazy and copy and paste a PropertyDescriptor and forget to change 
 the value assigned to name(), the framework(test or regular) does not detect 
 this and proceeds happily.
 It would be great if this situation was detected as soon as possible, and 
 either mark the processor as invalid, or fail to consider it as a possible 
 processor.
 This applies to Processors, ControllerServices and ReportingTasks
 Example
 {code}
 public static final PropertyDescriptor MIN_SIZE = new 
 PropertyDescriptor.Builder()
 .name(Minimum Group Size)
 .description(The minimum size of for the bundle)
 .required(true)
 .defaultValue(0 B)
 .addValidator(StandardValidators.DATA_SIZE_VALIDATOR)
 .build();
 public static final PropertyDescriptor MAX_SIZE = new 
 PropertyDescriptor.Builder()
 .name(Minimum Group Size)
 .description(The maximum size for the bundle. If not specified, there is no 
 maximum.)
 .required(false)
 .addValidator(StandardValidators.DATA_SIZE_VALIDATOR)
 .build();
 {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (NIFI-716) Framework allows you to define two properties with the same name

2015-06-23 Thread Dan Bress (JIRA)

[ 
https://issues.apache.org/jira/browse/NIFI-716?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=1459#comment-1459
 ] 

Dan Bress commented on NIFI-716:


Holy smokes... I think you have word for word 7 out of the 8 I listed.  Nuts.  
I'll add the missing on to NIFI-34.  Thanks!

 Framework allows you to define two properties with the same name
 

 Key: NIFI-716
 URL: https://issues.apache.org/jira/browse/NIFI-716
 Project: Apache NiFi
  Issue Type: Bug
  Components: Core Framework
Affects Versions: 0.1.0
Reporter: Dan Bress
Priority: Minor
  Labels: beginner, newbie

 If you are lazy and copy and paste a PropertyDescriptor and forget to change 
 the value assigned to name(), the framework(test or regular) does not detect 
 this and proceeds happily.
 It would be great if this situation was detected as soon as possible, and 
 either mark the processor as invalid, or fail to consider it as a possible 
 processor.
 This applies to Processors, ControllerServices and ReportingTasks
 Example
 {code}
 public static final PropertyDescriptor MIN_SIZE = new 
 PropertyDescriptor.Builder()
 .name(Minimum Group Size)
 .description(The minimum size of for the bundle)
 .required(true)
 .defaultValue(0 B)
 .addValidator(StandardValidators.DATA_SIZE_VALIDATOR)
 .build();
 public static final PropertyDescriptor MAX_SIZE = new 
 PropertyDescriptor.Builder()
 .name(Minimum Group Size)
 .description(The maximum size for the bundle. If not specified, there is no 
 maximum.)
 .required(false)
 .addValidator(StandardValidators.DATA_SIZE_VALIDATOR)
 .build();
 {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (NIFI-716) Framework allows you to define two properties with the same name

2015-06-23 Thread Dan Bress (JIRA)

[ 
https://issues.apache.org/jira/browse/NIFI-716?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14597687#comment-14597687
 ] 

Dan Bress commented on NIFI-716:


Aldrin,
   Yes, that is exactly what I meant.  Thanks for clarifying!

   I bring this up, because I did this, and when I did 
context.getProperty(apiKey) it would give me back the value of username.  I was 
confused and it took a minute to realize what had happened.

Dan

   

 Framework allows you to define two properties with the same name
 

 Key: NIFI-716
 URL: https://issues.apache.org/jira/browse/NIFI-716
 Project: Apache NiFi
  Issue Type: Bug
  Components: Core Framework
Affects Versions: 0.1.0
Reporter: Dan Bress
Priority: Minor

 If you are lazy and copy and paste a PropertyDescriptor and forget to change 
 its name, the framework(test or regular) does not detect this and proceeds 
 happily.
 It would be great if this situation was detected as soon as possible, and 
 either mark the processor as invalid, or fail to consider it as a possible 
 processor.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (NIFI-716) Framework allows you to define two properties with the same name

2015-06-23 Thread Aldrin Piri (JIRA)

[ 
https://issues.apache.org/jira/browse/NIFI-716?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14597652#comment-14597652
 ] 

Aldrin Piri commented on NIFI-716:
--

When you say copy and paste, are you talking about copying and pasting property 
descriptor declaration, changing its variable name and then adding that to the 
supported property descriptors list, but forgetting to update its name?

For illustration, this could result in having two items in your processor 
configuration labeled as username even though the backing variables in code 
are username and apiKey?


 Framework allows you to define two properties with the same name
 

 Key: NIFI-716
 URL: https://issues.apache.org/jira/browse/NIFI-716
 Project: Apache NiFi
  Issue Type: Bug
  Components: Core Framework
Affects Versions: 0.1.0
Reporter: Dan Bress
Priority: Minor

 If you are lazy and copy and paste a PropertyDescriptor and forget to change 
 its name, the framework(test or regular) does not detect this and proceeds 
 happily.
 It would be great if this situation was detected as soon as possible, and 
 either mark the processor as invalid, or fail to consider it as a possible 
 processor.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)