Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 47 additions & 16 deletions .azure-pipelines/ci-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ trigger:
- support/v2
tags:
include:
- 'v*'
- 'v3.*'
pr:
branches:
include:
Expand Down Expand Up @@ -56,6 +56,18 @@ extends:
targetPath: '$(Build.ArtifactStagingDirectory)'
steps:

- pwsh: |
$ErrorActionPreference = 'Stop'
$version = ([xml](Get-Content Directory.Build.props)).Project.PropertyGroup.Version
if ($env:BUILD_SOURCEBRANCH -like 'refs/tags/*') {
if ($env:BUILD_SOURCEBRANCH -cnotmatch '^refs/tags/v(3\.\d+\.\d+(?:-[0-9A-Za-z]+(?:[.-][0-9A-Za-z]+)*)?)$') {
throw "Expected an OData v3.x release tag, got $env:BUILD_SOURCEBRANCH."
}
if ($Matches[1] -cne $version) { throw "OData tag must exactly match Directory.Build.props version $version." }
}
Write-Host "##vso[task.setvariable variable=ODataVersion]$version"
displayName: 'Validate OData component tag and project version'

- task: UseDotNet@2
displayName: 'Use .NET 6' # needed for ESRP signing
inputs:
Expand Down Expand Up @@ -173,8 +185,13 @@ extends:
displayName: 'pack'
inputs:
command: pack
projects: src/Microsoft.OpenApi.OData.Reader/Microsoft.OpenAPI.OData.Reader.csproj
arguments: '-o $(Build.ArtifactStagingDirectory) --configuration $(BuildConfiguration) --no-build --include-symbols --include-source /p:SymbolPackageFormat=snupkg'
packagesToPack: src/Microsoft.OpenApi.OData.Reader/Microsoft.OpenAPI.OData.Reader.csproj
configuration: '$(BuildConfiguration)'
packDirectory: '$(Build.ArtifactStagingDirectory)'
nobuild: true
includesymbols: true
includesource: true
buildProperties: 'SymbolPackageFormat=snupkg'

- task: EsrpCodeSigning@6
displayName: 'ESRP CodeSigning Nuget Packages'
Expand All @@ -186,7 +203,7 @@ extends:
AuthAKVName: 'akv-prod-eastus'
AuthCertName: 'ReferenceLibraryPrivateCert'
AuthSignCertName: 'ReferencePackagePublisherCertificate'
Pattern: '*.nupkg'
Pattern: 'Microsoft.OpenApi.OData.$(ODataVersion).nupkg'
signConfigType: inlineSignParams
inlineOperation: |
[
Expand All @@ -211,7 +228,7 @@ extends:
PendingAnalysisWaitTimeoutMinutes: '5'

- stage: deploy
condition: and(contains(variables['build.sourceBranch'], 'refs/tags/v'), succeeded())
condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/v3.'))
dependsOn: build
jobs:
- deployment: deploy
Expand All @@ -229,10 +246,20 @@ extends:
pool:
vmImage: ubuntu-latest
steps:
- pwsh: |
$ErrorActionPreference = 'Stop'
if ($env:BUILD_SOURCEBRANCH -cnotmatch '^refs/tags/v(3\.\d+\.\d+(?:-[0-9A-Za-z]+(?:[.-][0-9A-Za-z]+)*)?)$') {
throw "Expected an OData v3.x release tag, got $env:BUILD_SOURCEBRANCH."
}
$version = $Matches[1]
$packages = @(Get-ChildItem -LiteralPath '$(Pipeline.Workspace)' -Recurse -File -Filter "Microsoft.OpenApi.OData.$version.nupkg")
if ($packages.Count -ne 1) { throw "Expected exactly one OData package matching tag version $version." }
Write-Host "##vso[task.setvariable variable=ODataPackagePath]$($packages[0].FullName)"
displayName: 'Verify exact OData release package'
- task: 1ES.PublishNuget@1
displayName: 'NuGet push'
inputs:
packagesToPush: '$(Pipeline.Workspace)/Microsoft.OpenApi.OData.*.nupkg'
packagesToPush: '$(ODataPackagePath)'
nuGetFeedType: external
publishFeedCredentials: 'OpenAPI Nuget Connection'
packageParentPath: '$(Pipeline.Workspace)'
Expand All @@ -254,21 +281,25 @@ extends:
vmImage: ubuntu-latest
steps:
- pwsh: |
$artifactName = Get-ChildItem -Path $(Pipeline.Workspace) -Filter Microsoft.OpenApi.OData.*.nupkg -recurse | select -First 1
$artifactVersion= $artifactName.Name -replace "Microsoft.OpenApi.OData.", "" -replace ".nupkg", ""
#Set Variable $artifactName and $artifactVersion
Write-Host "##vso[task.setvariable variable=artifactVersion; isSecret=false;]$artifactVersion"
echo "$artifactVersion"
displayName: 'Fetch Artifact Name'
$ErrorActionPreference = 'Stop'
if ($env:BUILD_SOURCEBRANCH -cnotmatch '^refs/tags/v(3\.\d+\.\d+(?:-[0-9A-Za-z]+(?:[.-][0-9A-Za-z]+)*)?)$') {
throw "Expected an OData v3.x release tag, got $env:BUILD_SOURCEBRANCH."
}
$version = $Matches[1]
$packages = @(Get-ChildItem -LiteralPath '$(Pipeline.Workspace)' -Recurse -File -Filter "Microsoft.OpenApi.OData.$version.nupkg")
if ($packages.Count -ne 1) { throw "Expected exactly one OData package matching tag version $version." }
Write-Host "##vso[task.setvariable variable=ODataReleaseVersion]$version"
Write-Host "##vso[task.setvariable variable=ODataPackagePath]$($packages[0].FullName)"
displayName: 'Verify OData tag and exact GitHub release asset'
- task: GitHubRelease@1
displayName: 'GitHub release'
condition: succeededOrFailed()
condition: succeeded()
inputs:
gitHubConnection: 'Github-MaggieKimani1'
action: edit
tagSource: userSpecifiedTag
tag: 'v$(artifactVersion)'
title: 'v$(artifactVersion)'
tag: 'v$(ODataReleaseVersion)'
title: 'v$(ODataReleaseVersion)'
releaseNotesSource: inline
assets: '$(Pipeline.Workspace)\**\Microsoft.OpenApi.OData.*.nupkg'
assets: '$(ODataPackagePath)'
addChangeLog: false
33 changes: 23 additions & 10 deletions .azure-pipelines/hidi-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,15 @@ extends:
artifactName: HidiDockerContext
targetPath: '$(Build.ArtifactStagingDirectory)\hidi-docker-context'
steps:
- pwsh: |
$ErrorActionPreference = 'Stop'
$version = ([xml](Get-Content src\Microsoft.OpenApi.Hidi\Microsoft.OpenApi.Hidi.csproj)).Project.PropertyGroup.Version
if ($version -cnotmatch '^3\.\d+\.\d+(?:-[0-9A-Za-z]+(?:[.-][0-9A-Za-z]+)*)?$') { throw "Expected a hidi 3.x version, got $version." }
if ($env:BUILD_SOURCEBRANCH -like 'refs/tags/*' -and $env:BUILD_SOURCEBRANCH -cne "refs/tags/hidi-v$version") {
throw "Hidi tag must exactly match the hidi project version."
}
Write-Host "##vso[task.setvariable variable=HidiVersion]$version"
displayName: Validate Hidi component tag and project version
- task: UseDotNet@2
displayName: Use .NET 6 for ESRP
inputs:
Expand Down Expand Up @@ -123,12 +132,7 @@ extends:
}
displayName: Stage public-only hidi Docker context
- pwsh: |
$version = ([xml](Get-Content src\Microsoft.OpenApi.Hidi\Microsoft.OpenApi.Hidi.csproj)).Project.PropertyGroup.Version
if ($version -notmatch '^3\.\d+\.\d+(-[0-9A-Za-z.-]+)?$') { throw "Expected a hidi 3.x version, got $version." }
if ('$(Build.SourceBranch)' -like 'refs/tags/*' -and '$(Build.SourceBranch)' -ne "refs/tags/hidi-v$version") {
throw "Hidi tag must exactly match the hidi project version."
}
Write-Host "##vso[task.setvariable variable=HidiVersion]$version"
$ErrorActionPreference = 'Stop'
dotnet build src\Microsoft.OpenApi.Hidi\Microsoft.OpenApi.Hidi.csproj -c $(buildConfiguration) -p:GeneratePackageOnBuild=false
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
dotnet run --project test\Microsoft.OpenApi.Hidi.Tests\Microsoft.OpenApi.Hidi.Tests.csproj -c $(buildConfiguration) -- --minimum-expected-tests 1
Expand Down Expand Up @@ -246,12 +250,19 @@ extends:
deploy:
steps:
- pwsh: |
$tag = '$(Build.SourceBranch)' -replace '^refs/tags/hidi-v', ''
$ErrorActionPreference = 'Stop'
if ($env:BUILD_SOURCEBRANCH -cnotmatch '^refs/tags/hidi-v(3\.\d+\.\d+(?:-[0-9A-Za-z]+(?:[.-][0-9A-Za-z]+)*)?)$') {
throw "Expected a hidi-v3.x release tag, got $env:BUILD_SOURCEBRANCH."
}
$tag = $Matches[1]
if ([version]($tag -split '-')[0] -le [version]'3.10.2') { throw "Never republish the source migration baseline or an older hidi version." }
$package = "$(Pipeline.Workspace)\hidi\Microsoft.OpenApi.Hidi.$tag.nupkg"
if (-not (Test-Path $package)) { throw "Missing exact hidi package: $package" }
if (-not (Test-Path -LiteralPath $package -PathType Leaf)) { throw "Missing exact hidi package: $package" }
$symbols = "$(Pipeline.Workspace)\hidi\Microsoft.OpenApi.Hidi.$tag.snupkg"
if (-not (Test-Path $symbols)) { throw "Missing exact hidi symbols: $symbols" }
if (-not (Test-Path -LiteralPath $symbols -PathType Leaf)) { throw "Missing exact hidi symbols: $symbols" }
foreach ($asset in @("$(Pipeline.Workspace)\hidi\Microsoft.OpenApi.Hidi.exe", "$(Pipeline.Workspace)\hidi\hidi-win-x64-$tag.zip")) {
if (-not (Test-Path -LiteralPath $asset -PathType Leaf)) { throw "Missing exact hidi release asset: $asset" }
}
Write-Host "##vso[task.setvariable variable=HidiReleaseVersion]$tag"
displayName: Verify new hidi release version and exact package
- task: PowerShell@2
Expand Down Expand Up @@ -323,8 +334,10 @@ extends:
vmImage: ubuntu-latest
steps:
- pwsh: |
$ErrorActionPreference = 'Stop'
$version = ([xml](Get-Content src/Microsoft.OpenApi.Hidi/Microsoft.OpenApi.Hidi.csproj)).Project.PropertyGroup.Version
if ('$(Build.SourceBranch)' -ne "refs/tags/hidi-v$version") { throw "Hidi tag does not match project version." }
if ($version -cnotmatch '^3\.\d+\.\d+(?:-[0-9A-Za-z]+(?:[.-][0-9A-Za-z]+)*)?$') { throw "Expected a hidi 3.x version, got $version." }
if ($env:BUILD_SOURCEBRANCH -cne "refs/tags/hidi-v$version") { throw "Hidi tag does not match project version." }
if ([version]($version -split '-')[0] -le [version]'3.10.2') { throw "Do not republish the migration baseline or an older hidi version." }
Write-Host "##vso[task.setvariable variable=HidiReleaseVersion]$version"
displayName: Read independent hidi version
Expand Down
22 changes: 0 additions & 22 deletions .github/workflows/release-please-gha.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,25 +50,3 @@ jobs:
config-file: release-please-config.json
manifest-file: .release-please-manifest.json
target-branch: ${{ github.ref_name }}

release-please-hidi:
# Enable only after destination merges and source publishing is cut over.
if: ${{ false }}
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Generate GitHub App token
id: app-token
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
with:
client-id: ${{ vars.RELEASE_PLEASE_TOKEN_PROVIDER_APP_ID }}
private-key: ${{ secrets.RELEASE_PLEASE_TOKEN_PROVIDER_PEM }}
- name: Release Please (independent hidi version)
uses: googleapis/release-please-action@45996ed1f6d02564a971a2fa1b5860e934307cf7 # v5.0.0
with:
token: ${{ steps.app-token.outputs.token }}
config-file: hidi-release-please-config.json
manifest-file: .hidi-release-please-manifest.json
target-branch: ${{ github.ref_name }}
3 changes: 0 additions & 3 deletions .hidi-release-please-manifest.json

This file was deleted.

3 changes: 2 additions & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
".": "3.2.1"
".": "3.2.1",
"src/Microsoft.OpenApi.Hidi": "3.10.2"
}
30 changes: 29 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,32 @@ The recommended commit types used are:
- __ci__ for CI configuration file changes e.g. updating a pipeline
- __chore__ for miscallaneous non-sdk changesin the repo e.g. removing an unused file

Adding an exclamation mark after the commit type (`feat!`) or footer with the prefix __BREAKING CHANGE:__ will cause an increment of the _major_ version.
Adding an exclamation mark after the commit type (`feat!`) or footer with the prefix __BREAKING CHANGE:__ will cause an increment of the _major_ version.

## Independent component versions

`release-please-config.json` defines OData at `.` and Hidi at
`src/Microsoft.OpenApi.Hidi`; `.release-please-manifest.json` tracks their versions
independently. The standard release-please action manages both components.
The standard `separate-pull-requests` setting retains component-specific PR
branches so the pinned engine can parse OData-only releases with componentless
tags; the default combined PR format cannot produce those release candidates.
Hidi uses `hidi-v3.*` tags on `main`, its own changelog and the project
`<Version>` property. OData retains its root changelog, `Directory.Build.props`
version and componentless `v*` tags. A Hidi source change does not bump OData;
an OData-only change does not bump Hidi.

Routing follows package directories, not commit scopes. Hidi tests outside the
source package are excluded from OData releases and do not independently trigger
a Hidi release. Root distribution/helper files remain outside the Hidi component;
they follow the root package's standard routing, not custom Hidi routing.
Existing root OData exclusions remain configured. The official Hidi
package/container publishing gates remain disabled during migration.

The ADO OData pipeline accepts `v3.*` tags and deploys only the exact OData
package matching that tag and `Directory.Build.props`. The dedicated Hidi
pipeline accepts `hidi-v3.*` tags; its package, symbols, executable, ZIP and
container version must match the Hidi tag/project version. Malformed,
other-component or mismatched tags fail validation rather than publishing a
different component. With publishing disabled, branch/PR builds remain validation-only; the existing
Hidi publishing flags, migration floor and protected environments are unchanged.
37 changes: 0 additions & 37 deletions hidi-release-please-config.json

This file was deleted.

50 changes: 35 additions & 15 deletions release-please-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,39 +5,59 @@
".github",
".idea",
".vs",
".vscode",
"src/Microsoft.OpenApi.Hidi",
"src/Microsoft.OpenApi.Tool",
"src/Microsoft.Hidi",
"Microsoft.OpenApi.Hidi.Tests",
"test/Microsoft.OpenApi.Hidi.Tests",
"test/Microsoft.OpenApi.Tests",
"tool/Microsoft.OpenApi.Hidi.public.snk",
"tool/Microsoft.OpenApi.OData.public.snk",
"tool/hidi-local-nuget.config",
"Dockerfile",
".dockerignore",
"install-tool.ps1",
"hidi-release-please-config.json",
".hidi-release-please-manifest.json"
".vscode"
],
"release-type": "simple",
"bump-minor-pre-major": true,
"bump-patch-for-minor-pre-major": true,
"include-component-in-tag": false,
"include-v-in-tag": true,
"draft": false,
"separate-pull-requests": true,
"packages": {
".": {
"package-name": "Microsoft.OpenApi.OData",
"changelog-path": "CHANGELOG.md",
"exclude-paths": [
".azure-pipelines",
".github",
".idea",
".vs",
".vscode",
"src/Microsoft.OpenApi.Hidi",
"src/Microsoft.OpenApi.Tool",
"src/Microsoft.Hidi",
"Microsoft.OpenApi.Hidi.Tests",
"test/Microsoft.OpenApi.Hidi.Tests",
"test/Microsoft.OpenApi.Tests",
"tool/Microsoft.OpenApi.Hidi.public.snk",
"tool/Microsoft.OpenApi.OData.public.snk",
"tool/hidi-local-nuget.config",
"Dockerfile",
".dockerignore",
"install-tool.ps1"
],
"extra-files": [
{
"type": "xml",
"path": "Directory.Build.props",
"xpath": "//Project/PropertyGroup/Version"
}
]
},
"src/Microsoft.OpenApi.Hidi": {
"package-name": "Microsoft.OpenApi.Hidi",
"component": "hidi",
"changelog-path": "CHANGELOG.md",
"include-component-in-tag": true,
"include-v-in-tag": true,
"extra-files": [
{
"type": "xml",
"path": "Microsoft.OpenApi.Hidi.csproj",
"xpath": "//Project/PropertyGroup/Version"
}
]
}
},
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json"
Expand Down
Loading