MicrosoftPremier / VstsExtensions

Documentation and issue tracking for Microsoft Premier Services Visual Studio Team Services Extensions
MIT License
56 stars 14 forks source link

How to configure the variable PSGer.Build.MaxWaitTime. #208

Closed thomasfinchbr closed 1 year ago

thomasfinchbr commented 1 year ago

Using build BuildQualityCheck version 8.2.1 inAzure DevOps 2020 I am running into an issues related to the previous task not uploading the data before build quality check timeout. The content of the task is an log with thousands of lines, and a I can see this log file in the previous task after the build is finished.

Checking other issues I saw a suggesting regarding the increase of the timeout value. I would like to know how I could set the variable "PSGer.Build.MaxWaitTime" Below is the way I tested to configure this variable. Is this correct?

- task: PythonScript@0
  inputs:
    scriptSource: inline
    script: |
      print("##vso[task.setvariable variable=PSGer.Build.MaxWaitTime]600000")

The output of the above step seams to be correct: image

But after running the above step I run the build quality check step and the above step seems to have no effect at all: image

ReneSchumacher commented 1 year ago

Hi @thomasfinchbr,

you can simply set the variable using the variables keyword either globally in your pipeline, in the stage that contains the BQC task, or in the job that contains the BQC task like this:

trigger: none

pool:
  vmImage: ubuntu-latest

variables:
  PSGer.Build.MaxWaitTime: 400000 # Global variable for all stages and all jobs

stages:
  - stage:
    variables:
      PSGEr.Build.MaxWaitTime: 500000 # This value overrides the global variable in this particular stage
    jobs:
      - job:
        variables:
          PSGer.Build.MaxWaitTime: 600000 # This value overrides the stage and global variable for this particular job
        steps:
          - task: BuildQualityChecks@8 # This task uses the value 600000 from the job variable
            inputs:
              [...all inputs...]
      - job:
        steps:
          - task: BuildQualityChecks@8 # This task uses the value 500000 from the stage variable
            inputs:
              [...all inputs...]
  - stage:
    jobs:
      - job:
        steps:
          - task: BuildQualityChecks@8 # This task uses the value 400000 from the global variable
            inputs:
              [...all inputs...]

I'm not sure why your dynamic variable didn't work. Either the statement was not correctly emitted to the log, and, thus, the variable was not created. Or the task might be in a different job or stage. In that case, you would need to work with output variables and dependencies, but I don't want to overcomplicate it. Setting the variable using the variables keywork is the easiest way.

thomasfinchbr commented 1 year ago

Thanks for the help. I was able to increase the time of the timeout.