Skip to content

Commit c8e64dc

Browse files
gavinbarronCopilotCopilotbaywet
authored
refactor(hidi): remove migrated v2 tool resources (#3109)
* refactor(hidi): remove migrated v2 tool resources Follow accepted OpenAPI.NET.OData support/v2 import PR883. Retain core/YAML builds, signing, packaging and history; point hidi documentation to its new home. Publishing handoff remains gated pending destination official pipeline onboarding. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: c631d217-9378-4cee-8c7e-761043ff3ae5 * fix(hidi): retain GitHub release edit step Co-authored-by: baywet <7905502+baywet@users.noreply.github.com> --------- Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: baywet <7905502+baywet@users.noreply.github.com> Copilot-Session: c631d217-9378-4cee-8c7e-761043ff3ae5
1 parent 1344a43 commit c8e64dc

50 files changed

Lines changed: 9 additions & 29524 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.azure-pipelines/ci-build.yml‎

Lines changed: 2 additions & 199 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,6 @@ variables:
2222
buildPlatform: 'Any CPU'
2323
buildConfiguration: 'Release'
2424
ProductBinPath: '$(Build.SourcesDirectory)\src\Microsoft.OpenApi\bin\$(BuildConfiguration)'
25-
REGISTRY: 'msgraphprodregistry.azurecr.io'
26-
IMAGE_NAME: 'public/openapi/hidi'
27-
PREVIEW_BRANCH: 'refs/heads/main'
2825

2926
resources:
3027
repositories:
@@ -51,10 +48,6 @@ extends:
5148
displayName: 'Publish Artifact: Nugets'
5249
artifactName: Nugets
5350
targetPath: '$(Build.ArtifactStagingDirectory)/Nugets'
54-
- output: pipelineArtifact
55-
displayName: 'Publish Artifact: RepoFiles'
56-
artifactName: RepoFiles
57-
targetPath: '$(Build.ArtifactStagingDirectory)/RepoFiles'
5851
steps:
5952
- task: UseDotNet@2
6053
displayName: 'Use .NET 6'
@@ -173,10 +166,6 @@ extends:
173166
- pwsh: dotnet pack $(Build.SourcesDirectory)/src/Microsoft.OpenApi.YamlReader/Microsoft.OpenApi.YamlReader.csproj -o $(Build.ArtifactStagingDirectory) --configuration $(BuildConfiguration) --no-build --include-symbols --include-source /p:SymbolPackageFormat=snupkg
174167
displayName: 'pack YamlReader'
175168

176-
# Pack hidi
177-
- pwsh: dotnet pack $(Build.SourcesDirectory)/src/Microsoft.OpenApi.Hidi/Microsoft.OpenApi.Hidi.csproj -o $(Build.ArtifactStagingDirectory) --configuration $(BuildConfiguration) --no-build --include-symbols --include-source /p:SymbolPackageFormat=snupkg
178-
displayName: 'pack Hidi'
179-
180169
- task: EsrpCodeSigning@6
181170
displayName: 'ESRP CodeSigning Nuget Packages'
182171
inputs:
@@ -211,68 +200,21 @@ extends:
211200
MaxRetryAttempts: '5'
212201
PendingAnalysisWaitTimeoutMinutes: '5'
213202

214-
# publish hidi as an .exe
215-
- task: DotNetCoreCLI@2
216-
displayName: publish Hidi as executable
217-
inputs:
218-
command: 'publish'
219-
arguments: -c Release --runtime win-x64 -p:RestoreConfigFile=$(Build.SourcesDirectory)\nuget.config /p:PublishSingleFile=true /p:PackAsTool=false --self-contained --output $(Build.ArtifactStagingDirectory)/Microsoft.OpenApi.Hidi
220-
projects: 'src/Microsoft.OpenApi.Hidi/Microsoft.OpenApi.Hidi.csproj'
221-
publishWebProjects: False
222-
zipAfterPublish: false
223-
224203
- task: CopyFiles@2
225204
displayName: Prepare staging folder for upload
226205
inputs:
227206
targetFolder: $(Build.ArtifactStagingDirectory)/Nugets
228207
sourceFolder: $(Build.ArtifactStagingDirectory)
229208
content: '*.nupkg'
230209

231-
# Copy repository files to be used in the deploy stage
232-
- task: CopyFiles@2
233-
displayName: 'Copy repository files for deploy stage'
234-
inputs:
235-
SourceFolder: '$(Build.SourcesDirectory)'
236-
Contents: |
237-
**/*
238-
!**/bin/**
239-
!**/obj/**
240-
!**/.git/**
241-
TargetFolder: '$(Build.ArtifactStagingDirectory)/RepoFiles'
242-
243210
- stage: deploy
244-
condition: and(or(contains(variables['Build.SourceBranch'], 'refs/tags/v'), eq(variables['Build.SourceBranch'], variables['PREVIEW_BRANCH'])), succeeded())
211+
condition: and(contains(variables['Build.SourceBranch'], 'refs/tags/v'), succeeded())
245212
dependsOn: build
246213
pool:
247214
name: Azure-Pipelines-1ESPT-ExDShared
248215
os: linux
249216
image: ubuntu-latest
250217
jobs:
251-
- deployment: deploy_hidi
252-
condition: and(contains(variables['build.SourceBranch'], 'refs/tags/v'), succeeded())
253-
templateContext:
254-
type: releaseJob
255-
isProduction: true
256-
inputs:
257-
- input: pipelineArtifact
258-
artifactName: Nugets
259-
targetPath: '$(Pipeline.Workspace)'
260-
dependsOn: []
261-
environment: nuget-org
262-
strategy:
263-
runOnce:
264-
deploy:
265-
pool:
266-
vmImage: ubuntu-latest
267-
steps:
268-
- task: 1ES.PublishNuget@1
269-
displayName: 'NuGet push'
270-
inputs:
271-
packagesToPush: '$(Pipeline.Workspace)/Microsoft.OpenApi.Hidi.*.nupkg'
272-
packageParentPath: '$(Pipeline.Workspace)'
273-
nuGetFeedType: external
274-
publishFeedCredentials: 'OpenAPI Nuget Connection'
275-
276218
- deployment: deploy_lib
277219
condition: and(contains(variables['build.SourceBranch'], 'refs/tags/v'), succeeded())
278220
templateContext:
@@ -290,18 +232,10 @@ extends:
290232
pool:
291233
vmImage: ubuntu-latest
292234
steps:
293-
- pwsh: |
294-
$fileNames = "$(Pipeline.Workspace)/Microsoft.OpenApi.Hidi.*.nupkg", "$(Pipeline.Workspace)/Microsoft.OpenApi.YamlReader.*.nupkg"
295-
foreach($fileName in $fileNames) {
296-
if(Test-Path $fileName) {
297-
Remove-Item $fileName -Verbose
298-
}
299-
}
300-
displayName: remove other nupkgs to avoid duplication
301235
- task: 1ES.PublishNuget@1
302236
displayName: 'NuGet push'
303237
inputs:
304-
packagesToPush: '$(Pipeline.Workspace)/Microsoft.OpenApi.*.nupkg'
238+
packagesToPush: '$(Pipeline.Workspace)/Microsoft.OpenApi.[0-9]*.nupkg'
305239
packageParentPath: '$(Pipeline.Workspace)'
306240
nuGetFeedType: external
307241
publishFeedCredentials: 'OpenAPI Nuget Connection'
@@ -364,139 +298,8 @@ extends:
364298
tagSource: userSpecifiedTag
365299
tag: 'v$(artifactVersion)'
366300
releaseNotesSource: inline
367-
assets: '$(Pipeline.Workspace)\**\*.exe'
368301
addChangeLog: false
369302

370-
- deployment: deploy_docker_image
371-
environment: docker-images-deploy
372-
templateContext:
373-
type: releaseJob
374-
isProduction: true
375-
inputs:
376-
- input: pipelineArtifact
377-
artifactName: RepoFiles
378-
targetPath: '$(Pipeline.Workspace)'
379-
strategy:
380-
runOnce:
381-
deploy:
382-
pool:
383-
vmImage: 'ubuntu-latest'
384-
steps:
385-
- task: AzureCLI@2
386-
displayName: 'Login to Azure Container Registry'
387-
inputs:
388-
azureSubscription: 'ACR Images Push Service Connection'
389-
scriptType: bash
390-
scriptLocation: inlineScript
391-
inlineScript: |
392-
az acr login --name $(REGISTRY)
393-
394-
- pwsh: |
395-
$content = [XML](Get-Content $(Pipeline.Workspace)/Directory.Build.props)
396-
Write-Host "XML loaded, finding version..."
397-
398-
# Handle PropertyGroup as either a single element or array
399-
$version = $null
400-
if ($content.Project.PropertyGroup -is [array]) {
401-
Write-Host "PropertyGroup is an array, checking each entry..."
402-
foreach ($pg in $content.Project.PropertyGroup) {
403-
if ($pg.Version) {
404-
$version = $pg.Version.ToString().Trim()
405-
Write-Host "Found version in PropertyGroup array: $version"
406-
break
407-
}
408-
}
409-
} else {
410-
# Single PropertyGroup
411-
$version = $content.Project.PropertyGroup.Version
412-
if ($version) {
413-
$version = $version.ToString().Trim()
414-
Write-Host "Found version in PropertyGroup: $version"
415-
}
416-
}
417-
418-
if (-not $version) {
419-
Write-Host "##vso[task.logissue type=error]Version not found in Directory.Build.props"
420-
exit 1
421-
}
422-
423-
Write-Host "Version found: $version"
424-
Write-Host "##vso[task.setvariable variable=version;isoutput=true]$version"
425-
Write-Host "##vso[task.setvariable variable=VERSION]$version"
426-
displayName: 'Get version from csproj'
427-
name: getversion
428-
429-
- bash: |
430-
# Debug output to verify version variable
431-
echo "Version from previous step: $VERSION"
432-
displayName: 'Verify version variable'
433-
434-
- bash: |
435-
echo "Build Number: $(Build.BuildNumber)"
436-
# Extract the last 3 characters for the run number
437-
runnumber=$(echo "$(Build.BuildNumber)" | grep -o '[0-9]\+$')
438-
echo "Extracted Run Number: $runnumber"
439-
440-
# If extraction fails, set a default
441-
if [ -z "$runnumber" ]; then
442-
echo "Extraction failed, using default value"
443-
runnumber=$(date +"%S%N" | cut -c1-3)
444-
echo "Generated fallback run number: $runnumber"
445-
fi
446-
447-
# Set the variable for later steps
448-
echo "##vso[task.setvariable variable=RUNNUMBER]$runnumber"
449-
echo "##vso[task.setvariable variable=RUNNUMBER;isOutput=true]$runnumber"
450-
displayName: 'Get truncated run number'
451-
name: getrunnumber
452-
condition: eq(variables['Build.SourceBranch'], variables['PREVIEW_BRANCH'])
453-
454-
- bash: |
455-
date=$(date +'%Y%m%d')
456-
echo "Date value: $date"
457-
echo "##vso[task.setvariable variable=BUILDDATE;isOutput=true]$date"
458-
echo "##vso[task.setvariable variable=BUILDDATE]$date"
459-
displayName: 'Get current date'
460-
name: setdate
461-
condition: eq(variables['Build.SourceBranch'], variables['PREVIEW_BRANCH'])
462-
463-
- script: |
464-
docker run --privileged --rm msgraphprodregistry.azurecr.io/tonistiigi/binfmt --install all
465-
displayName: "Enable multi-platform builds"
466-
467-
- script: |
468-
docker buildx create --use --name mybuilder
469-
displayName: "Set up Docker BuildX"
470-
471-
- script: |
472-
docker buildx inspect --bootstrap
473-
displayName: "Ensure BuildX is working"
474-
475-
- bash: |
476-
echo "Building Docker image..."
477-
echo "Using build date: ${BUILDDATE}"
478-
# Using quotes around tags to prevent flag interpretation
479-
docker buildx build \
480-
--platform linux/amd64,linux/arm64/v8 \
481-
--push \
482-
-t "$(REGISTRY)/$(IMAGE_NAME):nightly" \
483-
-t "$(REGISTRY)/$(IMAGE_NAME):${VERSION}.${BUILDDATE}${RUNNUMBER}" \
484-
"$(Pipeline.Workspace)"
485-
486-
displayName: 'Build and Push Nightly Image'
487-
condition: eq(variables['Build.SourceBranch'], variables['PREVIEW_BRANCH'])
488-
489-
- bash: |
490-
echo "Building Docker image for release..."
491-
docker buildx build\
492-
--platform linux/amd64,linux/arm64/v8 \
493-
--push \
494-
-t "$(REGISTRY)/$(IMAGE_NAME):latest" \
495-
-t "$(REGISTRY)/$(IMAGE_NAME):${VERSION}" \
496-
"$(Pipeline.Workspace)"
497-
displayName: 'Build and Push Release Image'
498-
condition: contains(variables['Build.SourceBranch'], 'refs/tags/v')
499-
500303
# once the nuget has been released, fill this form to get the public documentation updated.
501304
# https://dev.azure.com/msft-skilling/Content/_workitems/create/User%20Story?templateId=39fb91e3-64a2-4c8a-83db-b2bdf3603dd3&ownerId=c4a28f90-17ae-4384-b514-7273392b082b
502305
# https://learn.microsoft.com/en-us/dotnet/api/microsoft.openapi

‎.github/workflows/codeql-analysis.yml‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,7 @@ jobs:
4444
run: |
4545
$projectsArray = @(
4646
'.\src\Microsoft.OpenApi\Microsoft.OpenApi.csproj',
47-
'.\src\Microsoft.OpenApi.YamlReader\Microsoft.OpenApi.YamlReader.csproj',
48-
'.\src\Microsoft.OpenApi.Hidi\Microsoft.OpenApi.Hidi.csproj'
47+
'.\src\Microsoft.OpenApi.YamlReader\Microsoft.OpenApi.YamlReader.csproj'
4948
)
5049
5150
$projectsArray | ForEach-Object {

‎.vscode/launch.json‎

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,6 @@
11
{
22
"version": "0.2.0",
33
"configurations": [
4-
{
5-
// Use IntelliSense to find out which attributes exist for C# debugging
6-
// Use hover for the description of the existing attributes
7-
// For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/main/debugger-launchjson.md
8-
"name": "Launch Hidi",
9-
"type": "coreclr",
10-
"request": "launch",
11-
"preLaunchTask": "build",
12-
// If you have changed target frameworks, make sure to update the program path.
13-
"program": "${workspaceFolder}/src/Microsoft.OpenApi.Hidi/bin/Debug/net8.0/Microsoft.OpenApi.Hidi.dll",
14-
"args": ["plugin",
15-
"-m","${workspaceFolder}/test/Microsoft.OpenApi.Hidi.Tests/UtilityFiles/exampleapimanifest.json",
16-
"--of","./output"],
17-
"cwd": "${workspaceFolder}/src/Microsoft.OpenApi.Hidi",
18-
// For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console
19-
"console": "internalConsole",
20-
"stopAtEntry": false
21-
},
224
{
235
// Use IntelliSense to find out which attributes exist for C# debugging
246
// Use hover for the description of the existing attributes

‎.vscode/settings.json‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
},
77
"cSpell.words": [
88
"csdl",
9-
"Hidi",
109
"Xunit"
1110
]
1211
}

‎.vscode/tasks.json‎

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -29,20 +29,6 @@
2929
"--collect:\"XPlat Code Coverage\""
3030
],
3131
"problemMatcher": "$msCompile"
32-
},
33-
{
34-
"label": "watch",
35-
"command": "dotnet",
36-
"type": "process",
37-
"group": "build",
38-
"args": [
39-
"watch",
40-
"run",
41-
"${workspaceFolder}/src/Microsoft.OpenApi.Hidi/Microsoft.OpenApi.Hidi.csproj",
42-
"/property:GenerateFullPaths=true",
43-
"/consoleloggerparameters:NoSummary"
44-
],
45-
"problemMatcher": "$msCompile"
4632
}
4733
]
4834
}

‎CONTRIBUTING.md‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ OpenAPI.net is a mono-repo containing source code for the following packages:
88
|----------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
99
| [Microsoft.OpenAPI](./src/Microsoft.OpenAPI/README.md) | [![NuGet Version](https://img.shields.io/nuget/vpre/Microsoft.OpenAPI?label=Latest&logo=nuget)](https://www.nuget.org/packages/Microsoft.OpenAPI/) |
1010
| [Microsoft.OpenAPI.YamlReader](./src/Microsoft.OpenApi.YamlReader/README.md) | [![NuGet Version](https://img.shields.io/nuget/vpre/Microsoft.OpenAPI.YamlReader?label=Latest&logo=nuget)](https://www.nuget.org/packages/Microsoft.OpenAPI.YamlReader/) |
11-
| [Microsoft.OpenAPI.Hidi](./src/Microsoft.OpenAPI.Hidi/README.md) | [![NuGet Version](https://img.shields.io/nuget/vpre/Microsoft.OpenAPI.Hidi?label=Latest&logo=nuget)](https://www.nuget.org/packages/Microsoft.OpenAPI.Hidi/) |
11+
12+
The OpenAPI.NET v2-compatible [Microsoft.OpenApi.Hidi command line tool](https://github.com/microsoft/OpenAPI.NET.OData/blob/support/v2/src/Microsoft.OpenApi.Hidi/readme.md) is maintained separately.
13+
Contribute to Hidi in [OpenAPI.NET.OData's support/v2 branch](https://github.com/microsoft/OpenAPI.NET.OData/tree/support/v2).
1214

1315
OpenAPI.net is open to contributions. There are a couple of different recommended paths to get contributions into the released version of this library.
1416

‎Dockerfile‎

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

‎Microsoft.OpenApi.slnx‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,10 @@
88
<File Path="readme.md" />
99
</Folder>
1010
<Folder Name="/src/">
11-
<Project Path="src/Microsoft.OpenApi.Hidi/Microsoft.OpenApi.Hidi.csproj" />
1211
<Project Path="src/Microsoft.OpenApi.YamlReader/Microsoft.OpenApi.YamlReader.csproj" />
1312
<Project Path="src/Microsoft.OpenApi/Microsoft.OpenApi.csproj" />
1413
</Folder>
1514
<Folder Name="/test/">
16-
<Project Path="test/Microsoft.OpenApi.Hidi.Tests/Microsoft.OpenApi.Hidi.Tests.csproj" />
1715
<Project Path="test/Microsoft.OpenApi.Readers.Tests/Microsoft.OpenApi.Readers.Tests.csproj" />
1816
<Project Path="test/Microsoft.OpenApi.Tests/Microsoft.OpenApi.Tests.csproj" />
1917
<Project Path="test/Microsoft.OpenApi.Trimming.Tests/Microsoft.OpenApi.Trimming.Tests.csproj" />

‎README.md‎

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
|--|--|
88
|Models and Writers|[![nuget](https://img.shields.io/nuget/v/Microsoft.OpenApi.svg)](https://www.nuget.org/packages/Microsoft.OpenApi/) |
99
|YamlReader | [![nuget](https://img.shields.io/nuget/v/Microsoft.OpenApi.YamlReader.svg)](https://www.nuget.org/packages/Microsoft.OpenApi.YamlReader/) |
10-
|Hidi|[![nuget](https://img.shields.io/nuget/v/Microsoft.OpenApi.Hidi.svg)](https://www.nuget.org/packages/Microsoft.OpenApi.Hidi/)
1110

1211
The **OpenAPI.NET** SDK contains a useful object model for OpenAPI documents in .NET along with common serializers to extract raw OpenAPI JSON and YAML documents from the model.
1312

@@ -86,10 +85,9 @@ var outputString = await openApiDocument.SerializeAsJsonAsync(OpenApiSpecVersion
8685
```
8786

8887
# Validating/Testing OpenAPI descriptions
89-
In order to test the validity of an OpenApi document, we avail the following tools:
90-
- [Microsoft.OpenApi.Hidi](https://www.nuget.org/packages/Microsoft.OpenApi.Hidi)
91-
92-
A commandline tool for validating and transforming OpenAPI descriptions. [Installation guidelines and documentation](https://github.com/microsoft/OpenAPI.NET/blob/main/src/Microsoft.OpenApi.Hidi/readme.md)
88+
[Microsoft.OpenApi.Hidi](https://www.nuget.org/packages/Microsoft.OpenApi.Hidi) is a command line tool for validating and transforming OpenAPI descriptions.
89+
The OpenAPI.NET v2-compatible tool is maintained in [OpenAPI.NET.OData's support/v2 branch](https://github.com/microsoft/OpenAPI.NET.OData/tree/support/v2/src/Microsoft.OpenApi.Hidi).
90+
See its [installation guidelines and documentation](https://github.com/microsoft/OpenAPI.NET.OData/blob/support/v2/src/Microsoft.OpenApi.Hidi/readme.md).
9391

9492
# Contributing
9593

0 commit comments

Comments
 (0)