Skip to content

Commit d684da8

Browse files
committed
Merge branch 'main' into mk/upgrade-oai.net-to-v2
Signed-off-by: Vincent Biret <[email protected]>
2 parents 8c92588 + 1f6796a commit d684da8

27 files changed

+127
-42
lines changed

.azure-pipelines/ci-build.yml

Lines changed: 57 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,13 @@ name: $(BuildDefinitionName)_$(SourceBranchName)_$(Date:yyyyMMdd)$(Rev:.r)
66
trigger:
77
branches:
88
include:
9-
- master
9+
- main
10+
- support/v1
1011
pr:
1112
branches:
1213
include:
13-
- master
14+
- main
15+
- support/v1
1416

1517
variables:
1618
buildPlatform: 'Any CPU'
@@ -145,7 +147,7 @@ extends:
145147

146148
- task: PowerShell@2
147149
displayName: 'Validate project version has been incremented'
148-
condition: and(contains(variables['build.sourceBranch'], 'refs/heads/master'), succeeded())
150+
condition: and(or(contains(variables['build.sourceBranch'], 'refs/heads/main'), contains(variables['build.sourceBranch'], 'refs/heads/support/v1')), succeeded())
149151
inputs:
150152
targetType: 'filePath'
151153
filePath: $(System.DefaultWorkingDirectory)\scripts\ValidateProjectVersionUpdated.ps1
@@ -186,27 +188,72 @@ extends:
186188
PendingAnalysisWaitTimeoutMinutes: '5'
187189

188190
- stage: deploy
189-
condition: and(contains(variables['build.sourceBranch'], 'refs/heads/master'), succeeded())
191+
condition: and(or(contains(variables['build.sourceBranch'], 'refs/heads/main'), contains(variables['build.sourceBranch'], 'refs/heads/support/v1')), succeeded())
190192
dependsOn: build
191193
jobs:
192194
- deployment: deploy
195+
templateContext:
196+
type: releaseJob
197+
isProduction: true
198+
inputs:
199+
- input: pipelineArtifact
200+
artifactName: Nugets
201+
targetPath: '$(Pipeline.Workspace)'
193202
environment: nuget-org
194203
strategy:
195204
runOnce:
196205
deploy:
197206
pool:
198207
vmImage: ubuntu-latest
199208
steps:
200-
- task: DownloadPipelineArtifact@2
201-
displayName: Download nupkg from artifacts
202-
inputs:
203-
artifact: Nugets
204-
source: current
205209
- task: 1ES.PublishNuget@1
206210
displayName: 'NuGet push'
207211
inputs:
208-
packagesToPush: '$(Pipeline.Workspace)/Nugets/Microsoft.OpenApi.OData.*.nupkg'
212+
packagesToPush: '$(Pipeline.Workspace)/Microsoft.OpenApi.OData.*.nupkg'
209213
nuGetFeedType: external
210214
publishFeedCredentials: 'OpenAPI Nuget Connection'
211215
packageParentPath: '$(Pipeline.Workspace)'
216+
217+
- deployment: create_github_release
218+
templateContext:
219+
type: releaseJob
220+
isProduction: true
221+
inputs:
222+
- input: pipelineArtifact
223+
artifactName: Nugets
224+
targetPath: '$(Pipeline.Workspace)'
225+
dependsOn: []
226+
environment: kiota-github-releases
227+
strategy:
228+
runOnce:
229+
deploy:
230+
pool:
231+
vmImage: ubuntu-latest
232+
steps:
233+
- pwsh: |
234+
$artifactName = Get-ChildItem -Path $(Pipeline.Workspace) -Filter Microsoft.OpenApi.*.nupkg -recurse | select -First 1
235+
$artifactVersion= $artifactName.Name -replace "Microsoft.OpenApi.OData", "" -replace ".nupkg", ""
236+
#Set Variable $artifactName and $artifactVersion
237+
Write-Host "##vso[task.setvariable variable=artifactVersion; isSecret=false;]$artifactVersion"
238+
echo "$artifactVersion"
239+
displayName: 'Fetch Artifact Name'
240+
- task: GitHubRelease@1
241+
displayName: 'GitHub release'
242+
condition: succeededOrFailed()
243+
inputs:
244+
gitHubConnection: 'Github-MaggieKimani1'
245+
action: create
246+
tagSource: userSpecifiedTag
247+
tag: 'v$(artifactVersion)'
248+
title: 'v$(artifactVersion)'
249+
releaseNotesSource: inline
250+
assets: '$(Pipeline.Workspace)\**\*.nupkg'
251+
changeLogType: issueBased
252+
changeLogLabels: '[
253+
{ "label" : "feature-work", "feature", "displayName" : "New Features", "state" : "closed" },
254+
{ "label" : "enhancement", "V2-Enhancement", "displayName" : "Enhancements", "state" : "closed" },
255+
{ "label" : "bug", "bug-fix", "displayName" : "Bugs", "state" : "closed" },
256+
{ "label" : "documentation", "doc", "displayName" : "Documentation", "state" : "closed"},
257+
{ "label" : "dependencies", "displayName" : "Package Updates", "state" : "closed" }
258+
]'
212259

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
* @xuzhg @irvinesunday @darrelmiller @danielmbaluka @gavinbarron @millicentachieng @andrueastman
1+
* @xuzhg @irvinesunday @darrelmiller @danielmbaluka @gavinbarron @millicentachieng @andrueastman @baywet

.github/policies/OpenAPI.NET.OData-branch-protection.yml

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,45 @@ resource: repository
99
configuration:
1010
branchProtectionRules:
1111

12-
- branchNamePattern: master
12+
- branchNamePattern: main
1313
# This branch pattern applies to the following branches as of 06/09/2024 20:45:44:
14-
# master
14+
# main
15+
16+
# Specifies whether this branch can be deleted. boolean
17+
allowsDeletions: false
18+
# Specifies whether forced pushes are allowed on this branch. boolean
19+
allowsForcePushes: false
20+
# Specifies whether new commits pushed to the matching branches dismiss pull request review approvals. boolean
21+
dismissStaleReviews: true
22+
# Specifies whether admins can overwrite branch protection. boolean
23+
isAdminEnforced: false
24+
# Indicates whether "Require a pull request before merging" is enabled. boolean
25+
requiresPullRequestBeforeMerging: true
26+
# Specifies the number of pull request reviews before merging. int (0-6). Should be null/empty if PRs are not required
27+
requiredApprovingReviewsCount: 1
28+
# Require review from Code Owners. Requires requiredApprovingReviewsCount. boolean
29+
requireCodeOwnersReview: true
30+
# Are commits required to be signed. boolean. TODO: all contributors must have commit signing on local machines.
31+
requiresCommitSignatures: false
32+
# Are conversations required to be resolved before merging? boolean
33+
requiresConversationResolution: true
34+
# Are merge commits prohibited from being pushed to this branch. boolean
35+
requiresLinearHistory: false
36+
# Required status checks to pass before merging. Values can be any string, but if the value does not correspond to any existing status check, the status check will be stuck on pending for status since nothing exists to push an actual status
37+
requiredStatusChecks:
38+
- license/cla
39+
- Continuous Integration
40+
- CodeQL
41+
# Require branches to be up to date before merging. This should be false since the repo contains autogenerated files. boolean
42+
requiresStrictStatusChecks: false
43+
# Indicates whether there are restrictions on who can push. boolean. Should be set with whoCanPush.
44+
restrictsPushes: false
45+
# Restrict who can dismiss pull request reviews. boolean
46+
restrictsReviewDismissals: false
47+
48+
- branchNamePattern: support/v1
49+
# This branch pattern applies to the following branches as of 06/09/2024 20:45:44:
50+
# support/v1
1551

1652
# Specifies whether this branch can be deleted. boolean
1753
allowsDeletions: false

.github/workflows/codeql-analysis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ name: "CodeQL"
1313

1414
on:
1515
push:
16-
branches: [ master ]
16+
branches: [ main, support/v1 ]
1717
pull_request:
1818
# The branches below must be a subset of the branches above
19-
branches: [ master ]
19+
branches: [ main, support/v1 ]
2020
schedule:
2121
- cron: '32 2 * * 6'
2222
workflow_dispatch:

.github/workflows/sonarcloud.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
push:
55
branches:
66
- main
7+
- support/v1
78
paths-ignore: ['.vscode/**']
89
pull_request:
910
types: [opened, synchronize, reopened]

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
## Ignore Visual Studio temporary files, build results, and
22
## files generated by popular Visual Studio add-ons.
33
##
4-
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
4+
## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore
55

66
# User-specific files
77
*.suo

.vscode/settings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@
55
"MD025": {
66
"front_matter_title": ""
77
}
8-
}
8+
},
9+
"azure-pipelines.1ESPipelineTemplatesSchemaFile": true
910
}

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ The **Microsoft.OpenAPI.OData.Reader** library helps represent an OData service
88

99
The conversion is based on the mapping doc from [OASIS OData OpenAPI v1.0](https://www.oasis-open.org/committees/document.php?document_id=61852&wg_abbrev=odata) and uses the following :
1010

11-
1. [Capabilities vocabulary annotation](https://github.com/oasis-tcs/odata-vocabularies/blob/master/vocabularies/Org.OData.Capabilities.V1.xml)
12-
2. [Authorization vocabulary annotation](https://github.com/oasis-tcs/odata-vocabularies/blob/master/vocabularies/Org.OData.Authorization.V1.xml)
13-
3. [Core vocabulary annotation](https://github.com/oasis-tcs/odata-vocabularies/blob/master/vocabularies/Org.OData.Core.V1.xml)
11+
1. [Capabilities vocabulary annotation](https://github.com/oasis-tcs/odata-vocabularies/blob/main/vocabularies/Org.OData.Capabilities.V1.xml)
12+
2. [Authorization vocabulary annotation](https://github.com/oasis-tcs/odata-vocabularies/blob/main/vocabularies/Org.OData.Authorization.V1.xml)
13+
3. [Core vocabulary annotation](https://github.com/oasis-tcs/odata-vocabularies/blob/main/vocabularies/Org.OData.Core.V1.xml)
1414
4. Navigation property path
1515
5. Edm operation and operation import path
1616

1717
## Overview
1818

19-
The image below is generic overview of how this library can convert the EDM model to an [OpenAPI.NET document](https://github.com/Microsoft/OpenAPI.NET/blob/master/src/Microsoft.OpenApi/Models/OpenApiDocument.cs) object.
19+
The image below is generic overview of how this library can convert the EDM model to an [OpenAPI.NET document](https://github.com/Microsoft/OpenAPI.NET/blob/main/src/Microsoft.OpenApi/Models/OpenApiDocument.cs) object.
2020

2121
![Convert OData CSDL to OpenAPI](docs/images/odata-2-openapi.png "Map /// OData CSDL --> OpenAPI.NET")
2222

docs/oas3_0_0/TripService.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"openapi": "3.0.1",
2+
"openapi": "3.0.4",
33
"info": {
44
"title": "OData Service for namespace Microsoft.OData.Service.Sample.TrippinInMemory.Models",
55
"description": "This OData service is located at http://localhost",

docs/oas3_0_0/graph.beta.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"openapi": "3.0.1",
2+
"openapi": "3.0.4",
33
"info": {
44
"title": "OData Service for namespace microsoft.graph",
55
"description": "This OData service is located at https://graph.microsoft.com/beta",

0 commit comments

Comments
 (0)