<commit_before>parameters:
  BuildTargetingString: 'azure-*'
  ServiceDirectory: ''
  TestMarkArgument: ''
  AdditionalTestArgs: ''
  Artifacts: []
  TestPipeline: false
  VerifyAutorest: false
  ValidateFormatting: false

steps:
  - template: /eng/pipelines/templates/steps/analyze_dependency.yml

  - template: /eng/common/pipelines/templates/steps/set-test-pipeline-version.yml
    parameters:
      PackageName: "azure-template"
      ServiceDirectory: "template"
      TestPipeline: ${{ parameters.TestPipeline }}

  - ${{ each artifact in parameters.Artifacts }}:
    - ${{if ne(artifact.skipVerifyChangeLog, 'true')}}:
      - template: /eng/common/pipelines/templates/steps/verify-changelog.yml
        parameters:
          PackageName: ${{artifact.name}}
          ServiceName: ${{parameters.ServiceDirectory}}
          ForRelease: false

# - template: /eng/common/pipelines/templates/steps/verify-samples.yml
#   parameters:
#     ServiceDirectory: ${{parameters.ServiceDirectory}}

    # Using --always-succeed so as not to block the build. Once package
    # target is based on data available per-package the --always-succeed should
    # be removed so this script can help enforce correct practices
    # (https://github.com/Azure/azure-sdk-for-python/issues/8697)


  - pwsh: |
     pip install -r eng/ci_tools.txt $(if($IsWindows) {"--user" })
    displayName: 'Install Necessary Dependencies'
    condition: succeededOrFailed()

  - script: |
      cd eng/versioning
      pip install -r requirements.txt
      python find_invalid_versions.py --always-succeed --service=${{parameters.ServiceDirectory}}
    displayName: Find Invalid Versions
    condition: succeededOrFailed()

  - pwsh: |
      Get-ChildItem $(Build.SourcesDirectory) -Filter "*.py" |
      Foreach-Object {
        if ((Get-Content $_ -Raw) -match "\r\n") {
          Write-Error "Found CRLF line ending in `$_`"
        }
      }

      Get-ChildItem $(Build.SourcesDirectory) -Filter "*.md" |
      Foreach-Object {
        if ((Get-Content $_ -Raw) -match "\r\n") {
          Write-Error "Found CRLF line ending in `$_`"
        }
      }
    displayName: Check for CRLF Line endings

  - template: /eng/common/pipelines/templates/steps/verify-path-length.yml
    parameters:
      SourceDirectory: $(Build.SourcesDirectory)

  - template: ../steps/verify-autorest.yml
    parameters:
      ServiceDirectory: ${{ parameters.ServiceDirectory }}
      VerifyAutorest: ${{ parameters.VerifyAutorest }}

  - task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0
    # ComponentGovernance is currently unable to run on pull requests of public projects. Running on non-PR
    # builds should be sufficient.
    condition: and(succeededOrFailed(), ne(variables['Build.Reason'],'PullRequest'))
    displayName: 'Component Detection'

  - task: PythonScript@0
    displayName: 'Verify sdist'
    condition: and(succeededOrFailed(), ne(variables['Skip.VerifySdist'],'true'))
    inputs:
     scriptPath: 'scripts/devops_tasks/setup_execute_tests.py'
     arguments: '"${{ parameters.BuildTargetingString }}" --service=${{parameters.ServiceDirectory}} --toxenv=verifysdist'

  - task: PythonScript@0
    displayName: 'Verify whl'
    condition: and(succeededOrFailed(), ne(variables['Skip.VerifyWhl'],'true'))
    inputs:
     scriptPath: 'scripts/devops_tasks/setup_execute_tests.py'
     arguments: '"${{ parameters.BuildTargetingString }}" --service=${{parameters.ServiceDirectory}} --toxenv=verifywhl'

  - template: run_mypy.yml
    parameters:
      ServiceDirectory: ${{ parameters.ServiceDirectory }}
      BuildTargetingString: ${{ parameters.BuildTargetingString }}
      TestMarkArgument: ${{ parameters.TestMarkArgument }}

  - template: run_pylint.yml
    parameters:
      ServiceDirectory: ${{ parameters.ServiceDirectory }}
      BuildTargetingString: ${{ parameters.BuildTargetingString }}

  - ${{ if parameters.ValidateFormatting }}:
    - template: run_black.yml
      parameters:
        ServiceDirectory: ${{ parameters.ServiceDirectory }}
        BuildTargetingString: ${{ parameters.BuildTargetingString }}
        ValidateFormatting: ${{ parameters.ValidateFormatting }}

  - task: DownloadPipelineArtifact@2
    condition: succeededOrFailed()
    inputs:
      artifactName: 'packages'
      targetPath: $(Build.ArtifactStagingDirectory)

  - template: ../steps/run_apistub.yml
    parameters:
      ServiceDirectory: ${{ parameters.ServiceDirectory }}
      BuildTargetingString: ${{ parameters.BuildTargetingString }}
      TestMarkArgument: ${{ parameters.TestMarkArgument }}
      AdditionalTestArgs: ${{parameters.AdditionalTestArgs}}

  - template: ../steps/run_bandit.yml
    parameters:
      ServiceDirectory: ${{ parameters.ServiceDirectory }}
      BuildTargetingString: ${{ parameters.BuildTargetingString }}
      TestMarkArgument: ${{ parameters.TestMarkArgument }}
      AdditionalTestArgs: ${{parameters.AdditionalTestArgs}}

  - template: ../steps/run_breaking_changes.yml
    parameters:
      ServiceDirectory: ${{ parameters.ServiceDirectory }}
      BuildTargetingString: ${{ parameters.BuildTargetingString }}
      TestMarkArgument: ${{ parameters.TestMarkArgument }}
      AdditionalTestArgs: ${{parameters.AdditionalTestArgs}}

  - template: /eng/common/pipelines/templates/steps/create-apireview.yml
    parameters:
      Artifacts: ${{ parameters.Artifacts }}

  - template: /eng/common/pipelines/templates/steps/detect-api-changes.yml
    parameters:
      Artifacts: ${{ parameters.Artifacts }}

  - template: /eng/common/pipelines/templates/steps/eng-common-workflow-enforcer.yml

  - template: /eng/common/pipelines/templates/steps/publish-artifact.yml
    parameters:
      ArtifactPath: '$(Build.ArtifactStagingDirectory)/reports'
      ArtifactName: 'reports'<commit_msg>Disable api change detection (#20892)<commit_after>parameters:
  BuildTargetingString: 'azure-*'
  ServiceDirectory: ''
  TestMarkArgument: ''
  AdditionalTestArgs: ''
  Artifacts: []
  TestPipeline: false
  VerifyAutorest: false
  ValidateFormatting: false

steps:
  - template: /eng/pipelines/templates/steps/analyze_dependency.yml

  - template: /eng/common/pipelines/templates/steps/set-test-pipeline-version.yml
    parameters:
      PackageName: "azure-template"
      ServiceDirectory: "template"
      TestPipeline: ${{ parameters.TestPipeline }}

  - ${{ each artifact in parameters.Artifacts }}:
    - ${{if ne(artifact.skipVerifyChangeLog, 'true')}}:
      - template: /eng/common/pipelines/templates/steps/verify-changelog.yml
        parameters:
          PackageName: ${{artifact.name}}
          ServiceName: ${{parameters.ServiceDirectory}}
          ForRelease: false

# - template: /eng/common/pipelines/templates/steps/verify-samples.yml
#   parameters:
#     ServiceDirectory: ${{parameters.ServiceDirectory}}

    # Using --always-succeed so as not to block the build. Once package
    # target is based on data available per-package the --always-succeed should
    # be removed so this script can help enforce correct practices
    # (https://github.com/Azure/azure-sdk-for-python/issues/8697)


  - pwsh: |
     pip install -r eng/ci_tools.txt $(if($IsWindows) {"--user" })
    displayName: 'Install Necessary Dependencies'
    condition: succeededOrFailed()

  - script: |
      cd eng/versioning
      pip install -r requirements.txt
      python find_invalid_versions.py --always-succeed --service=${{parameters.ServiceDirectory}}
    displayName: Find Invalid Versions
    condition: succeededOrFailed()

  - pwsh: |
      Get-ChildItem $(Build.SourcesDirectory) -Filter "*.py" |
      Foreach-Object {
        if ((Get-Content $_ -Raw) -match "\r\n") {
          Write-Error "Found CRLF line ending in `$_`"
        }
      }

      Get-ChildItem $(Build.SourcesDirectory) -Filter "*.md" |
      Foreach-Object {
        if ((Get-Content $_ -Raw) -match "\r\n") {
          Write-Error "Found CRLF line ending in `$_`"
        }
      }
    displayName: Check for CRLF Line endings

  - template: /eng/common/pipelines/templates/steps/verify-path-length.yml
    parameters:
      SourceDirectory: $(Build.SourcesDirectory)

  - template: ../steps/verify-autorest.yml
    parameters:
      ServiceDirectory: ${{ parameters.ServiceDirectory }}
      VerifyAutorest: ${{ parameters.VerifyAutorest }}

  - task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0
    # ComponentGovernance is currently unable to run on pull requests of public projects. Running on non-PR
    # builds should be sufficient.
    condition: and(succeededOrFailed(), ne(variables['Build.Reason'],'PullRequest'))
    displayName: 'Component Detection'

  - task: PythonScript@0
    displayName: 'Verify sdist'
    condition: and(succeededOrFailed(), ne(variables['Skip.VerifySdist'],'true'))
    inputs:
     scriptPath: 'scripts/devops_tasks/setup_execute_tests.py'
     arguments: '"${{ parameters.BuildTargetingString }}" --service=${{parameters.ServiceDirectory}} --toxenv=verifysdist'

  - task: PythonScript@0
    displayName: 'Verify whl'
    condition: and(succeededOrFailed(), ne(variables['Skip.VerifyWhl'],'true'))
    inputs:
     scriptPath: 'scripts/devops_tasks/setup_execute_tests.py'
     arguments: '"${{ parameters.BuildTargetingString }}" --service=${{parameters.ServiceDirectory}} --toxenv=verifywhl'

  - template: run_mypy.yml
    parameters:
      ServiceDirectory: ${{ parameters.ServiceDirectory }}
      BuildTargetingString: ${{ parameters.BuildTargetingString }}
      TestMarkArgument: ${{ parameters.TestMarkArgument }}

  - template: run_pylint.yml
    parameters:
      ServiceDirectory: ${{ parameters.ServiceDirectory }}
      BuildTargetingString: ${{ parameters.BuildTargetingString }}

  - ${{ if parameters.ValidateFormatting }}:
    - template: run_black.yml
      parameters:
        ServiceDirectory: ${{ parameters.ServiceDirectory }}
        BuildTargetingString: ${{ parameters.BuildTargetingString }}
        ValidateFormatting: ${{ parameters.ValidateFormatting }}

  - task: DownloadPipelineArtifact@2
    condition: succeededOrFailed()
    inputs:
      artifactName: 'packages'
      targetPath: $(Build.ArtifactStagingDirectory)

  - template: ../steps/run_apistub.yml
    parameters:
      ServiceDirectory: ${{ parameters.ServiceDirectory }}
      BuildTargetingString: ${{ parameters.BuildTargetingString }}
      TestMarkArgument: ${{ parameters.TestMarkArgument }}
      AdditionalTestArgs: ${{parameters.AdditionalTestArgs}}

  - template: ../steps/run_bandit.yml
    parameters:
      ServiceDirectory: ${{ parameters.ServiceDirectory }}
      BuildTargetingString: ${{ parameters.BuildTargetingString }}
      TestMarkArgument: ${{ parameters.TestMarkArgument }}
      AdditionalTestArgs: ${{parameters.AdditionalTestArgs}}

  - template: ../steps/run_breaking_changes.yml
    parameters:
      ServiceDirectory: ${{ parameters.ServiceDirectory }}
      BuildTargetingString: ${{ parameters.BuildTargetingString }}
      TestMarkArgument: ${{ parameters.TestMarkArgument }}
      AdditionalTestArgs: ${{parameters.AdditionalTestArgs}}

  - template: /eng/common/pipelines/templates/steps/create-apireview.yml
    parameters:
      Artifacts: ${{ parameters.Artifacts }}

  - template: /eng/common/pipelines/templates/steps/eng-common-workflow-enforcer.yml

  - template: /eng/common/pipelines/templates/steps/publish-artifact.yml
    parameters:
      ArtifactPath: '$(Build.ArtifactStagingDirectory)/reports'
      ArtifactName: 'reports'
{'fraction_non_alphanumeric': 0.12277534175909208, 'fraction_numerical': 0.0018055197317513542, 'mean_word_length': 3.6287306008754476, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1677537', 'n_tokens_mistral': 3371, 'n_tokens_neox': 3155, 'n_words': 606}