From f394ae84ccb43f2738cae35fbdec30e20e041693 Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Wed, 14 Apr 2021 22:37:47 -0700 Subject: [PATCH] Sync eng/common directory with azure-sdk-tools for PR 1559 (#18064) * Handle empty files in Test-SampleMetadata Relates to Azure/azure-sdk-for-java#20684 * Remove condition from verify-samples * Use forward slash in path * Fix directory typo * Remove invalid 'telemetry' product slug Relates to #17991 * Disable verify-samples template Opened #18066 to track re-enabling it. Co-authored-by: Heath Stewart --- eng/common/pipelines/templates/steps/verify-samples.yml | 8 ++------ eng/common/scripts/Test-SampleMetadata.ps1 | 4 +++- eng/pipelines/templates/steps/analyze.yml | 6 +++--- .../azure-core-tracing-opentelemetry/samples/README.md | 1 - 4 files changed, 8 insertions(+), 11 deletions(-) diff --git a/eng/common/pipelines/templates/steps/verify-samples.yml b/eng/common/pipelines/templates/steps/verify-samples.yml index fcd87d2cc911..fef0f4ddd8c7 100644 --- a/eng/common/pipelines/templates/steps/verify-samples.yml +++ b/eng/common/pipelines/templates/steps/verify-samples.yml @@ -5,15 +5,11 @@ parameters: - name: ScriptDirectory type: string default: eng/common/scripts - - name: Condition - type: boolean - default: succeeded() steps: - pwsh: | # If the last path segment is an absolute path it will be used entirely. - $root = [System.IO.Path]::Combine('$(Build.SourcesDireectory)', 'sdk', '${{ parameters.ServiceDirectory }}') - Get-ChildItem $root -Filter *.md -Recurse | ${{ parameters.ScriptDirectory }}\Test-SampleMetadata.ps1 -AllowParentProducts + $root = [System.IO.Path]::Combine('$(Build.SourcesDirectory)', 'sdk', '${{ parameters.ServiceDirectory }}') + Get-ChildItem $root -Filter *.md -Recurse | ${{ parameters.ScriptDirectory }}/Test-SampleMetadata.ps1 -AllowParentProducts displayName: Verify sample metadata workingDirectory: $(Build.SourcesDirectory) - condition: ${{ parameters.Condition }} diff --git a/eng/common/scripts/Test-SampleMetadata.ps1 b/eng/common/scripts/Test-SampleMetadata.ps1 index cd74690cae57..523aeb31dd8a 100644 --- a/eng/common/scripts/Test-SampleMetadata.ps1 +++ b/eng/common/scripts/Test-SampleMetadata.ps1 @@ -31,11 +31,13 @@ process { } [string[]] $content = $file | Get-Content - if (!$content[0].StartsWith('---')) { + if (!$content -or !$content[0].StartsWith('---')) { Write-Verbose "Skipping $($file.FullName): does not contain frontmatter" continue } + Write-Verbose "Checking $($file.FullName)" + # Reset metadata and create mutable collections. $products = [System.Collections.Generic.List[string]]::new() diff --git a/eng/pipelines/templates/steps/analyze.yml b/eng/pipelines/templates/steps/analyze.yml index 2ae21bc7fbd2..2fa3a873199c 100644 --- a/eng/pipelines/templates/steps/analyze.yml +++ b/eng/pipelines/templates/steps/analyze.yml @@ -23,9 +23,9 @@ steps: ServiceName: ${{parameters.ServiceDirectory}} ForRelease: false - - template: /eng/common/pipelines/templates/steps/verify-samples.yml - parameters: - ServiceDirectory: ${{parameters.ServiceDirectory}} +# - 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 diff --git a/sdk/core/azure-core-tracing-opentelemetry/samples/README.md b/sdk/core/azure-core-tracing-opentelemetry/samples/README.md index c126113b65d3..9e802d86a213 100644 --- a/sdk/core/azure-core-tracing-opentelemetry/samples/README.md +++ b/sdk/core/azure-core-tracing-opentelemetry/samples/README.md @@ -4,7 +4,6 @@ languages: - python products: - azure - - azure-core-tracing-opentelemetry urlFragment: azure-core-tracing-opentelemetry-samples ---