Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FISH-1423 disable escaping asadmin #5299

Merged
merged 6 commits into from
Jun 16, 2021

Conversation

kalinchan
Copy link
Member

@kalinchan kalinchan commented Jun 9, 2021

Description

Allows the ability to enable/disable escape event

Testing

Testing Performed

Tested by seeing if this the expected outcome is expected, and then setting the env variable AS_ADMIN_DISABLE_EVENT_EXPANSION to false and seeing if it is different

Testing Environment

openjdk version "1.8.0_292"
ubunutu 20.04
maven 3.6.3

Documentation PR

payara/Payara-Community-Documentation#169

Notes for Reviewers

Started by @OndroMih

@kalinchan kalinchan requested review from OndroMih and Pandrex247 June 9, 2021 11:47
@kalinchan
Copy link
Member Author

jenkins test please

@Pandrex247 Pandrex247 changed the title Fish 1423 disable escaping asadmin FISH-1423 disable escaping asadmin Jun 9, 2021
Copy link
Member

@Pandrex247 Pandrex247 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We probably need a swarm on this to test it on all supported OSs and terminals, across a variety of commands, and comparing against the asadmin recorder - escape characters are finicky.

Copy link
Contributor

@lprimak lprimak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

simplify system property, fix alignment

@kalinchan kalinchan requested review from lprimak and Pandrex247 June 14, 2021 10:04
@kalinchan
Copy link
Member Author

jenkins test please

Copy link
Contributor

@lprimak lprimak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tabs in the code and 2-space indents still there

@kalinchan kalinchan requested a review from lprimak June 14, 2021 16:38
@lprimak
Copy link
Contributor

lprimak commented Jun 14, 2021

@Pandrex247 Since this PR just passes additional option and has ability to disable it, should this not just be good enough approved for community?
Looks good to me

@lprimak
Copy link
Contributor

lprimak commented Jun 14, 2021

jenkins test

@Pandrex247
Copy link
Member

Pandrex247 commented Jun 15, 2021

@lprimak this is targeted to go into Community and Enterprise at the same time - if anthing other than the default value needs changing we need to keep them in sync so doing the tests here first makes sense to save us having to make a 2nd PR.

Results of testing on Windows (Windows Terminal):

  • AS_ADMIN_DISABLE_EVENT_EXPANSION unset (defaults to true)
    • Non-interactive:
      • asadmin create-system-properties 'test_one=colons\:and\=equal\=signs' - works
      • asadmin create-system-properties "test_two=colons\:and\=equal\=signs" - works
      • asadmin create-system-properties test_three=colons\\:and\\=equal\\=signs - doesn't work
        • Needs to be: asadmin create-system-properties test_three=colons\:and\=equal\=signs
    • Interactive:
      • create-system-properties 'test_four=colons\:and\=equal\=signs' - works
      • create-system-properties "test_five=colons\:and\=equal\=signs" - works
      • create-system-properties test_six=colons\\:and\\=equal\\=signs - works
  • AS_ADMIN_DISABLE_EVENT_EXPANSION=false
    • Non-interactive:
      • asadmin create-system-properties 'test_seven=colons\:and\=equal\=signs' - works
      • asadmin create-system-properties "test_eight=colons\:and\=equal\=signs" - works
      • asadmin create-system-properties test_nine=colons\\:and\\=equal\\=signs - doesn't work
        • Needs to be: asadmin create-system-properties test_nine=colons\:and\=equal\=signs
    • Interactive:
      • create-system-properties 'test_ten=colons\:and\=equal\=signs' - doesn't work
        • Needs to be: asadmin create-system-properties 'test_seven=colons\\:and\\=equal\\=signs' OR asadmin create-system-properties 'test_seven=colons\\\\:and\\\\=equal\\\\=signs' (both seem to come up with the expected result)
      • create-system-properties "test_eleven=colons\:and\=equal\=signs" - doesn't work
        • Needs to be: asadmin create-system-properties "test_eight=colons\\:and\\=equal\\=signs" OR asadmin create-system-properties "test_eight=colons\\\\:and\\\\=equal\\\\=signs" (both seem to come up with the expected result)
      • create-system-properties test_twelve=colons\\:and\\=equal\\=signs - doesn't work
        • Needs to be: asadmin create-system-properties test_twelve=colons\\\\:and\\\\=equal\\\\=signs

Results of testing on WSL OpenSUSE Leap 15.2 (Windows Terminal):

  • AS_ADMIN_DISABLE_EVENT_EXPANSION unset (defaults to true)
    • Non-interactive:
      • asadmin create-system-properties 'test_one=colons\:and\=equal\=signs' - works
      • asadmin create-system-properties "test_two=colons\:and\=equal\=signs" - works
      • asadmin create-system-properties test_three=colons\\:and\\=equal\\=signs - works
    • Interactive:
      • create-system-properties 'test_four=colons\:and\=equal\=signs' - works
      • create-system-properties "test_five=colons\:and\=equal\=signs" - works
      • create-system-properties test_six=colons\\:and\\=equal\\=signs - works
  • AS_ADMIN_DISABLE_EVENT_EXPANSION=false
    • Non-interactive:
      • asadmin create-system-properties 'test_seven=colons\:and\=equal\=signs' - works
      • asadmin create-system-properties "test_eight=colons\:and\=equal\=signs" - works
      • asadmin create-system-properties test_nine=colons\\:and\\=equal\\=signs - works
    • Interactive:
      • create-system-properties 'test_ten=colons\:and\=equal\=signs' - doesn't work
        • Needs to be: asadmin create-system-properties 'test_seven=colons\\:and\\=equal\\=signs'
      • create-system-properties "test_eleven=colons\:and\=equal\=signs" - doesn't work
        • Needs to be: asadmin create-system-properties "test_eight=colons\\:and\\=equal\\=signs"
      • create-system-properties test_twelve=colons\\:and\\=equal\\=signs - doesn't work
        • Needs to be: asadmin create-system-properties test_twelve=colons\\\\:and\\\\=equal\\\\=signs

@OndroMih Is this in line with what you expect?

@kalinchan
Copy link
Member Author

@Pandrex247 You are setting the wrong Environment variable, I recently changed it to AS_ADMIN_DISABLE_EVENT_EXPANSION

@Pandrex247
Copy link
Member

@kalinchan Not in the code pushed to this branch

@kalinchan
Copy link
Member Author

kalinchan commented Jun 15, 2021

@Pandrex247 That Environment class you said to use adds that prefix to the String, so it becomes AS_ADMIN_DISABLE_EVENT_EXPANSION

@Pandrex247
Copy link
Member

Comment updated with new results.

Copy link
Contributor

@OndroMih OndroMih left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, @Pandrex247, the behavior you observe is expected. This issue is only about fixing multimode, command line execution used to work before as expected. The only case that didn't work for you on Windows is actually also expected - Windows doesn't use \ as escape character and therefore it's not needed to escape it as in Linux shell's. We can't change how Windows escapes characters.

I suggested one small cosmetic change (use the existing Environment instead of creating a new one), otherwise all looks good.

@kalinchan
Copy link
Member Author

jenkins test

@kalinchan
Copy link
Member Author

jenkins test

@Pandrex247
Copy link
Member

Jenkins test please

@kalinchan kalinchan merged commit baf5e6a into master Jun 16, 2021
JamesHillyard pushed a commit to JamesHillyard/Payara that referenced this pull request Oct 28, 2021
…-asadmin

FISH-1423 disable escaping asadmin
@kalinchan kalinchan deleted the FISH-1423-disable-escaping-asadmin branch December 3, 2021 11:53
JamesHillyard added a commit to JamesHillyard/Payara that referenced this pull request Dec 22, 2021
…escaping-asadmin"

This reverts commit 6327682

Signed-off-by: JamesHillyard <[email protected]>
JamesHillyard pushed a commit to JamesHillyard/Payara that referenced this pull request Dec 23, 2021
…-asadmin

FISH-1423 disable escaping asadmin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants