-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Updated Get-AzAutomationJobOutputRecord to handle JSON and Text record values #8607
Conversation
Any update on this PR? |
@lwajswaj the proper contacts from the Automation team have been notified offline -- @NicoletazMS @NarayanThiru |
@lwajswaj, Do we have any tests? |
@safeermohammed, this should be covered by existing (if any) test cases. @cormacpayne, any update on this review? |
@NicoletazMS @NarayanThiru @vrdmr Would you mind taking a look at these changes? |
@vladimir-shcherbakov, @NicoletazMS, @NarayanThiru , @vrdmr , any update on this? |
Leandro, can you please explain how you tested the fix? Asking because, when I look at the existing code, it is already taking care of the case where the jobStream.Value may not be JSON. The Deserialize (line 61) would throw exception if the value is not JSON format; and the catch block checks if the exception message contains 'Invalid JSON primitive'. If it doesn't it assigns the value to paramValue (line 68). Was this not working? Moreover, the fix will match the pattern {"error" : {"code" : "AuthenticationFailed", "message" : "Authentication failed."} }; but not the pattern {"error" : {"code" : "AuthenticationFailed", "message" : "Authentication failed."}, {"value" : "somevalue" } }. Will there always be only one child property? I am new to this code base - so pardon my questions; and apologize for the delay in responding. |
@lwajswaj Ping on the comments above. |
@lwajswaj No activity for 2 weeks. Closing. Feel free to reopen the PR when you have time to address the comments above. |
Hello, I've been with some business trips + vacations and it was not possible to stay on top of this PR. How should I proceed? opening a new one or can this one be re-open? @NarayanThiru, in order to test it, just reference to the linked issues. If you try to repro, you will see. |
Description
This PR addresses issue #7977 and #8600. Root cause of the issue was identified as stream outputs always expecting to be a JSON file; however, this ain't true in all cases as String or PSObjects are not returned as JSON. To fix it, a RegEx was put in place to identify JSON output from text output.
Checklist
CONTRIBUTING.md
platyPS
module