Skip to content

Commit 2ade929

Browse files
authored
Merge pull request #1393 from microsoft/vnext
Master refresh - release hidi
2 parents 11cfc7d + cdf9f84 commit 2ade929

File tree

360 files changed

+5010
-5446
lines changed

Some content is hidden

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

360 files changed

+5010
-5446
lines changed

.github/workflows/ci-cd.yml

Lines changed: 2 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -59,85 +59,10 @@ jobs:
5959
id: build_projects
6060
shell: pwsh
6161
run: |
62-
$projectsArray = @(
63-
'.\src\Microsoft.OpenApi\Microsoft.OpenApi.csproj',
64-
'.\src\Microsoft.OpenApi.Readers\Microsoft.OpenApi.Readers.csproj',
65-
'.\src\Microsoft.OpenApi.Hidi\Microsoft.OpenApi.Hidi.csproj'
66-
)
67-
$gitNewVersion = if ("${{ steps.tag_generator.outputs.new_version }}") {"${{ steps.tag_generator.outputs.new_version }}"} else {$null}
68-
$projectCurrentVersion = ([xml](Get-Content .\src\Microsoft.OpenApi\Microsoft.OpenApi.csproj)).Project.PropertyGroup.Version
69-
$projectNewVersion = $gitNewVersion ?? $projectCurrentVersion
70-
71-
$projectsArray | ForEach-Object {
72-
dotnet build $PSItem `
73-
-c Release # `
74-
# -o $env:ARTIFACTS_FOLDER `
75-
# /p:Version=$projectNewVersion
76-
}
77-
78-
# Move NuGet packages to separate folder for pipeline convenience
79-
# New-Item Artifacts/NuGet -ItemType Directory
80-
# Get-ChildItem Artifacts/*.nupkg | Move-Item -Destination "Artifacts/NuGet"
62+
dotnet build Microsoft.OpenApi.sln -c Release
8163
8264
- name: Run unit tests
8365
id: run_unit_tests
8466
shell: pwsh
8567
run: |
86-
$testProjectsArray = @(
87-
'.\test\Microsoft.OpenApi.Tests\Microsoft.OpenApi.Tests.csproj',
88-
'.\test\Microsoft.OpenApi.Readers.Tests\Microsoft.OpenApi.Readers.Tests.csproj',
89-
'.\test\Microsoft.OpenApi.SmokeTests\Microsoft.OpenApi.SmokeTests.csproj'
90-
)
91-
92-
$testProjectsArray | ForEach-Object {
93-
dotnet test $PSItem `
94-
-c Release
95-
}
96-
97-
# - if: steps.tag_generator.outputs.new_version != ''
98-
# name: Upload NuGet packages as artifacts
99-
# id: ul_packages_artifact
100-
# uses: actions/upload-artifact@v1
101-
# with:
102-
# name: NuGet packages
103-
# path: Artifacts/NuGet/
104-
105-
cd:
106-
if: needs.ci.outputs.is_default_branch == 'true' && needs.ci.outputs.latest_version != ''
107-
name: Continuous Deployment
108-
needs: ci
109-
runs-on: ubuntu-latest
110-
steps:
111-
# - name: Download and extract NuGet packages
112-
# id: dl_packages_artifact
113-
# uses: actions/download-artifact@v2
114-
# with:
115-
# name: NuGet packages
116-
# path: NuGet/
117-
118-
# - name: Push NuGet packages to NuGet.org
119-
# id: push_nuget_packages
120-
# continue-on-error: true
121-
# shell: pwsh
122-
# run: |
123-
# Get-ChildItem NuGet/*.nupkg | ForEach-Object {
124-
# nuget push $PSItem `
125-
# -ApiKey $env:NUGET_API_KEY `
126-
# -Source https://api.nuget.org/v3/index.json
127-
# }
128-
# env:
129-
# NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
130-
131-
- name: Create and publish release
132-
id: create_release
133-
uses: softprops/action-gh-release@v1
134-
with:
135-
name: OpenApi v${{ needs.ci.outputs.latest_version }}
136-
tag_name: v${{ needs.ci.outputs.latest_version }}
137-
# files: |
138-
# NuGet/Microsoft.OpenApi.${{ needs.ci.outputs.latest_version }}.nupkg
139-
# NuGet/Microsoft.OpenApi.Readers.${{ needs.ci.outputs.latest_version }}.nupkg
140-
env:
141-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
142-
143-
# Built with ❤ by [Pipeline Foundation](https://pipeline.foundation)
68+
dotnet test Microsoft.OpenApi.sln -c Release -v n

Directory.Build.props

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<Project>
2+
<PropertyGroup>
3+
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
4+
<Authors>Microsoft</Authors>
5+
<Company>Microsoft</Company>
6+
<PackageLicenseExpression>MIT</PackageLicenseExpression>
7+
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
8+
<RepositoryUrl>https://github.com/Microsoft/OpenAPI.NET</RepositoryUrl>
9+
<PackageReleaseNotes>https://github.com/microsoft/OpenAPI.NET/releases</PackageReleaseNotes>
10+
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
11+
<PackageIconUrl>http://go.microsoft.com/fwlink/?LinkID=288890</PackageIconUrl>
12+
<PackageProjectUrl>https://github.com/Microsoft/OpenAPI.NET</PackageProjectUrl>
13+
<Copyright>© Microsoft Corporation. All rights reserved.</Copyright>
14+
<PackageTags>OpenAPI .NET</PackageTags>
15+
</PropertyGroup>
16+
<!-- https://github.com/clairernovotny/DeterministicBuilds#deterministic-builds -->
17+
<PropertyGroup Condition="'$(TF_BUILD)' == 'true'">
18+
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
19+
</PropertyGroup>
20+
<ItemGroup>
21+
<PackageReference
22+
Condition="!$(MSBuildProjectName.EndsWith('Tests'))"
23+
Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All"/>
24+
</ItemGroup>
25+
</Project>

Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@ FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build-env
22
WORKDIR /app
33

44
COPY ./src ./hidi/src
5+
COPY ./Directory.Build.props ./hidi/Directory.Build.props
6+
COPY ./README.md ./hidi/README.md
57
WORKDIR /app/hidi
68
RUN dotnet publish ./src/Microsoft.OpenApi.Hidi/Microsoft.OpenApi.Hidi.csproj -c Release
79

8-
FROM mcr.microsoft.com/dotnet/runtime:7.0 as runtime
10+
FROM mcr.microsoft.com/dotnet/runtime:7.0 AS runtime
911
WORKDIR /app
1012

1113
COPY --from=build-env /app/hidi/src/Microsoft.OpenApi.Hidi/bin/Release/net7.0 ./

src/Directory.Build.props

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

src/Microsoft.OpenApi.Hidi/Extensions/CommandExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Copyright (c) Microsoft Corporation. All rights reserved.
2-
// Licensed under the MIT license.
2+
// Licensed under the MIT license.
33

44
using System.Collections.Generic;
55
using System.CommandLine;

src/Microsoft.OpenApi.Hidi/Formatters/PowerShellFormatter.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ static PowerShellFormatter()
2424
{
2525
// Add singularization exclusions.
2626
// Enhancement: Read exclusions from a user provided file.
27-
Vocabularies.Default.AddSingular("(drive)s$", "$1"); // drives does not properly singularize to drive.
27+
Vocabularies.Default.AddSingular("(drive)s$", "$1"); // drives does not properly singularize to drive.
2828
Vocabularies.Default.AddSingular("(data)$", "$1"); // exclude the following from singularization.
2929
Vocabularies.Default.AddSingular("(delta)$", "$1");
3030
Vocabularies.Default.AddSingular("(quota)$", "$1");
@@ -133,7 +133,7 @@ private static string SingularizeAndDeduplicateOperationId(IList<string> operati
133133

134134
singularizedSegments.Add(segment);
135135
}
136-
return string.Join(".", singularizedSegments);
136+
return string.Join('.', singularizedSegments);
137137
}
138138

139139
private static string RemoveHashSuffix(string operationId)
@@ -153,7 +153,7 @@ private static string RemoveKeyTypeSegment(string operationId, IList<OpenApiPara
153153
segments.Remove(keyTypeExtension);
154154
}
155155
}
156-
return string.Join(".", segments);
156+
return string.Join('.', segments);
157157
}
158158

159159
private static IList<OpenApiParameter> ResolveFunctionParameters(IList<OpenApiParameter> parameters)
@@ -179,7 +179,7 @@ private void AddAdditionalPropertiesToSchema(OpenApiSchema schema)
179179
{
180180
if (schema != null && !_schemaLoop.Contains(schema) && "object".Equals(schema.Type, StringComparison.OrdinalIgnoreCase))
181181
{
182-
schema.AdditionalProperties = new OpenApiSchema() { Type = "object" };
182+
schema.AdditionalProperties = new OpenApiSchema { Type = "object" };
183183

184184
/* Because 'additionalProperties' are now being walked,
185185
* we need a way to keep track of visited schemas to avoid

src/Microsoft.OpenApi.Hidi/Logger.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public static ILoggerFactory ConfigureLogger(LogLevel logLevel)
2121
{
2222
c.IncludeScopes = true;
2323
})
24-
#if DEBUG
24+
#if DEBUG
2525
.AddDebug()
2626
#endif
2727
.SetMinimumLevel(logLevel);

src/Microsoft.OpenApi.Hidi/Microsoft.OpenApi.Hidi.csproj

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,29 +7,14 @@
77
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
88
<PackAsTool>true</PackAsTool>
99
<Nullable>enable</Nullable>
10-
<PackageIconUrl>http://go.microsoft.com/fwlink/?LinkID=288890</PackageIconUrl>
11-
<PackageProjectUrl>https://github.com/Microsoft/OpenAPI.NET</PackageProjectUrl>
12-
<PackageLicenseExpression>MIT</PackageLicenseExpression>
13-
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
14-
<Authors>Microsoft</Authors>
15-
<Company>Microsoft</Company>
16-
<Title>Microsoft.OpenApi.Hidi</Title>
17-
<PackageId>Microsoft.OpenApi.Hidi</PackageId>
1810
<ToolCommandName>hidi</ToolCommandName>
1911
<PackageOutputPath>./../../artifacts</PackageOutputPath>
20-
<Version>1.3.0</Version>
12+
<Version>1.3.1</Version>
2113
<Description>OpenAPI.NET CLI tool for slicing OpenAPI documents</Description>
22-
<Copyright>© Microsoft Corporation. All rights reserved.</Copyright>
23-
<PackageTags>OpenAPI .NET</PackageTags>
24-
<RepositoryUrl>https://github.com/Microsoft/OpenAPI.NET</RepositoryUrl>
25-
<PackageReleaseNotes>https://github.com/microsoft/OpenAPI.NET/releases</PackageReleaseNotes>
26-
<AssemblyName>Microsoft.OpenApi.Hidi</AssemblyName>
27-
<RootNamespace>Microsoft.OpenApi.Hidi</RootNamespace>
2814
<SignAssembly>true</SignAssembly>
2915
<!-- https://github.com/dotnet/sourcelink/blob/main/docs/README.md#embeduntrackedsources -->
3016
<EmbedUntrackedSources>true</EmbedUntrackedSources>
3117
<NoWarn>$(NoWarn);NU5048;NU5104;CA1848;</NoWarn>
32-
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
3318
<PackageReadmeFile>readme.md</PackageReadmeFile>
3419
<AnalysisMode>All</AnalysisMode>
3520
</PropertyGroup>
@@ -50,7 +35,7 @@
5035
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="7.0.0" />
5136
<PackageReference Include="System.CommandLine" Version="2.0.0-beta4.22272.1" />
5237
<PackageReference Include="Microsoft.OData.Edm" Version="7.18.0" />
53-
<PackageReference Include="Microsoft.OpenApi.OData" Version="1.5.0-preview4" />
38+
<PackageReference Include="Microsoft.OpenApi.OData" Version="1.5.0-preview5" />
5439
<PackageReference Include="Microsoft.OpenApi.ApiManifest" Version="0.5.0-preview" />
5540
<PackageReference Include="System.CommandLine.Hosting" Version="0.4.0-alpha.22272.1" />
5641
</ItemGroup>

0 commit comments

Comments
 (0)