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

PRO-16923: ProvarDX runtests fails to handle special characters in Scratch Org Passwords properly #25

Merged
merged 4 commits into from
Aug 28, 2020

Conversation

riteshnahar
Copy link
Contributor

@riteshnahar riteshnahar commented Aug 19, 2020

Issue: Scratch org password had special characters. Earlier we had only escaped &, |, ^ special characters.

Fix: Encoded password value.

Also contains changes for:

  1. ProvarDX trademark changes.

  2. Added .vscode folder in git containing debug configuration and copyright snippet.

Copy link

@paulrichards-provar paulrichards-provar left a comment

Choose a reason for hiding this comment

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

There a few points with this commit. Which I'll comment on individually below but in general it is not good practice to do unrelated changes in the same commit.

password = password.split('&').join('"&"');
password = password.split('|').join('"|"');
password = password.split('^').join('"^"');
password = password.replace(/[\\^$.*+?()[\]{}|]/g, '\\$&');

Choose a reason for hiding this comment

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

This doesn't look like the right fix to me. The example in the Jira is an invalid JSON string where the final character in the password is \ which is escaping the closing quote. That's just an error in the JSON not a bug in our code.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I debugged it on my local and faced a similar issue where the commands were failing due to special characters in the password
2X#$[3P8mj
&2Cp9%Wt4M

So, that's why added a regex to escape special characters correctly.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Now we have encoded the password value before sending it to Provar.

@riteshnahar riteshnahar merged commit 609db17 into development Aug 28, 2020
@riteshnahar riteshnahar deleted the PRO-16923 branch August 28, 2020 08:30
riteshnahar added a commit that referenced this pull request Sep 11, 2020
* PRO-16810: ProvarDX Incorrect Help messages (#23)

-   Updated help messages for runtests, validate commands displayed on running `sfdx provar --help`
-   Updated company name in LICENSE.md

* PRO-16923: ProvarDX runtests fails to handle special characters in Scratch Org Passwords properly (#25)

* PRO-16923: ProvarDX runtests fails to handle special characters in Scratch Org Passwords properly

* PRO-16923: Special characters were causing issues on different OS so encoded the password

* PRO-16897: ProvarDX: Runtests secrets flag override incorrectly documented

* PRO-16897: ProvarDX: Runtests secrets flag override incorrectly documented

* PRO-16890 : Enforce required flags for provar:metadatacache (#26)

* PRO-16890 : Enforce required flags for provar:metadatacache

The command started executing even when required flags were not given.
Changed that to give error in typescript itself. Also made changes to
make sure that the flags work correctly in tandem.

* PRO-16890 : Implement review comments and add change log

* PRO-16890 : Implement review comments

Corrected conditional checks to use "===" & '!==' for comparison and
renamed variables with self explanatory names

* PRO-16890 : Implement review comments

Co-authored-by: mayank.nehru <mayank.nehru@HP-Mayanknehru>

* PRO-17213: ProvarDX 0.3.0 release (#27)

Bumped version to 0.3.0

Co-authored-by: Mayank Nehru <mayank.nehru@provartesting.com>
Co-authored-by: mayank.nehru <mayank.nehru@HP-Mayanknehru>
Co-authored-by: ProvarTesting <6640365+ProvarTesting@users.noreply.github.com>
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.

None yet

3 participants