Skip to content

Commit 7668c28

Browse files
Merge pull request #1802 from microsoft/vnext
Release hidi and libs
2 parents ea7dcd0 + ef4de8b commit 7668c28

File tree

164 files changed

+535
-1022
lines changed

Some content is hidden

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

164 files changed

+535
-1022
lines changed

.azure-pipelines/ci-build.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ extends:
7979
arguments: '--configuration $(BuildConfiguration) --no-build'
8080

8181
- task: EsrpCodeSigning@5
82+
displayName: 'ESRP CodeSigning binaries'
8283
inputs:
8384
ConnectedServiceName: 'Federated DevX ESRP Managed Identity Connection'
8485
AppRegistrationClientId: '65035b7f-7357-4f29-bf25-c5ee5c3949f8'
@@ -87,8 +88,6 @@ extends:
8788
AuthCertName: 'ReferenceLibraryPrivateCert'
8889
AuthSignCertName: 'ReferencePackagePublisherCertificate'
8990
FolderPath: '$(Build.SourcesDirectory)\src'
90-
Pattern: '*.dll'
91-
UseMinimatch: true
9291
signConfigType: 'inlineSignParams'
9392
inlineOperation: |
9493
[
@@ -146,6 +145,7 @@ extends:
146145
displayName: 'pack Hidi'
147146

148147
- task: EsrpCodeSigning@5
148+
displayName: 'ESRP CodeSigning Nuget Packages'
149149
inputs:
150150
ConnectedServiceName: 'Federated DevX ESRP Managed Identity Connection'
151151
AppRegistrationClientId: '65035b7f-7357-4f29-bf25-c5ee5c3949f8'

Microsoft.OpenApi.sln

-7
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{E546B92F-20A
2424
EndProject
2525
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{6357D7FD-2DE4-4900-ADB9-ABC37052040A}"
2626
EndProject
27-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.OpenApi.SmokeTests", "test\Microsoft.OpenApi.SmokeTests\Microsoft.OpenApi.SmokeTests.csproj", "{AD79B61D-88CF-497C-9ED5-41AE3867C5AC}"
28-
EndProject
2927
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.OpenApi.Hidi", "src\Microsoft.OpenApi.Hidi\Microsoft.OpenApi.Hidi.csproj", "{254841B5-7DAC-4D1D-A9C5-44FE5CE467BE}"
3028
EndProject
3129
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.OpenApi.Hidi.Tests", "test\Microsoft.OpenApi.Hidi.Tests\Microsoft.OpenApi.Hidi.Tests.csproj", "{D8F799DD-04AC-4A13-B344-45A5B944450A}"
@@ -58,10 +56,6 @@ Global
5856
{1ED3C2C1-E1E7-4925-B4E6-2D969C3F5237}.Debug|Any CPU.Build.0 = Debug|Any CPU
5957
{1ED3C2C1-E1E7-4925-B4E6-2D969C3F5237}.Release|Any CPU.ActiveCfg = Release|Any CPU
6058
{1ED3C2C1-E1E7-4925-B4E6-2D969C3F5237}.Release|Any CPU.Build.0 = Release|Any CPU
61-
{AD79B61D-88CF-497C-9ED5-41AE3867C5AC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
62-
{AD79B61D-88CF-497C-9ED5-41AE3867C5AC}.Debug|Any CPU.Build.0 = Debug|Any CPU
63-
{AD79B61D-88CF-497C-9ED5-41AE3867C5AC}.Release|Any CPU.ActiveCfg = Release|Any CPU
64-
{AD79B61D-88CF-497C-9ED5-41AE3867C5AC}.Release|Any CPU.Build.0 = Release|Any CPU
6559
{254841B5-7DAC-4D1D-A9C5-44FE5CE467BE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
6660
{254841B5-7DAC-4D1D-A9C5-44FE5CE467BE}.Debug|Any CPU.Build.0 = Debug|Any CPU
6761
{254841B5-7DAC-4D1D-A9C5-44FE5CE467BE}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -84,7 +78,6 @@ Global
8478
{79933258-0126-4382-8755-D50820ECC483} = {E546B92F-20A8-49C3-8323-4B25BB78F3E1}
8579
{AD83F991-DBF3-4251-8613-9CC54C826964} = {6357D7FD-2DE4-4900-ADB9-ABC37052040A}
8680
{1ED3C2C1-E1E7-4925-B4E6-2D969C3F5237} = {6357D7FD-2DE4-4900-ADB9-ABC37052040A}
87-
{AD79B61D-88CF-497C-9ED5-41AE3867C5AC} = {6357D7FD-2DE4-4900-ADB9-ABC37052040A}
8881
{254841B5-7DAC-4D1D-A9C5-44FE5CE467BE} = {E546B92F-20A8-49C3-8323-4B25BB78F3E1}
8982
{D8F799DD-04AC-4A13-B344-45A5B944450A} = {6357D7FD-2DE4-4900-ADB9-ABC37052040A}
9083
{1D2E0C6E-B103-4CB6-912E-D56FA1501296} = {6357D7FD-2DE4-4900-ADB9-ABC37052040A}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
using System;
2+
using System.CommandLine.Invocation;
3+
using System.Threading.Tasks;
4+
5+
namespace Microsoft.OpenApi.Hidi.Handlers;
6+
7+
internal abstract class AsyncCommandHandler : ICommandHandler
8+
{
9+
public int Invoke(InvocationContext context)
10+
{
11+
throw new InvalidOperationException("This method should not be called");
12+
}
13+
public abstract Task<int> InvokeAsync(InvocationContext context);
14+
}

src/Microsoft.OpenApi.Hidi/Handlers/PluginCommandHandler.cs

+3-7
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,14 @@
1111

1212
namespace Microsoft.OpenApi.Hidi.Handlers
1313
{
14-
internal class PluginCommandHandler : ICommandHandler
14+
internal class PluginCommandHandler : AsyncCommandHandler
1515
{
1616
public CommandOptions CommandOptions { get; }
1717
public PluginCommandHandler(CommandOptions commandOptions)
1818
{
1919
CommandOptions = commandOptions;
2020
}
21-
public int Invoke(InvocationContext context)
22-
{
23-
return InvokeAsync(context).GetAwaiter().GetResult();
24-
}
25-
public async Task<int> InvokeAsync(InvocationContext context)
21+
public override async Task<int> InvokeAsync(InvocationContext context)
2622
{
2723
var hidiOptions = new HidiOptions(context.ParseResult, CommandOptions);
2824
var cancellationToken = (CancellationToken)context.BindingContext.GetRequiredService(typeof(CancellationToken));
@@ -31,7 +27,7 @@ public async Task<int> InvokeAsync(InvocationContext context)
3127
var logger = loggerFactory.CreateLogger<PluginCommandHandler>();
3228
try
3329
{
34-
await OpenApiService.PluginManifest(hidiOptions, logger, cancellationToken).ConfigureAwait(false);
30+
await OpenApiService.PluginManifestAsync(hidiOptions, logger, cancellationToken).ConfigureAwait(false);
3531

3632
return 0;
3733
}

src/Microsoft.OpenApi.Hidi/Handlers/ShowCommandHandler.cs

+3-7
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,14 @@
1111

1212
namespace Microsoft.OpenApi.Hidi.Handlers
1313
{
14-
internal class ShowCommandHandler : ICommandHandler
14+
internal class ShowCommandHandler : AsyncCommandHandler
1515
{
1616
public CommandOptions CommandOptions { get; set; }
1717
public ShowCommandHandler(CommandOptions commandOptions)
1818
{
1919
CommandOptions = commandOptions;
2020
}
21-
public int Invoke(InvocationContext context)
22-
{
23-
return InvokeAsync(context).GetAwaiter().GetResult();
24-
}
25-
public async Task<int> InvokeAsync(InvocationContext context)
21+
public override async Task<int> InvokeAsync(InvocationContext context)
2622
{
2723
var hidiOptions = new HidiOptions(context.ParseResult, CommandOptions);
2824
var cancellationToken = (CancellationToken)context.BindingContext.GetRequiredService(typeof(CancellationToken));
@@ -31,7 +27,7 @@ public async Task<int> InvokeAsync(InvocationContext context)
3127
var logger = loggerFactory.CreateLogger<ShowCommandHandler>();
3228
try
3329
{
34-
await OpenApiService.ShowOpenApiDocument(hidiOptions, logger, cancellationToken).ConfigureAwait(false);
30+
await OpenApiService.ShowOpenApiDocumentAsync(hidiOptions, logger, cancellationToken).ConfigureAwait(false);
3531

3632
return 0;
3733
}

src/Microsoft.OpenApi.Hidi/Handlers/TransformCommandHandler.cs

+3-7
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,14 @@
1111

1212
namespace Microsoft.OpenApi.Hidi.Handlers
1313
{
14-
internal class TransformCommandHandler : ICommandHandler
14+
internal class TransformCommandHandler : AsyncCommandHandler
1515
{
1616
public CommandOptions CommandOptions { get; }
1717
public TransformCommandHandler(CommandOptions commandOptions)
1818
{
1919
CommandOptions = commandOptions;
2020
}
21-
public int Invoke(InvocationContext context)
22-
{
23-
return InvokeAsync(context).GetAwaiter().GetResult();
24-
}
25-
public async Task<int> InvokeAsync(InvocationContext context)
21+
public override async Task<int> InvokeAsync(InvocationContext context)
2622
{
2723
var hidiOptions = new HidiOptions(context.ParseResult, CommandOptions);
2824
var cancellationToken = (CancellationToken)context.BindingContext.GetRequiredService(typeof(CancellationToken));
@@ -31,7 +27,7 @@ public async Task<int> InvokeAsync(InvocationContext context)
3127
var logger = loggerFactory.CreateLogger<TransformCommandHandler>();
3228
try
3329
{
34-
await OpenApiService.TransformOpenApiDocument(hidiOptions, logger, cancellationToken).ConfigureAwait(false);
30+
await OpenApiService.TransformOpenApiDocumentAsync(hidiOptions, logger, cancellationToken).ConfigureAwait(false);
3531

3632
return 0;
3733
}

src/Microsoft.OpenApi.Hidi/Handlers/ValidateCommandHandler.cs

+3-8
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,15 @@
1111

1212
namespace Microsoft.OpenApi.Hidi.Handlers
1313
{
14-
internal class ValidateCommandHandler : ICommandHandler
14+
internal class ValidateCommandHandler : AsyncCommandHandler
1515
{
1616
public CommandOptions CommandOptions { get; }
1717

1818
public ValidateCommandHandler(CommandOptions commandOptions)
1919
{
2020
CommandOptions = commandOptions;
2121
}
22-
23-
public int Invoke(InvocationContext context)
24-
{
25-
return InvokeAsync(context).GetAwaiter().GetResult();
26-
}
27-
public async Task<int> InvokeAsync(InvocationContext context)
22+
public override async Task<int> InvokeAsync(InvocationContext context)
2823
{
2924
var hidiOptions = new HidiOptions(context.ParseResult, CommandOptions);
3025
var cancellationToken = (CancellationToken)context.BindingContext.GetRequiredService(typeof(CancellationToken));
@@ -33,7 +28,7 @@ public async Task<int> InvokeAsync(InvocationContext context)
3328
try
3429
{
3530
if (hidiOptions.OpenApi is null) throw new InvalidOperationException("OpenApi file is required");
36-
var isValid = await OpenApiService.ValidateOpenApiDocument(hidiOptions.OpenApi, logger, cancellationToken).ConfigureAwait(false);
31+
var isValid = await OpenApiService.ValidateOpenApiDocumentAsync(hidiOptions.OpenApi, logger, cancellationToken).ConfigureAwait(false);
3732
return isValid is not false ? 0 : -1;
3833
}
3934
#if RELEASE

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

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<Nullable>enable</Nullable>
1010
<ToolCommandName>hidi</ToolCommandName>
1111
<PackageOutputPath>./../../artifacts</PackageOutputPath>
12-
<Version>1.4.8</Version>
12+
<Version>1.4.9</Version>
1313
<Description>OpenAPI.NET CLI tool for slicing OpenAPI documents</Description>
1414
<SignAssembly>true</SignAssembly>
1515
<!-- https://github.com/dotnet/sourcelink/blob/main/docs/README.md#embeduntrackedsources -->
@@ -33,6 +33,7 @@
3333
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.1" />
3434
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="8.0.0" />
3535
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="8.0.0" />
36+
<PackageReference Include="Microsoft.VisualStudio.Threading" Version="17.11.20" />
3637
<PackageReference Include="System.CommandLine" Version="2.0.0-beta4.22272.1" />
3738
<PackageReference Include="Microsoft.OData.Edm" Version="8.0.1" />
3839
<PackageReference Include="Microsoft.OpenApi.OData" Version="2.0.0-preview.2" />

0 commit comments

Comments
 (0)