samsmithnz / AzurePipelinesToGitHubActionsConverter

Convert Azure Pipelines YAML to GitHub Actions YAML
MIT License
143 stars 16 forks source link

null reference error #405

Closed sachin-singh-tpt closed 1 year ago

sachin-singh-tpt commented 1 year ago

Describe the bug Getting Null reference

To Reproduce Steps to reproduce the behavior:

  1. Go to https://pipelinestoactions.azurewebsites.net/
  2. paste
    name: $(date:yyyyMMdd)$(rev:.r) - PR - main - Zircon Legacy Build
    resources:
    repositories:
    - repository: self
    type: git
    ref: develop
    jobs:
    - job: Job_1
    displayName: Zircon Build Agent Job
    pool:
    name: Zircon Build Pool
    steps:
    - checkout: self
    clean: true
    fetchTags: false
    - task: CopyFiles@2
    displayName: 'Copy Files to: D:\ZirconTfs\Build'
    inputs:
      SourceFolder: $(agent.builddirectory)
      TargetFolder: D:\ZirconTfs\Build
      CleanTargetFolder: true
      OverWrite: true
    - task: CmdLine@2
    displayName: MKS Packaging script
    inputs:
      script: "cd %ZirconBase%\nnant genInterface \nattrib -s -h -r %ZirconBase%\\MKS\\*.* /s /d\nattrib -s -h -r %ZirconBase%\\ProvisionIt\\WebSite\\Bin\\*.* /s /d\nattrib -s -h -r %ZirconBase%\\PITUtil\\PITUtil\\PITUtil\\bin\\*.* /s /d\ndel /f/s/q %ZirconBase%\\ReportItGUI\\WebSite\\Bin\\*\nrd /s/q %ZirconBase%\\ReportItGUI\\WebSite\\Bin\nmd %ZirconBase%\\ReportItGUI\\WebSite\\Bin\ncopy %ZirconBase%\\ReportItGUI\\ThirdParty\\AjaxControlToolkit.dll  %ZirconBase%\\ReportItGUI\\Website\\Bin\\AjaxControlToolkit.dll\ncopy %ZirconBase%\\ReportItGUI\\ThirdParty\\DocumentFormat.OpenXml.dll  %ZirconBase%\\ReportItGUI\\Website\\Bin\\DocumentFormat.OpenXml.dll\ndel /f/s/q d:\\Stage\\Apps\\BUILD\\*\nrd /s/q d:\\Stage\\Apps\\BUILD\ncd %ZirconBase%\\MKS\nperl package.p\n"
    - task: CopyFiles@2
    displayName: 'Copy Files to: D:\stage\apps\TestBuild'
    inputs:
      SourceFolder: D:\stage\apps\build
      TargetFolder: D:\stage\apps\TestBuild
      CleanTargetFolder: true
      OverWrite: true

    on the right side

  3. See error we are getting
    Unexpected error: System.NullReferenceException: Object reference not set to an instance of an object.
    at AzurePipelinesToGitHubActionsConverter.Core.PipelinesToActionsConversion.GeneralProcessing.ProcessStepsWithRepositories(GitHubActionsRoot gitHubActions, Repositories[] repositories)
    at AzurePipelinesToGitHubActionsConverter.Core.Conversion.ConvertAzurePipelineToGitHubActionV2(String yaml, Boolean addWorkFlowDispatch)
    at PipelinesToActionsWeb.Controllers.HomeController.ProcessConversion(String input, Boolean chkAddWorkflowDispatch) in D:\a\AzurePipelinesToGitHubActionsConverterWeb\AzurePipelinesToGitHubActionsConverterWeb\PipelinesToActions\PipelinesToActions\Controllers\HomeController.cs:line 53

Expected behavior I should have gotten github actions as output

Screenshots image

Chrome

samsmithnz commented 1 year ago

Updated issue for formatting. Thanks for reporting.

I've found the issue and started a PR. Will push this in the next hour report back here when it's ready.

samsmithnz commented 1 year ago

This is resolved, and doesn't crash anymore. Thank you again for reporting the issue!