-
Notifications
You must be signed in to change notification settings - Fork 4k
Update Import-AzureRMAutomationRunbook command to support Python Runbooks #5000
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
Conversation
Can one of the admins verify this patch? |
@rdbartram Hey Ryan, thanks for opening this PR! @vrdmr Hey Varad, would you mind reviewing this PR? |
@azuresdkci add to whitelist |
Adding @Diastro to review this. |
@@ -66,6 +66,7 @@ public class ImportAzureAutomationRunbook : AzureAutomationBaseCmdlet | |||
Constants.RunbookType.PowerShellWorkflow, | |||
Constants.RunbookType.GraphicalPowerShellWorkflow, | |||
Constants.RunbookType.Graph, | |||
Constants.RunbookType.Python, |
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.
Might be a good idea to call this Python2 (the backend already makes the difference between Py2 and Py3).
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.
Hi Diastro,I thought the same, my only concern was there is no reference to the powershell version, Core or otherwise. So I assumed when the day came that Python 3 was supported, Python 2 would be deprecated. I can change it to Python2 before you accept the change. What does everyone else think?
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.
@Diastro gentle ping
I think we should also look into test coverage around this so that we will know immediately when Python 2 support is deprecated and we can move to Python 3.
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.
@cormacpayne are we doing integration testing with this module? How would you recommend detecting whether the API has deprecated Python2 or not?
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.
@rdbartram we have some live tests we run in Azure Automation, so we could add test coverage there to know when the call no longer works. We also should add a scenario test that runs during our regular CI to make sure this functionality is working correctly. @vrdmr @Diastro it doesn't look like we have any tests around the Import-AzureRmAutomationRunbook
cmdlet, are we able to add one for this functionality?
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.
@rdbartram Sorry for the delay this slipped through my notifications.
I don't think we will deprecate Python2 if Python3 becomes available (we almost threat the as different languages to some extent). For now I think we can leave it as it (the variable name is really just an internal implementation detail at this point and can be refactored later). @vrdmr can comment on the test question.
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.
@cormacpayne I just synced with @vrdmr and you can open a task against @najams he's the owner for this area of our RP. We are waiting for our SDK to be migrated from Hyak to Swagger which will happen in December (this is when we will add test for this).
In the mean time can we let this go in please?
@rdbartram Hey Ryan, would you mind updating the Automation change log (underneath the |
… python version 2 is supported version
@@ -23,7 +23,7 @@ Import-AzureRmAutomationRunbook [-Path] <String> [-Description <String>] [-Name | |||
## DESCRIPTION | |||
The **Import-AzureRmAutomationRunbook** cmdlet imports an Azure Automation runbook. Specify the | |||
path to a wps_2 script (.ps1 ) file to import for wps_2 and wps_2 Workflow runbooks, or to a | |||
graphical runbook (.graphrunbook) file for graphical runbooks. The name of the file becomes the | |||
graphical runbook (.graphrunbook) file for graphical runbooks. (.py) files are required when importing python2 scripts The name of the file becomes the |
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.
Sorry for being picky, punctuation seems weird here. Also, I believe the extension requirement is true for other runbook type too no? Also can you remove the extra space from (.ps1 ) please.
Suggestion :
"Specify the path to a wps_2 script (.ps1) file to import for wps_2 and wps_2 Workflow runbooks, or to a graphical runbook (.graphrunbook) file for graphical runbooks, or to a python 2 script (.py) file for python 2 runbooks... "
Thoughts?
definition that matches the name of the file. | ||
The **Import-AzureRmAutomationRunbook** cmdlet imports an Azure Automation runbook. Specify the | ||
path to a wps_2 script (.ps1) file to import for wps_2 and wps_2 Workflow runbooks, | ||
or to a graphical runbook (.graphrunbook) file for graphical runbooks, or to a python 2 script (.py) file for python 2 runbooks. |
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.
Can you remove the 'or' before the 'to a graphical runbook' please? Sorry I might have added it in my suggestion but 2 'or' doesnt make sens.
Singing off.
Thanks!
Description
This checklist is used to make sure that common guidelines for a pull request are followed. You can find a more complete discussion of PowerShell cmdlet best practices here.
General Guidelines
Testing Guidelines
Cmdlet Signature Guidelines
ShouldProcess
and haveSupportShouldProcess=true
specified in the cmdlet attribute. You can find more information onShouldProcess
here.OutputType
attribute if any output is produced - if the cmdlet produces no output, it should implement aPassThru
parameter.Cmdlet Parameter Guidelines