GuruCharan94 / azure-devops-extensions

Azure Devops Extensions
5 stars 4 forks source link

Upload task fails within multi-stage pipeline #15

Closed PhilDye closed 4 years ago

PhilDye commented 4 years ago

When used within the newer yml-based multi-stage pipelines, the upload task (or as part of autorun) fails as a step inside a deployment job;

eg within azure-pipelines.yml;

- stage: prod_deploy
  - deployment: prod_deploy
    strategy:
      runOnce:
        deploy:
          steps:
          - task: lighthouse-ci@1
            displayName: 'Lighthouse'
            inputs:
              command: 'autorun'

Error;

Open the report at https://storage.googleapis.com/lighthouse-infrastructure.appspot.com/reports/nnnnnnnnnnnnnn-nnnnn.report.html
Error: Unable to determine current hash with `git rev-parse HEAD`
    at getCurrentHash (C:\npm\prefix\node_modules\@lhci\cli\node_modules\@lhci\utils\src\build-context.js:74:11)
    at runGithubStatusCheck (C:\npm\prefix\node_modules\@lhci\cli\src\upload\upload.js:223:16)
    at runTemporaryPublicStorageTarget (C:\npm\prefix\node_modules\@lhci\cli\src\upload\upload.js:481:9)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async run (C:\npm\prefix\node_modules\@lhci\cli\src\cli.js:92:7)WARNING: upload command failed.

In this context, the extension fallsback to 'Running Inside a Build Pipeline. Will infer Build Context from Git Repo' but there is no git repo.

GuruCharan94 commented 4 years ago

@PhilDye, Thanks for filing.

I haven't played around with multi-stage pipelines yet and so the extension was not tested in that context either. So, let me try to understand how multi-stage pipelines work and then reproduce the problem this weekend and see how I can fix it.

If I don't come back, feel free to remind me here

GuruCharan94 commented 4 years ago

@PhilDye , I have update the extension to work with both YAML multi-stage and the classic pipelines. Closing the issue for now. In case something is not working as expected, please leave a comment and I can re-open.

Cheers.