12

Our team is implementing an Azure DevOps testing pipeline. After our initial commit to create the pipeline .yml file this error message was displayed. After looking into it, I realized I forgot to include the trigger in the .yml. However after adding, it this error message hasn't gone away. The pipeline is working as expected though, we are just using a manual trigger which is shown below. The only listed issue is from the our original commit. Is there a way I can acknowledge this error to make it go away or am I potentially missing a different error that I just haven't noticed yet? Thanks for any help in advance, please let me know if I can provide any additional information.

Here are the error messages that I am seeing when I view the runs of that pipeline. I also included a screen shot of how I'm setting up my trigger. enter image description here

enter image description here

Edit: As request I included the actual .yml file code below with slight naming modifications. We do have some custom plugins such as creating files for files that are untracked but still needed to be created. So you might need to remove those to test this.

trigger:
- none

pool:
  name: myPool
  demands:
  - msbuild
  - visualstudio

steps:

- task: NuGetToolInstaller@0
  displayName: 'Use NuGet 4.4.1'
  inputs:
    versionSpec: 4.4.1

- task: NuGetCommand@2
  displayName: 'NuGet restore'
  inputs:
    restoreSolution: '$(Parameters.solution)'

- task: eliostruyf.build-task.custom-build-task.file-creator@6
  displayName: 'Create Connection Strings file'
  inputs:
    filepath: '$(System.DefaultWorkingDirectory)/ID_Web/config/ConnectionStrings.config'
    filecontent: |
     <connectionStrings>
     
     </connectionStrings>
     
    endWithNewLine: true

- task: eliostruyf.build-task.custom-build-task.file-creator@6
  displayName: 'Create Developer Settings File'
  inputs:
    filepath: '$(System.DefaultWorkingDirectory)/ID_Web/config/developerAppSettings.config'
    filecontent: |
     <appSettings>

     </appSettings>
    endWithNewLine: true


- task: eliostruyf.build-task.custom-build-task.file-creator@6
  condition: contains(variables['Agent.Name'], '1')
  displayName: 'Create Developer Integration Setting for agent 1'
  inputs:
    filepath: '$(System.DefaultWorkingDirectory)/ID_Test/config/developerIntegrationSettings.config'
    filecontent: |
     <developerIntegrationSettings>
        <add key="ModelsIntegrationTestDb" value="Models_IntegrationTest_BuildAgent1"/>
        <add key="ErrorsIntegrationTestDb" value="Errors_IntegrationTest_BuildAgent1"/>
     </developerIntegrationSettings>
     
    endWithNewLine: true


- task: VisualStudioTestPlatformInstaller@1
  displayName: 'Visual Studio Test Platform Installer'
  inputs:
    versionSelector: latestStable

# Build the solution.
- task: VSBuild@1
  displayName: 'Build solution'
  inputs:
    solution: '$(Parameters.solution)'
    msbuildArgs: '/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:PackageLocation="$(build.artifactstagingdirectory)\\"'
    platform: '$(BuildPlatform)'
    configuration: '$(BuildConfiguration)'
    clean: true

# Run all unit tests in parallel
- task: VSTest@2
  displayName: 'Run Unit Tests'
  inputs:
    testAssemblyVer2: |
     **\*ID_Test*.dll
     !**\*TestAdapter.dll
     !**\obj\**
    searchFolder: '$(System.DefaultWorkingDirectory)/ID_Test'
    testFiltercriteria: '(FullyQualifiedName!~Integration & FullyQualifiedName!~Ioc)'
    runOnlyImpactedTests: false
    vsTestVersion: toolsInstaller
    runSettingsFile: 'ID_Test/.runsettings'
    runInParallel: true
    runTestsInIsolation: false
    codeCoverageEnabled: false
    testRunTitle: 'Unit Tests'
    platform: '$(BuildPlatform)'
    configuration: '$(BuildConfiguration)'
    diagnosticsEnabled: true
    rerunFailedTests: true

# Run integration tests serially
- task: VSTest@2
  displayName: 'Run Integration Tests'
  inputs:
    testAssemblyVer2: |
     **\*ID_Test*.dll
     !**\*TestAdapter.dll
     !**\obj\**
    searchFolder: '$(System.DefaultWorkingDirectory)/ID_Test'
    testFiltercriteria: '(FullyQualifiedName~Integration | FullyQualifiedName~Ioc)'
    runOnlyImpactedTests: false
    vsTestVersion: toolsInstaller
    runSettingsFile: 'ID_Test/.runsettings'
    runTestsInIsolation: true
    codeCoverageEnabled: false
    testRunTitle: 'Integration Tests'
    platform: '$(BuildPlatform)'
    configuration: '$(BuildConfiguration)'
    diagnosticsEnabled: true
    rerunFailedTests: true

# Clean agent directories
- task: mspremier.PostBuildCleanup.PostBuildCleanup-task.PostBuildCleanup@3
  displayName: 'Clean Agent Directories'

Edit (2): Included below is a screen shot of what I am using for trigger settings now, originally it was unchecked. Checking it doesn't seem to have any affect though. enter image description here

Andrew
  • 585
  • 1
  • 7
  • 17
  • Would you please share your complete YAML in your question with code instead of image, so that we could test it on my side. BTW, share a image about your Triggers settings. – Leo Liu Nov 13 '20 at 08:52
  • Added both of those. Please let me know if I can provide any more info. – Andrew Nov 13 '20 at 19:12

3 Answers3

31

I had the same and was about to curl up in a ball and cry when I found out the real issue. As the wonderful message is saying, it has absolutely nothing to do with trigger :)

I assume you created a new branch with your YAML file for testing purpose before merging it to master. So you need to setup your build to point to this branch because the file doesn't exist on your main branch. Here the steps :

  • Edit your pipeline
  • Click the 3 dots on top right > Triggers
  • Click YAML tab > Get sources
  • Change the 'Default branch for manual and scheduled builds' to point to the branch where your .yml file is

enter image description here

Christophe P
  • 860
  • 1
  • 12
  • 10
  • 2
    Perfectly solved my issue. Thanks! – Jesse Johnson Dec 23 '21 at 17:25
  • 3
    Had the exact same problem, except for some reason the "Default branch for manual and scheduled builds" was already set on "main". I just had to change the drop down to a different branch, set it back to "main", and then save to make the error go away. – CurtisHx Jan 05 '22 at 19:55
  • Change the drop down to a different branch, set it back to "main" - Also fixes already resolved issues with the banner not going away – Martin Oct 04 '22 at 10:12
  • Exactly the problem I had – tasin95 Jun 21 '23 at 14:11
3

So we gave up on this problem since it wasn't having any effect and we couldn't find the problem. After about a week or two it just stopped showing up. So I assume this was just some quirk with the Azure DevOps and not a problem with the pipeline itself.

Andrew
  • 585
  • 1
  • 7
  • 17
1

According to your description, this issue looks more like an episodic issue. In YAML files, you don't have to include triggers. YAML pipelines are configured by default with a CI trigger on all branches. You can create a new pipeline and copy your YAML file to see if there are still any error messages.

Or, the issue could come from Classic UI triggers. On the pipeline editing page, select More actions-> Triggers.

enter image description here

Then you can check if there is anything illegal. If you want to use the trigger in the YAML file, leave the ' Override the YAML continuous integration trigger from here' check box off.

Jane Ma-MSFT
  • 4,461
  • 1
  • 6
  • 12
  • Thanks for the response. I tried creating a new pipeline with the same YAML file but the same error message came up, so it might be an issue with something else in my YAML. But replacing it with YAML code from another pipeline that doesn't have that error still didn't remove it. I messed around with the UI triggers but that didn't seem to have any affect unfortunately. – Andrew Nov 12 '20 at 16:25
  • There are triggers like ACR based triggers that should fire when an image has been pushed and you have to declare these in the yaml – Patrick Cornelissen Mar 01 '22 at 09:53