azure-devops-create-pr-task
azure-devops-create-pr-task copied to clipboard
Cross platform task
- I created the package.json file based on the wrapper example and taking values from the vss-extension.json file.
- I created the tsconfig.json file following the official documentation: https://docs.microsoft.com/en-us/azure/devops/extend/develop/add-build-task?view=azure-devops
I created the index.ts file following the blog post where it explains how to make the wrapper:
- The variables that read the task input are added in the order in which they appear in the task.json file in order to have some kind of order in the future if something is modified because being so many it is difficult to know if they are all in this file.
- The parameters that are passed to the createPullRequest.ps1 RunTask function are added in the order in which they are received in that function for the same reasons as in the previous point.
- The variable "githubEndpoint" is the only one that is not passed to the RunTask function of the createPullRequest.ps1 script. For this reason, I do not use it in index.ts for the moment.
Remaining tasks:
- [ ] Check all the added files (I have hardly any experience with tasks development, npm, typescript, ...)
- [ ] Check that there is no typo / something missing in index.ts
- [ ] Necessary changes in createPullRequest.ps1 because right now it reads inside directly the parameters with Get-VstsInput in several functions and actually it should take the ones that arrive in the RunTask function.
- [ ] Test everything very well to see that there are no regressions.
As I said, I have no experience with TypeScript or developing tasks for Azure Pipelines.... I see that there is no test so I'm afraid that creating a regression is very easy.
I need you to lend me a hand in what you can to speed up this PR. Otherwise, I don't think I will be able to do it on my own.
Hi,
Thank you so much for your PR, i will check it!
First thing i can see that iIn the task.json need to change the execution
from PS to TS:
"execution": {
"Node10": {
"target": "index.js"
}
}
Replaced!
Great! need to change the pipeline to convert .ts to .js file, can you push the .js file just for the tests?
It's git ignored because it's automatically generated with "npm run build" (with tsc) command.
@shayki5 any news? Have you been able to take the time to check it?
Not yet 😞 need to change the pipeline also for support the ts.. i have already an example from my other extensions: https://github.com/shayki5/azure-devops-print-all-variables/blob/master/azure-pipelines.yml Just need to time to make it work also in this pr...
How is this progressing? It would really like to be able to run this on other platforms other than windows.
@DaleMckeown Unfortunately I haven't had time to delve into it yet, the pipeline needs to be updated also to support it. In the meantime, you can run a dedicated Windows job for this step.
Not yet 😞 need to change the pipeline also for support the ts.. i have already an example from my other extensions: https://github.com/shayki5/azure-devops-print-all-variables/blob/master/azure-pipelines.yml Just need to time to make it work also in this pr...
@shayki5 can you describe more specifically what needs to happen for this PR to be able to be completed? I and others may be willing to contribute if the acceptance criteria were specified (and if possible the specific files that need to be updated). Thanks!
Hi @steveruddell, thank you for your comment! First of all need to update the azure pipeline to build the extension from the ts files, you can see an example here: https://github.com/shayki5/azure-devops-print-all-variables/blob/master/azure-pipelines.yml After that it will be possible to check the other files. I just don't have any experience with wrapping PS extension with TS, you can see here some guidness: https://blogs.blackmarble.co.uk/rfennell/a-technique-for-porting-powershell-based-azure-devops-extensions-to-node-so-they-can-be-run-cross-platform-without-a-complete-re-write/