<commit_before>resources:
- repo: self
  clean: true

# Variables defined in yml cannot be overridden at queue time instead overrideable variables must be defined in the web gui.
# Commenting out until AzDO supports something like the runtime parameters outlined here: https://github.com/Microsoft/azure-pipelines-yaml/pull/129
#variables:
#  SignType: real
#  SkipTests: false
#  SkipApplyOptimizationData: false
#  IbcSourceBranchName: 'default'
#  IbcDropId: 'default'
#  PrNumber: 'default'

# The variables `_DotNetArtifactsCategory` and `_DotNetValidationArtifactsCategory` are required for proper publishing of build artifacts. See https://github.com/dotnet/roslyn/pull/38259
variables:
  - name: _DotNetArtifactsCategory
    value: .NETCore
  - name: _DotNetValidationArtifactsCategory
    value: .NETCoreValidation

stages:
- stage: build
  displayName: Build and Test

  jobs:
  - job: OfficialBuild
    displayName: Official Build
    pool:
      name: VSEng-MicroBuildVS2017
      demands: 
      - msbuild
      - visualstudio
      - DotNetFramework
    timeoutInMinutes: 360

    steps:
    - powershell: Write-Host "##vso[task.setvariable variable=SourceBranchName]$('$(Build.SourceBranch)'.Substring('refs/heads/'.Length))"
      displayName: Setting SourceBranchName variable

    - powershell: |
        if ($SourceBranchname -notlike '*-vs-deps') {
          Write-Host  "##vso[task.LogIssue type=warning;]The base branch for insertion validation is $(SourceBranchname), which is not a vs-deps branch."
        }
        git pull origin refs/pull/$(PrNumber)/merge
        if (!$?) {
          Write-Host  "##vso[task.LogIssue type=error;]Merging with branch refs/pull/$(PrNumber)/merge failed."
          exit 1
        }
      displayName: Setup branch for insertion validation
      condition: and(succeeded(), ne(variables['PrNumber'], ''), ne(variables['PrNumber'], 'default'))

    - powershell: Write-Host "##vso[task.setvariable variable=VisualStudio.DropName]Products/$(System.TeamProject)/$(Build.Repository.Name)/$(SourceBranchName)/$(Build.BuildNumber)"
      displayName: Setting VisualStudio.DropName variable

    - task: NuGetToolInstaller@0
      inputs:<commit_msg>Fix task<commit_after>resources:
- repo: self
  clean: true

# Variables defined in yml cannot be overridden at queue time instead overrideable variables must be defined in the web gui.
# Commenting out until AzDO supports something like the runtime parameters outlined here: https://github.com/Microsoft/azure-pipelines-yaml/pull/129
#variables:
#  SignType: real
#  SkipTests: false
#  SkipApplyOptimizationData: false
#  IbcSourceBranchName: 'default'
#  IbcDropId: 'default'
#  PrNumber: 'default'

# The variables `_DotNetArtifactsCategory` and `_DotNetValidationArtifactsCategory` are required for proper publishing of build artifacts. See https://github.com/dotnet/roslyn/pull/38259
variables:
  - name: _DotNetArtifactsCategory
    value: .NETCore
  - name: _DotNetValidationArtifactsCategory
    value: .NETCoreValidation

stages:
- stage: build
  displayName: Build and Test

  jobs:
  - job: OfficialBuild
    displayName: Official Build
    pool:
      name: VSEng-MicroBuildVS2017
      demands: 
      - msbuild
      - visualstudio
      - DotNetFramework
    timeoutInMinutes: 360

    steps:
    - powershell: Write-Host "##vso[task.setvariable variable=SourceBranchName]$('$(Build.SourceBranch)'.Substring('refs/heads/'.Length))"
      displayName: Setting SourceBranchName variable

    - powershell: |
        Write-Host "Setting up the build for PR validation by merging refs/pull/$(PrNumber)/merge into $(SourceBranchName)."
        if ($SourceBranchName -notlike '*-vs-deps') {
          Write-Host  "##vso[task.LogIssue type=warning;]The base branch for insertion validation is $(SourceBranchName), which is not a vs-deps branch."
        }
        git pull origin refs/pull/$(PrNumber)/merge
        if (!$?) {
          Write-Host  "##vso[task.LogIssue type=error;]Merging with branch refs/pull/$(PrNumber)/merge failed."
          exit 1
        }
      displayName: Setup branch for insertion validation
      condition: and(succeeded(), ne(variables['PrNumber'], ''), ne(variables['PrNumber'], 'default'))

    - powershell: Write-Host "##vso[task.setvariable variable=VisualStudio.DropName]Products/$(System.TeamProject)/$(Build.Repository.Name)/$(SourceBranchName)/$(Build.BuildNumber)"
      displayName: Setting VisualStudio.DropName variable

    - task: NuGetToolInstaller@0
      inputs:
{'fraction_non_alphanumeric': 0.10627485638532921, 'fraction_numerical': 0.007512152010605391, 'mean_word_length': 3.805732484076433, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2200993', 'n_tokens_mistral': 1353, 'n_tokens_neox': 1301, 'n_words': 341}