From ed33287042e75ca5b8da857e07417cacc0bdc212 Mon Sep 17 00:00:00 2001 From: Heath Stewart Date: Wed, 14 Apr 2021 18:28:37 -0700 Subject: [PATCH 1/6] Handle empty files in Test-SampleMetadata Relates to Azure/azure-sdk-for-java#20684 --- eng/common/scripts/Test-SampleMetadata.ps1 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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() From 93291eafb12e601b259853f51e539b83c05c711a Mon Sep 17 00:00:00 2001 From: Heath Stewart Date: Wed, 14 Apr 2021 18:38:31 -0700 Subject: [PATCH 2/6] Remove condition from verify-samples --- eng/common/pipelines/templates/steps/verify-samples.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/eng/common/pipelines/templates/steps/verify-samples.yml b/eng/common/pipelines/templates/steps/verify-samples.yml index fcd87d2cc911..05844393c026 100644 --- a/eng/common/pipelines/templates/steps/verify-samples.yml +++ b/eng/common/pipelines/templates/steps/verify-samples.yml @@ -5,9 +5,6 @@ parameters: - name: ScriptDirectory type: string default: eng/common/scripts - - name: Condition - type: boolean - default: succeeded() steps: - pwsh: | @@ -16,4 +13,3 @@ steps: Get-ChildItem $root -Filter *.md -Recurse | ${{ parameters.ScriptDirectory }}\Test-SampleMetadata.ps1 -AllowParentProducts displayName: Verify sample metadata workingDirectory: $(Build.SourcesDirectory) - condition: ${{ parameters.Condition }} From ef61fd09f37662fdf30c872d19869351711d481f Mon Sep 17 00:00:00 2001 From: Heath Stewart Date: Wed, 14 Apr 2021 19:02:41 -0700 Subject: [PATCH 3/6] Use forward slash in path --- eng/common/pipelines/templates/steps/verify-samples.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/common/pipelines/templates/steps/verify-samples.yml b/eng/common/pipelines/templates/steps/verify-samples.yml index 05844393c026..78d1b85215a5 100644 --- a/eng/common/pipelines/templates/steps/verify-samples.yml +++ b/eng/common/pipelines/templates/steps/verify-samples.yml @@ -10,6 +10,6 @@ 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 + Get-ChildItem $root -Filter *.md -Recurse | ${{ parameters.ScriptDirectory }}/Test-SampleMetadata.ps1 -AllowParentProducts displayName: Verify sample metadata workingDirectory: $(Build.SourcesDirectory) From 335ffb1f25e6c260d23fa050bd548d0472d59f06 Mon Sep 17 00:00:00 2001 From: Heath Stewart Date: Wed, 14 Apr 2021 19:20:48 -0700 Subject: [PATCH 4/6] Fix directory typo --- eng/common/pipelines/templates/steps/verify-samples.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/common/pipelines/templates/steps/verify-samples.yml b/eng/common/pipelines/templates/steps/verify-samples.yml index 78d1b85215a5..fef0f4ddd8c7 100644 --- a/eng/common/pipelines/templates/steps/verify-samples.yml +++ b/eng/common/pipelines/templates/steps/verify-samples.yml @@ -9,7 +9,7 @@ parameters: 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 }}') + $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) From 11fd9ef8d1747597937c07e653d8d050b1cdcb24 Mon Sep 17 00:00:00 2001 From: Heath Stewart Date: Wed, 14 Apr 2021 21:23:59 -0700 Subject: [PATCH 5/6] Remove invalid 'telemetry' product slug Relates to #17991 --- sdk/core/azure-core-tracing-opentelemetry/samples/README.md | 1 - 1 file changed, 1 deletion(-) 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 --- From f53a0cd9495b18138df0dc50191a3bab7c4241a8 Mon Sep 17 00:00:00 2001 From: Heath Stewart Date: Wed, 14 Apr 2021 21:44:27 -0700 Subject: [PATCH 6/6] Disable verify-samples template Opened #18066 to track re-enabling it. --- eng/pipelines/templates/steps/analyze.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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