-
Notifications
You must be signed in to change notification settings - Fork 242
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
Refactor escape sequence handling #822
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ran Scuba against all products and review reports. Verified ProviderSettingExport has no back slashes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just had one question about the update to escaping based on the Date example. See below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes look good and all testing works as expected.
@nanda-katikaneni this PR is ready to go. |
c5064ed
to
fd329da
Compare
🗣 Description
This PR makes it so that ScubaGear no longer attempts to remove all backslashes, only the specific character sequences known to cause problems for Rego.
💭 Motivation and context
The provider output can include characters that Rego attempts to interpret as escape sequences (such as
\/
, which is output when you convert a date to json in PowerShell 5 (e.g.,Get-Date | Convert-ToJson
). These sequences result in the error "unable to parse input: yaml: line x: found unknown escape character." Previously, ScubaGear attempted to circumvent this issue by wholesale removing all backslashes from the resulting json. However, there are cases where that technique resulted in broken json (see #807 and #770).Closes #818.
🧪 Testing
Tested on the E5, G3, G5, and GCCHigh tenants, asserting that the number of tests passing/failing matched for both this branch and main. Also, engineered a problematic transport rule that would cause a parsing error as described in #807 (comment). That rule causes the parsing error in main but not this branch.
✅ Pre-approval checklist
✅ Pre-merge checklist
PR passed smoke test check.
Feature branch has been rebased against changes from parent branch, as needed
Use
Rebase branch
button below or use this reference to rebase from the command line.Resolved all merge conflicts on branch
Notified merge coordinator that PR is ready for merge via comment mention
✅ Post-merge checklist