Skip to content

Commit 7f8799b

Browse files
Adding Linux Support (#34)
* Linux Support * Remove v1 files * Simplified build steps --------- Co-authored-by: Ritesh Kumar Sinha <risinh@microsoft.com>
1 parent f278ede commit 7f8799b

30 files changed

+5940
-326
lines changed

.github/workflows/lint.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
uses: super-linter/super-linter/slim@v7.3.0 # x-release-please-version
2828
env:
2929
MULTI_STATUS: false
30-
FILTER_REGEX_EXCLUDE: (.*tests/snapshots/.*\.md|SECURITY\.md|SUPPORT\.md|.*\.js$)
30+
FILTER_REGEX_EXCLUDE: (.*tests/snapshots/.*\.md|SECURITY\.md|SUPPORT\.md|.*\.js|.*/V1/.*$)
3131
VALIDATE_TSX: false
3232
VALIDATE_TYPESCRIPT_ES: false
3333
VALIDATE_TYPESCRIPT_PRETTIER: false

scripts/download-previousVersions.ps1

Lines changed: 0 additions & 52 deletions
This file was deleted.

scripts/download-vstsTaskSdk.ps1

Lines changed: 0 additions & 70 deletions
This file was deleted.

scripts/set-variables.ps1

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,4 @@ $prodExtensionDir = Join-Path -Path $repoRoot -ChildPath "out/prod"
77

88
$utilsPath = Join-Path -Path $repoRoot -ChildPath "scripts/utilities.ps1"
99

10-
$versions = @("V1", "V2")
11-
$latestVersion = "V2"
12-
13-
$tempDir = Join-Path -Path $repoRoot -ChildPath "out/temp"
14-
1510
$devTaskId = "6c8d5e8b-16f2-4f7b-b991-99e3dfa9f359"
16-
17-
$gitRepoOwner = "microsoft"
18-
$gitRepoName = "ai-agent-evals"
19-
$gitRepoUrl = "https://github.com/$gitRepoOwner/$gitRepoName"
20-
$gitTagsApiUrl = "https://api.github.com/repos/$gitRepoOwner/$gitRepoName/tags"
21-
$gitHeaders = @{ "User-Agent" = "PowerShell" }

scripts/setup-dev.ps1

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,12 @@ if ($buildResultsContribution) {
3838
$agentEvalContribution = $vssExtension.contributions | Where-Object { $_.id -eq "AIAgentEvaluation" }
3939
if ($agentEvalContribution) {
4040
$agentEvalContribution.id = "AIAgentEvaluationDev"
41-
$agentEvalContribution.properties.name = "tasks/AIAgentEvaluation"
4241
}
4342

4443
$vssExtension | ConvertTo-Json -Depth 10 | Set-Content -Path "$devExtensionDir/vss-extension.json" -Encoding UTF8
44+
4545
$versions = @("V1", "V2")
46+
4647
foreach ($version in $versions) {
4748
$taskJsonPath = Join-Path $devExtensionDir "tasks/AIAgentEvaluation/$version/task.json"
4849
$taskJson = Get-Content -Path $taskJsonPath -Raw | ConvertFrom-Json
@@ -55,9 +56,10 @@ foreach ($version in $versions) {
5556
Write-Host "Created modified task.json at: $taskJsonPath"
5657
}
5758

58-
$validate = Check-CriticalFiles -OutputDir $devExtensionDir -IsDevExtension $true
59-
if (-not $validate) {
60-
Write-Error "Critical files check failed for production extension"
59+
$criticalFileChecks = Check-CriticalFiles -OutputDir $devExtensionDir -IsDevExtension $true
60+
if (-not $criticalFileChecks) {
61+
Write-Error "Critical files check failed. Ensure all required files are present in the output directory."
6162
exit 1
6263
}
63-
Write-Host "Critical files check passed for production extension" -ForegroundColor Green
64+
Write-Host "✅ Dev extension setup complete. Files copied to '$devExtensionDir'."
65+

scripts/setup.ps1

Lines changed: 20 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,23 @@ try {
2525
Pop-Location
2626
}
2727

28+
Write-Host "Building AIAgentEvaluation"
29+
$evalPath = Join-Path -Path $repoRoot -ChildPath "tasks/AIAgentEvaluation"
30+
Push-Location -Path $evalPath
31+
try {
32+
$setupScriptPath = Join-Path -Path $evalPath -ChildPath "build.ps1"
33+
& $setupScriptPath
34+
Write-Host "AIAgentEvaluation build completed successfully" -ForegroundColor Green
35+
}
36+
catch {
37+
Write-Error "Error building AIAgentEvaluation: $_"
38+
exit 1
39+
}
40+
finally {
41+
# Always return to the previous directory even if there are errors
42+
Pop-Location
43+
}
44+
2845
# Import the utilities module with shared functions
2946
$utilsPath = Join-Path -Path $repoRoot -ChildPath "scripts/utilities.ps1"
3047
. $utilsPath
@@ -49,60 +66,11 @@ try {
4966
}
5067
Write-Host "Copied supporting files for extension" -ForegroundColor Green
5168

52-
Write-Host "Setting up VstsTaskSdk module..."
53-
54-
# Use the download-vstsTaskSdk.ps1
55-
& (Join-Path -Path $scriptsFolder -ChildPath "download-vstsTaskSdk.ps1")
56-
if ($LASTEXITCODE -ne 0) {
57-
Write-Error "Failed to download VstsTaskSdk module"
58-
exit 1
59-
}
60-
Write-Host "VstsTaskSdk module downloaded successfully" -ForegroundColor Green
61-
62-
$commonLatestTask = Join-Path -Path $repoRoot -ChildPath "tasks/AIAgentEvaluation"
63-
$filesToCopyInLatest = @(
64-
"task.json",
65-
"run.ps1",
66-
"check-python.ps1"
67-
)
68-
foreach ($file in $filesToCopyInLatest) {
69-
$sourcePath = Join-Path -Path $commonLatestTask -ChildPath $file
70-
$destPath = Join-Path -Path $prodExtensionDir -ChildPath "tasks/AIAgentEvaluation/$latestVersion/$file"
71-
$removePath = Join-Path -Path $prodExtensionDir -ChildPath "tasks/AIAgentEvaluation/$file"
72-
Copy-Item -Path $sourcePath -Destination $destPath -Force
73-
Remove-Item -Path $removePath -Force -ErrorAction SilentlyContinue
74-
Write-Host "Copied $file to $destPath" -ForegroundColor Green
75-
}
76-
77-
# add action.py, analysis and pyproject.toml to the production v1 directory
78-
. $scriptsFolder/download-previousVersions.ps1
79-
80-
# Add action.py, analysis and pyproject.toml to the production latest(v2) directory
81-
$filesToCopy = @(
82-
"action.py",
83-
"pyproject.toml"
84-
)
85-
$foldersToCopy = @(
86-
"analysis"
87-
)
88-
foreach ($file in $filesToCopy) {
89-
$sourcePath = Join-Path -Path $repoRoot -ChildPath $file
90-
$destPath = Join-Path -Path $prodExtensionDir -ChildPath "tasks/AIAgentEvaluation/$latestVersion/$file"
91-
Copy-Item -Path $sourcePath -Destination $destPath -Force
92-
}
93-
foreach ($folder in $foldersToCopy) {
94-
$sourcePath = Join-Path -Path $repoRoot -ChildPath $folder
95-
$destPath = Join-Path -Path $prodExtensionDir -ChildPath "tasks/AIAgentEvaluation/$latestVersion/$folder"
96-
Copy-Directory -SourceDir $sourcePath -DestinationDir $destPath
97-
}
98-
99-
100-
$validate = Check-CriticalFiles -OutputDir $prodExtensionDir -IsDevExtension $false
101-
if (-not $validate) {
102-
Write-Error "Critical files check failed for production extension"
69+
$criticalFileChecks = Check-CriticalFiles -OutputDir $prodExtensionDir -IsDevExtension $false
70+
if (-not $criticalFileChecks) {
71+
Write-Error "Critical files check failed. Ensure all required files are present in the output directory."
10372
exit 1
10473
}
105-
Write-Host "Critical files check passed for production extension" -ForegroundColor Green
10674
}
10775
finally {
10876
# Return to the original directory

scripts/utilities.ps1

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,6 @@ function Check-CriticalFiles {
107107
[Parameter(Mandatory = $true)]
108108
[bool]$IsDevExtension
109109
)
110-
111-
$AgentFolderName = "AIAgentEvaluation"
112110
$versions = @("V1", "V2")
113111

114112
# Common files that should exist regardless of version
@@ -125,9 +123,8 @@ function Check-CriticalFiles {
125123
"action.py",
126124
"pyproject.toml",
127125
"task.json",
128-
"run.ps1",
129-
"check-python.ps1",
130-
"ps_modules/VstsTaskSdk/VstsTaskSdk.psm1"
126+
"index.js",
127+
"node_modules/azure-pipelines-task-lib/task.js"
131128
)
132129

133130
# V1-specific files
@@ -146,7 +143,7 @@ function Check-CriticalFiles {
146143
# Check version-specific files for each version
147144
foreach ($version in $versions) {
148145
foreach ($file in $versionSpecificFiles) {
149-
$fullPath = Join-Path -Path $OutputDir -ChildPath "tasks/$AgentFolderName/$version/$file"
146+
$fullPath = Join-Path -Path $OutputDir -ChildPath "tasks/AIAgentEvaluation/$version/$file"
150147
if (-not (Test-Path -Path $fullPath)) {
151148
Write-Host "❌ Critical file not found: $fullPath" -ForegroundColor Red
152149
return $false
@@ -156,7 +153,7 @@ function Check-CriticalFiles {
156153
# Check V1-specific files only for V1
157154
if ($version -eq "V1") {
158155
foreach ($file in $v1SpecificFiles) {
159-
$fullPath = Join-Path -Path $OutputDir -ChildPath "tasks/$AgentFolderName/$version/$file"
156+
$fullPath = Join-Path -Path $OutputDir -ChildPath "tasks/AIAgentEvaluation/$version/$file"
160157
if (-not (Test-Path -Path $fullPath)) {
161158
Write-Host "❌ Critical file not found: $fullPath" -ForegroundColor Red
162159
return $false

tasks/AIAgentEvaluation/.gitignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
node_modules
2+
*.js
3+
*.vsix
4+
*.zip
5+
dist
6+
7+
# Latest version python files are copied from root directory
8+
V2/action.py
9+
V2/analysis
10+
V2/pyproject.toml

0 commit comments

Comments
 (0)