Skip to content

Commit e4f6c83

Browse files
committed
Add Get-ClassTypeNameFromDataFile function and update documentation links
1 parent 1073171 commit e4f6c83

File tree

2 files changed

+35
-9
lines changed

2 files changed

+35
-9
lines changed

.powershell/docs/Get-DiscussionId.ps1

Lines changed: 31 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -418,6 +418,28 @@ function Get-ClassNameFromDataFile {
418418
}
419419
}
420420

421+
# Function to get class name from data file
422+
function Get-ClassTypeNameFromDataFile {
423+
param(
424+
[string]$DataFilePath
425+
)
426+
427+
if (-not (Test-Path $DataFilePath)) {
428+
Write-WarningLog "Data file not found: $DataFilePath"
429+
return $null
430+
}
431+
432+
try {
433+
$yamlContent = Get-Content -Path $DataFilePath -Raw
434+
$data = ConvertFrom-Yaml -Yaml $yamlContent
435+
return $data.typeName
436+
}
437+
catch {
438+
Write-WarningLog "Failed to parse data file $DataFilePath : $($_.Exception.Message)"
439+
return $null
440+
}
441+
}
442+
421443
# Function to convert class name to friendly name
422444
function Convert-ClassNameToFriendlyName {
423445
param(
@@ -457,9 +479,11 @@ function Find-OrCreateDiscussion {
457479

458480
# Get class name from data file if available
459481
$className = $null
482+
$classTypeName = "unknown"
460483
if ($dataFile) {
461-
$dataFilePath = Join-Path ".\docs\" $dataFile
484+
$dataFilePath = Join-Path ".\docs\data\classes\" $dataFile
462485
$className = Get-ClassNameFromDataFile -DataFilePath $dataFilePath
486+
$classTypeName = Get-ClassTypeNameFromDataFile -DataFilePath $dataFilePath
463487
}
464488

465489
# Convert class name to friendly name
@@ -490,7 +514,7 @@ function Find-OrCreateDiscussion {
490514
# Generate updated discussion body to ensure consistency
491515
$docUrl = ""
492516
if ($hugoMarkdown.FrontMatter.slug) {
493-
$docUrl = "https://devopsmigration.io/docs/reference/$($hugoMarkdown.FrontMatter.slug)/"
517+
$docUrl = "https://devopsmigration.io/docs/reference/$classTypeName/$($hugoMarkdown.FrontMatter.slug)/"
494518
}
495519
elseif ($hugoMarkdown.ReferencePath) {
496520
$relativePath = $hugoMarkdown.ReferencePath.Replace('docs/', '').Replace('\', '/')
@@ -535,7 +559,7 @@ function Find-OrCreateDiscussion {
535559
# Generate documentation URL
536560
$docUrl = ""
537561
if ($hugoMarkdown.FrontMatter.slug) {
538-
$docUrl = "https://devopsmigration.io/docs/reference/$($hugoMarkdown.FrontMatter.slug)/"
562+
$docUrl = "https://devopsmigration.io/docs/reference/$classTypeName/$($hugoMarkdown.FrontMatter.slug)/"
539563
}
540564
elseif ($hugoMarkdown.ReferencePath) {
541565
$relativePath = $hugoMarkdown.ReferencePath.Replace('docs/', '').Replace('\', '/')
@@ -740,10 +764,12 @@ foreach ($hugoMarkdown in $hugoMarkdownObjects) {
740764
if ($existingDiscussion) {
741765
# Get class name from data file if available
742766
$className = $null
767+
$classTypeName = "unknown"
743768
$dataFile = $hugoMarkdown.FrontMatter.dataFile
744769
if ($dataFile) {
745-
$dataFilePath = Join-Path ".\docs\" $dataFile
770+
$dataFilePath = Join-Path ".\docs\data\classes\" $dataFile
746771
$className = Get-ClassNameFromDataFile -DataFilePath $dataFilePath
772+
$classTypeName = (Get-ClassTypeNameFromDataFile -DataFilePath $dataFilePath).ToLower()
747773
}
748774

749775
# Convert class name to friendly name
@@ -752,7 +778,7 @@ foreach ($hugoMarkdown in $hugoMarkdownObjects) {
752778
# Generate documentation URL
753779
$docUrl = ""
754780
if ($hugoMarkdown.FrontMatter.slug) {
755-
$docUrl = "https://devopsmigration.io/docs/reference/$($hugoMarkdown.FrontMatter.slug)/"
781+
$docUrl = "https://devopsmigration.io/docs/reference/$classTypeName/$($hugoMarkdown.FrontMatter.slug)/"
756782
}
757783
elseif ($hugoMarkdown.ReferencePath) {
758784
$relativePath = $hugoMarkdown.ReferencePath.Replace('\', '/')

docs/content/docs/get-started/validation/index.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
---
2-
title: "Validating your Azure DevOps Migration Tools migration"
2+
title: Validating your Azure DevOps Migration Tools migration
33
description: This tutorial covers the steps to validate and verify your migration using the Azure DevOps Migration Tools.
44
short_title: Get Validated
55
weight: 10
66
aliases:
7-
- /validation/
7+
- /validation/
88
date: 2025-09-01T09:00:00Z
9+
discussionId: 2978
910

1011
---
11-
1212
The Azure DevOps Migration Tools use a two-step validation process to ensure a smooth and successful migration. This process helps catch configuration or data issues early, saving time and preventing unnecessary data loading when migration cannot proceed.
1313

1414
## 1. Pre-Data-Load Validation
@@ -36,4 +36,4 @@ By running validation both before and after data loading, the migration process
3636

3737
For more details on each validator, see their dedicated documentation pages:
3838
- [`TfsWorkItemTypeValidatorTool`]({{< ref "/docs/reference/tools/tfsworkitemtypevalidatortool/" >}})
39-
- [`TfsValidateRequiredFieldTool`]({{< ref "/docs/reference/tools/tfsvalidaterequiredfieldtool/" >}})
39+
- [`TfsValidateRequiredFieldTool`]({{< ref "/docs/reference/tools/tfsvalidaterequiredfieldtool/" >}})

0 commit comments

Comments
 (0)