[jira] [Commented] (NIFI-4407) Non-EL statement processed as expression language

2018-07-18 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/NIFI-4407?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16547564#comment-16547564
 ] 

ASF GitHub Bot commented on NIFI-4407:
--

Github user asfgit closed the pull request at:

https://github.com/apache/nifi/pull/2898


> Non-EL statement processed as expression language
> -
>
> Key: NIFI-4407
> URL: https://issues.apache.org/jira/browse/NIFI-4407
> Project: Apache NiFi
>  Issue Type: Bug
>Affects Versions: 1.0.0, 1.1.0, 1.2.0, 1.1.1, 1.0.1, 1.3.0
>Reporter: Pierre Villard
>Assignee: Mark Payne
>Priority: Critical
> Fix For: 1.8.0
>
>
> If you take a GFF with custom text: {{test$$foo}}
> The generated text will be: {{test$foo}}
> The property supports expression language and one $ is removed during the EL 
> evaluation step. This can be an issue if a user wants to use a value 
> containing to consecutive $$ (such as in password fields).



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (NIFI-4407) Non-EL statement processed as expression language

2018-07-18 Thread ASF subversion and git services (JIRA)


[ 
https://issues.apache.org/jira/browse/NIFI-4407?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16547563#comment-16547563
 ] 

ASF subversion and git services commented on NIFI-4407:
---

Commit 72a5e6bfba1597f6174223f3afc85de478d49898 in nifi's branch 
refs/heads/master from [~markap14]
[ https://git-wip-us.apache.org/repos/asf?p=nifi.git;h=72a5e6b ]

NIFI-4407: Updated Expression Language Guide to provide details about how 
escaping $ is accomplished, and when the $ character should and should not be 
escaped. Fixed bug in the Query compiler that mistakenly would blindly replace 
484 with $ even when the 484 did not precede an Expression. Added additional 
test cases.

Signed-off-by: Pierre Villard 

This closes #2898.


> Non-EL statement processed as expression language
> -
>
> Key: NIFI-4407
> URL: https://issues.apache.org/jira/browse/NIFI-4407
> Project: Apache NiFi
>  Issue Type: Bug
>Affects Versions: 1.0.0, 1.1.0, 1.2.0, 1.1.1, 1.0.1, 1.3.0
>Reporter: Pierre Villard
>Assignee: Mark Payne
>Priority: Critical
> Fix For: 1.8.0
>
>
> If you take a GFF with custom text: {{test$$foo}}
> The generated text will be: {{test$foo}}
> The property supports expression language and one $ is removed during the EL 
> evaluation step. This can be an issue if a user wants to use a value 
> containing to consecutive $$ (such as in password fields).



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (NIFI-4407) Non-EL statement processed as expression language

2018-07-18 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/NIFI-4407?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16547562#comment-16547562
 ] 

ASF GitHub Bot commented on NIFI-4407:
--

Github user pvillard31 commented on the issue:

https://github.com/apache/nifi/pull/2898
  
+1, code LGTM, made few tests, checked doc update, merging to master, 
thanks @markap14 


> Non-EL statement processed as expression language
> -
>
> Key: NIFI-4407
> URL: https://issues.apache.org/jira/browse/NIFI-4407
> Project: Apache NiFi
>  Issue Type: Bug
>Affects Versions: 1.0.0, 1.1.0, 1.2.0, 1.1.1, 1.0.1, 1.3.0
>Reporter: Pierre Villard
>Assignee: Mark Payne
>Priority: Critical
> Fix For: 1.8.0
>
>
> If you take a GFF with custom text: {{test$$foo}}
> The generated text will be: {{test$foo}}
> The property supports expression language and one $ is removed during the EL 
> evaluation step. This can be an issue if a user wants to use a value 
> containing to consecutive $$ (such as in password fields).



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (NIFI-4407) Non-EL statement processed as expression language

2018-07-16 Thread Mark Payne (JIRA)


[ 
https://issues.apache.org/jira/browse/NIFI-4407?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16545627#comment-16545627
 ] 

Mark Payne commented on NIFI-4407:
--

I reviewed the documentation in the Expression Language Guide, and 
unfortunately it doesn't really call out when $$ will be escaped and when it 
won't. So I started by updating the Expression Language Guide to explain 
exactly when the $$ will and won't be escaped. I then updated unit tests to 
include the examples that I added to the EL Guide and to include the 
${literal('SNAP$')} type examples provided by [~Absolutesantaja] 
(thanks!). I then updated the code to ensure that all unit tests pass. PR is 
now ready to be reviewed.

> Non-EL statement processed as expression language
> -
>
> Key: NIFI-4407
> URL: https://issues.apache.org/jira/browse/NIFI-4407
> Project: Apache NiFi
>  Issue Type: Bug
>Affects Versions: 1.0.0, 1.1.0, 1.2.0, 1.1.1, 1.0.1, 1.3.0
>Reporter: Pierre Villard
>Priority: Critical
> Fix For: 1.8.0
>
>
> If you take a GFF with custom text: {{test$$foo}}
> The generated text will be: {{test$foo}}
> The property supports expression language and one $ is removed during the EL 
> evaluation step. This can be an issue if a user wants to use a value 
> containing to consecutive $$ (such as in password fields).



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (NIFI-4407) Non-EL statement processed as expression language

2018-07-16 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/NIFI-4407?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16545623#comment-16545623
 ] 

ASF GitHub Bot commented on NIFI-4407:
--

GitHub user markap14 opened a pull request:

https://github.com/apache/nifi/pull/2898

NIFI-4407: Updated Expression Language Guide to provide details about…

… how escaping $ is accomplished, and when the $ character should and 
should not be escaped. Fixed bug in the Query compiler that mistakenly would 
blindly replace 484 with $ even when the 484 did not precede an Expression. 
Added additional test cases.

Thank you for submitting a contribution to Apache NiFi.

In order to streamline the review of the contribution we ask you
to ensure the following steps have been taken:

### For all changes:
- [ ] Is there a JIRA ticket associated with this PR? Is it referenced 
 in the commit message?

- [ ] Does your PR title start with NIFI- where  is the JIRA number 
you are trying to resolve? Pay particular attention to the hyphen "-" character.

- [ ] Has your PR been rebased against the latest commit within the target 
branch (typically master)?

- [ ] Is your initial contribution a single, squashed commit?

### For code changes:
- [ ] Have you ensured that the full suite of tests is executed via mvn 
-Pcontrib-check clean install at the root nifi folder?
- [ ] Have you written or updated unit tests to verify your changes?
- [ ] If adding new dependencies to the code, are these dependencies 
licensed in a way that is compatible for inclusion under [ASF 
2.0](http://www.apache.org/legal/resolved.html#category-a)? 
- [ ] If applicable, have you updated the LICENSE file, including the main 
LICENSE file under nifi-assembly?
- [ ] If applicable, have you updated the NOTICE file, including the main 
NOTICE file found under nifi-assembly?
- [ ] If adding new Properties, have you added .displayName in addition to 
.name (programmatic access) for each of the new properties?

### For documentation related changes:
- [ ] Have you ensured that format looks appropriate for the output in 
which it is rendered?

### Note:
Please ensure that once the PR is submitted, you check travis-ci for build 
issues and submit an update to your PR as soon as possible.


You can merge this pull request into a Git repository by running:

$ git pull https://github.com/markap14/nifi NIFI-4407

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/nifi/pull/2898.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #2898


commit 8a9ff6884253b3294598772fad60347605257b0d
Author: Mark Payne 
Date:   2018-07-16T17:27:46Z

NIFI-4407: Updated Expression Language Guide to provide details about how 
escaping $ is accomplished, and when the $ character should and should not be 
escaped. Fixed bug in the Query compiler that mistakenly would blindly replace 
484 with $ even when the 484 did not precede an Expression. Added additional 
test cases.




> Non-EL statement processed as expression language
> -
>
> Key: NIFI-4407
> URL: https://issues.apache.org/jira/browse/NIFI-4407
> Project: Apache NiFi
>  Issue Type: Bug
>Affects Versions: 1.0.0, 1.1.0, 1.2.0, 1.1.1, 1.0.1, 1.3.0
>Reporter: Pierre Villard
>Priority: Critical
>
> If you take a GFF with custom text: {{test$$foo}}
> The generated text will be: {{test$foo}}
> The property supports expression language and one $ is removed during the EL 
> evaluation step. This can be an issue if a user wants to use a value 
> containing to consecutive $$ (such as in password fields).



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (NIFI-4407) Non-EL statement processed as expression language

2018-07-16 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/NIFI-4407?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16545586#comment-16545586
 ] 

ASF GitHub Bot commented on NIFI-4407:
--

Github user markap14 closed the pull request at:

https://github.com/apache/nifi/pull/2897


> Non-EL statement processed as expression language
> -
>
> Key: NIFI-4407
> URL: https://issues.apache.org/jira/browse/NIFI-4407
> Project: Apache NiFi
>  Issue Type: Bug
>Affects Versions: 1.0.0, 1.1.0, 1.2.0, 1.1.1, 1.0.1, 1.3.0
>Reporter: Pierre Villard
>Priority: Critical
>
> If you take a GFF with custom text: {{test$$foo}}
> The generated text will be: {{test$foo}}
> The property supports expression language and one $ is removed during the EL 
> evaluation step. This can be an issue if a user wants to use a value 
> containing to consecutive $$ (such as in password fields).



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (NIFI-4407) Non-EL statement processed as expression language

2018-07-16 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/NIFI-4407?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16545522#comment-16545522
 ] 

ASF GitHub Bot commented on NIFI-4407:
--

GitHub user markap14 opened a pull request:

https://github.com/apache/nifi/pull/2897

NIFI-4407: Updated Expression Language Guide to provide details about…

… how escaping $ is accomplished, and when the $ character should and 
should not be escaped. Fixed bug in the Query compiler that mistakenly would 
blindly replace 484 with $ even when the 484 did not precede an Expression. 
Added additional test cases.

Thank you for submitting a contribution to Apache NiFi.

In order to streamline the review of the contribution we ask you
to ensure the following steps have been taken:

### For all changes:
- [ ] Is there a JIRA ticket associated with this PR? Is it referenced 
 in the commit message?

- [ ] Does your PR title start with NIFI- where  is the JIRA number 
you are trying to resolve? Pay particular attention to the hyphen "-" character.

- [ ] Has your PR been rebased against the latest commit within the target 
branch (typically master)?

- [ ] Is your initial contribution a single, squashed commit?

### For code changes:
- [ ] Have you ensured that the full suite of tests is executed via mvn 
-Pcontrib-check clean install at the root nifi folder?
- [ ] Have you written or updated unit tests to verify your changes?
- [ ] If adding new dependencies to the code, are these dependencies 
licensed in a way that is compatible for inclusion under [ASF 
2.0](http://www.apache.org/legal/resolved.html#category-a)? 
- [ ] If applicable, have you updated the LICENSE file, including the main 
LICENSE file under nifi-assembly?
- [ ] If applicable, have you updated the NOTICE file, including the main 
NOTICE file found under nifi-assembly?
- [ ] If adding new Properties, have you added .displayName in addition to 
.name (programmatic access) for each of the new properties?

### For documentation related changes:
- [ ] Have you ensured that format looks appropriate for the output in 
which it is rendered?

### Note:
Please ensure that once the PR is submitted, you check travis-ci for build 
issues and submit an update to your PR as soon as possible.


You can merge this pull request into a Git repository by running:

$ git pull https://github.com/markap14/nifi NIFI-4407

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/nifi/pull/2897.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #2897


commit bad1d94291ebb7ec64a15094f7c7f938a3973b49
Author: Mark Payne 
Date:   2018-07-16T17:27:46Z

NIFI-4407: Updated Expression Language Guide to provide details about how 
escaping $ is accomplished, and when the $ character should and should not be 
escaped. Fixed bug in the Query compiler that mistakenly would blindly replace 
484 with $ even when the 484 did not precede an Expression. Added additional 
test cases.




> Non-EL statement processed as expression language
> -
>
> Key: NIFI-4407
> URL: https://issues.apache.org/jira/browse/NIFI-4407
> Project: Apache NiFi
>  Issue Type: Bug
>Affects Versions: 1.0.0, 1.1.0, 1.2.0, 1.1.1, 1.0.1, 1.3.0
>Reporter: Pierre Villard
>Priority: Critical
>
> If you take a GFF with custom text: {{test$$foo}}
> The generated text will be: {{test$foo}}
> The property supports expression language and one $ is removed during the EL 
> evaluation step. This can be an issue if a user wants to use a value 
> containing to consecutive $$ (such as in password fields).



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (NIFI-4407) Non-EL statement processed as expression language

2018-07-09 Thread Shawn Weeks (JIRA)


[ 
https://issues.apache.org/jira/browse/NIFI-4407?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16537627#comment-16537627
 ] 

Shawn Weeks commented on NIFI-4407:
---

This is def a bug because if you have an attribute  with a value like 
TEST$$TEST and try to insert that attribute using ${attribute_name} you will 
get TEST$TEST despite the attributes value being TEST$$TEST. Also 
${literal('SNAP$$')} evaluates to SNAP$ as does ${literal('SNAP$')}. If 
your attribute came from an external system and you try to use it as a literal 
value in a later step you can't.

> Non-EL statement processed as expression language
> -
>
> Key: NIFI-4407
> URL: https://issues.apache.org/jira/browse/NIFI-4407
> Project: Apache NiFi
>  Issue Type: Bug
>Affects Versions: 1.0.0, 1.1.0, 1.2.0, 1.1.1, 1.0.1, 1.3.0
>Reporter: Pierre Villard
>Priority: Critical
>
> If you take a GFF with custom text: {{test$$foo}}
> The generated text will be: {{test$foo}}
> The property supports expression language and one $ is removed during the EL 
> evaluation step. This can be an issue if a user wants to use a value 
> containing to consecutive $$ (such as in password fields).



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (NIFI-4407) Non-EL statement processed as expression language

2018-05-15 Thread Ed Berezitsky (JIRA)

[ 
https://issues.apache.org/jira/browse/NIFI-4407?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16476709#comment-16476709
 ] 

Ed Berezitsky commented on NIFI-4407:
-

[~markap14], [~pvillard],

Not clear whether you guys agreed it is a bug or not :). IMO it's not a bug. 
But issue is still opened...

So, improvement can be made: we can add a property "Evaluate Text" (true/false) 
with default as "true", so it will be backward compatible.

Thoughts?

> Non-EL statement processed as expression language
> -
>
> Key: NIFI-4407
> URL: https://issues.apache.org/jira/browse/NIFI-4407
> Project: Apache NiFi
>  Issue Type: Bug
>Affects Versions: 1.0.0, 1.1.0, 1.2.0, 1.1.1, 1.0.1, 1.3.0
>Reporter: Pierre Villard
>Priority: Critical
>
> If you take a GFF with custom text: {{test$$foo}}
> The generated text will be: {{test$foo}}
> The property supports expression language and one $ is removed during the EL 
> evaluation step. This can be an issue if a user wants to use a value 
> containing to consecutive $$ (such as in password fields).



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (NIFI-4407) Non-EL statement processed as expression language

2018-03-28 Thread Otto Fowler (JIRA)

[ 
https://issues.apache.org/jira/browse/NIFI-4407?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16417889#comment-16417889
 ] 

Otto Fowler commented on NIFI-4407:
---

I don't think validateExpression or the Range are  documented enough to 
understand what is going on.

in the test:
{code:java}
try {
Query.validateExpression("$${attr}", false);
Assert.fail("invalid query validated");
} catch (final AttributeExpressionLanguageParsingException e) {
}

Query.validateExpression("$${attr}", true);

{code}
the bottom expression doesn't throw or fail, but that is because nothing is 
ever compiled...

 

Can I ask why, when there is a grammar, does nifi manually validate?  It is 
harder when the grammar has one set of rules, then then other rules that might 
be expressed in the grammar are over laid.

> Non-EL statement processed as expression language
> -
>
> Key: NIFI-4407
> URL: https://issues.apache.org/jira/browse/NIFI-4407
> Project: Apache NiFi
>  Issue Type: Bug
>Affects Versions: 1.0.0, 1.1.0, 1.2.0, 1.1.1, 1.0.1, 1.3.0
>Reporter: Pierre Villard
>Priority: Critical
>
> If you take a GFF with custom text: {{test$$foo}}
> The generated text will be: {{test$foo}}
> The property supports expression language and one $ is removed during the EL 
> evaluation step. This can be an issue if a user wants to use a value 
> containing to consecutive $$ (such as in password fields).



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (NIFI-4407) Non-EL statement processed as expression language

2018-03-28 Thread Mark Payne (JIRA)

[ 
https://issues.apache.org/jira/browse/NIFI-4407?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16417767#comment-16417767
 ] 

Mark Payne commented on NIFI-4407:
--

... and nevermind, you may be right. Looking at the unit test that you 
mentioned, I do see a test that expects
{code:java}
$$${attr}{code}
to evaluate to
{code:java}
$My Value{code}
when attr = My Value

So it expects the $$ to become a $.

> Non-EL statement processed as expression language
> -
>
> Key: NIFI-4407
> URL: https://issues.apache.org/jira/browse/NIFI-4407
> Project: Apache NiFi
>  Issue Type: Bug
>Affects Versions: 1.0.0, 1.1.0, 1.2.0, 1.1.1, 1.0.1, 1.3.0
>Reporter: Pierre Villard
>Priority: Critical
>
> If you take a GFF with custom text: {{test$$foo}}
> The generated text will be: {{test$foo}}
> The property supports expression language and one $ is removed during the EL 
> evaluation step. This can be an issue if a user wants to use a value 
> containing to consecutive $$ (such as in password fields).



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (NIFI-4407) Non-EL statement processed as expression language

2018-03-28 Thread Mark Payne (JIRA)

[ 
https://issues.apache.org/jira/browse/NIFI-4407?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16417749#comment-16417749
 ] 

Mark Payne commented on NIFI-4407:
--

[~pvillard] I think this is a bug. If the value were "test$${foo}" then it 
should evaluate to "test${foo}". However, since there is no brace here, 
"test$$foo" should not be changed to "test$foo".

> Non-EL statement processed as expression language
> -
>
> Key: NIFI-4407
> URL: https://issues.apache.org/jira/browse/NIFI-4407
> Project: Apache NiFi
>  Issue Type: Bug
>Affects Versions: 1.0.0, 1.1.0, 1.2.0, 1.1.1, 1.0.1, 1.3.0
>Reporter: Pierre Villard
>Priority: Critical
>
> If you take a GFF with custom text: {{test$$foo}}
> The generated text will be: {{test$foo}}
> The property supports expression language and one $ is removed during the EL 
> evaluation step. This can be an issue if a user wants to use a value 
> containing to consecutive $$ (such as in password fields).



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (NIFI-4407) Non-EL statement processed as expression language

2017-09-21 Thread Pierre Villard (JIRA)

[ 
https://issues.apache.org/jira/browse/NIFI-4407?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16175418#comment-16175418
 ] 

Pierre Villard commented on NIFI-4407:
--

It seems to be the expected behaviour if we look at 
{{org.apache.nifi.attribute.expression.language.TestQuery}}
Instead of a bug, it could be something to document in 
https://nifi.apache.org/docs/nifi-docs/html/expression-language-guide.html

> Non-EL statement processed as expression language
> -
>
> Key: NIFI-4407
> URL: https://issues.apache.org/jira/browse/NIFI-4407
> Project: Apache NiFi
>  Issue Type: Bug
>Affects Versions: 1.0.0, 1.1.0, 1.2.0, 1.1.1, 1.0.1, 1.3.0
>Reporter: Pierre Villard
>Priority: Critical
>
> If you take a GFF with custom text: {{test$$foo}}
> The generated text will be: {{test$foo}}
> The property supports expression language and one $ is removed during the EL 
> evaluation step. This can be an issue if a user wants to use a value 
> containing to consecutive $$ (such as in password fields).



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)