Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Master refresh - release hidi #1393

Merged
merged 108 commits into from
Oct 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
108 commits
Select commit Hold shift + click to select a range
6e0f84a
Bump Verify.Xunit from 21.2.0 to 21.3.0
dependabot[bot] Sep 28, 2023
4b5f562
Merge pull request #1363 from microsoft/dependabot/nuget/Verify.Xunit…
baywet Sep 29, 2023
7fe922d
fix some warnings
SimonCropp Sep 30, 2023
c1a6eba
move dir props up
SimonCropp Sep 30, 2023
63aa733
remove csproj settings that are convention based on project name
SimonCropp Sep 30, 2023
6356fc2
move Authors and company to props
SimonCropp Sep 30, 2023
6149e55
move license to props
SimonCropp Sep 30, 2023
7e60f93
move PackageRequireLicenseAcceptance to props
SimonCropp Sep 30, 2023
6e6a2b8
move RepositoryUrl to props
SimonCropp Sep 30, 2023
4f1513e
move PackageReleaseNotes to props
SimonCropp Sep 30, 2023
838ac24
move TreatWarningsAsErrors to props
SimonCropp Sep 30, 2023
b813e51
move ContinuousIntegrationBuild to props
SimonCropp Sep 30, 2023
37afc80
move PackageIconUrl and PackageProjectUrl to props
SimonCropp Sep 30, 2023
0ac9a52
move Copyright to props
SimonCropp Sep 30, 2023
cde8923
move PackageTags to props
SimonCropp Sep 30, 2023
4df3025
TargetFrameworks to TargetFramework
SimonCropp Sep 30, 2023
2b304a7
simplify PrivateAssets all
SimonCropp Sep 30, 2023
32b2525
remove redundant PackageReference closing tags
SimonCropp Sep 30, 2023
7857663
Merge pull request #1364 from SimonCropp/fix-some-warnings
andrueastman Oct 2, 2023
cf89b4f
use some pattern matiching
SimonCropp Oct 2, 2023
fc43120
elide some asyncs
SimonCropp Oct 2, 2023
86c72b5
using declarations
SimonCropp Oct 2, 2023
4b341a0
remove some redundant braces
SimonCropp Oct 2, 2023
545d4b3
remove some usings
SimonCropp Oct 2, 2023
b23a53a
use some raw strings
SimonCropp Oct 2, 2023
a847203
Merge pull request #1369 from SimonCropp/remove-some-redundant-braces
MaggieKimani1 Oct 2, 2023
170ee50
Merge pull request #1366 from SimonCropp/use-some-pattern-matiching
MaggieKimani1 Oct 2, 2023
9aa7897
inline some out variables
SimonCropp Oct 2, 2023
aa80139
use negation pattern
SimonCropp Oct 2, 2023
dc7a40a
Merge branch 'vnext' into elide-some-asyncs
MaggieKimani1 Oct 2, 2023
c4f02da
use pattern matching in casts
SimonCropp Oct 2, 2023
edc95ed
Merge remote-tracking branch 'upstream/vnext' into use-pattern-matchi…
SimonCropp Oct 2, 2023
a2f6198
remove some trailing whitespace
SimonCropp Oct 2, 2023
eecda34
.
SimonCropp Oct 2, 2023
96e9495
.
SimonCropp Oct 2, 2023
4168614
.
SimonCropp Oct 2, 2023
683589e
remove some un used fields
SimonCropp Oct 2, 2023
c58f5eb
use default literal
SimonCropp Oct 2, 2023
c27d518
Update OpenApiYamlDocumentReader.cs
SimonCropp Oct 2, 2023
74ce7db
Update OpenApiService.cs
SimonCropp Oct 2, 2023
52be452
.
SimonCropp Oct 2, 2023
508dc0a
Update OpenApiService.cs
SimonCropp Oct 2, 2023
35851e0
Update OpenApiServiceTests.cs
SimonCropp Oct 2, 2023
79e99ed
Update OpenApiUrlTreeNode.cs
SimonCropp Oct 2, 2023
a5a4c03
remove some duplicate dictionary lookups
SimonCropp Oct 2, 2023
734b957
Update OpenApiAnyCloneHelper.cs
SimonCropp Oct 2, 2023
e529a86
use some computed properties
SimonCropp Oct 2, 2023
e2e3f64
remove redundant casts
SimonCropp Oct 2, 2023
1036e53
Merge remote-tracking branch 'upstream/vnext' into use-some-raw-strings
SimonCropp Oct 2, 2023
e5c2062
.
SimonCropp Oct 2, 2023
8f93584
use is operator instead of reflection
SimonCropp Oct 2, 2023
0252298
Apply suggestions from code review
baywet Oct 2, 2023
a76f17d
Merge pull request #1371 from SimonCropp/use-some-raw-strings
baywet Oct 2, 2023
4bf34d3
Merge pull request #1370 from SimonCropp/remove-some-usings
baywet Oct 2, 2023
9c3668c
Merge pull request #1382 from SimonCropp/remove-redundant-casts
baywet Oct 2, 2023
cd6b6ff
Merge pull request #1381 from SimonCropp/use-some-computed-properties
baywet Oct 2, 2023
cee58fd
Merge pull request #1378 from SimonCropp/use-default-literal
baywet Oct 2, 2023
b711794
Merge pull request #1379 from SimonCropp/CancellationToken
baywet Oct 2, 2023
3d8c66f
Apply suggestions from code review
baywet Oct 2, 2023
f30d451
Merge pull request #1383 from SimonCropp/use-is-operator-instead-of-r…
baywet Oct 2, 2023
0f68120
Merge pull request #1380 from SimonCropp/remove-some-duplicate-dictio…
baywet Oct 2, 2023
306dda2
Merge pull request #1375 from SimonCropp/use-pattern-matching-in-casts
baywet Oct 2, 2023
0fe6bc3
Merge remote-tracking branch 'upstream/vnext' into remove-some-traili…
SimonCropp Oct 2, 2023
f571bf5
.
SimonCropp Oct 2, 2023
5e9bb92
Update OpenApiWorkspaceTests.cs
SimonCropp Oct 2, 2023
3ad8ece
Update OpenApiWorkspaceTests.cs
SimonCropp Oct 2, 2023
03a2810
Merge remote-tracking branch 'upstream/vnext' into cleanup-csproj
SimonCropp Oct 2, 2023
add1b5a
Update Directory.Build.props
SimonCropp Oct 2, 2023
861b555
Merge remote-tracking branch 'upstream/vnext' into elide-some-asyncs
SimonCropp Oct 2, 2023
ed51df5
.
SimonCropp Oct 2, 2023
b17d30c
Merge remote-tracking branch 'upstream/vnext' into using-declarations
SimonCropp Oct 2, 2023
e3498c2
.
SimonCropp Oct 2, 2023
4fa15b4
Merge remote-tracking branch 'upstream/vnext' into inline-some-out-va…
SimonCropp Oct 2, 2023
087a533
Update PropertyNode.cs
SimonCropp Oct 2, 2023
45b835c
Merge remote-tracking branch 'upstream/vnext' into remove-some-un-use…
SimonCropp Oct 3, 2023
2db6e64
Update OpenApiRemoteReferenceCollector.cs
SimonCropp Oct 3, 2023
1d84847
remove some redundant interfaces
SimonCropp Oct 3, 2023
98b8d57
.
SimonCropp Oct 3, 2023
789c807
make indents consistent (#1386)
SimonCropp Oct 3, 2023
26f52f5
Merge remote-tracking branch 'upstream/vnext' into use-negation-pattern
SimonCropp Oct 3, 2023
8ca00d1
remove some redundant field defaults (#1385)
SimonCropp Oct 3, 2023
05512ec
use char overloads where possible
SimonCropp Oct 3, 2023
f3c9141
Update src/Microsoft.OpenApi.Readers/V2/OpenApiDocumentDeserializer.cs
baywet Oct 3, 2023
47e8394
Update src/Microsoft.OpenApi.Readers/V2/OpenApiDocumentDeserializer.cs
baywet Oct 3, 2023
fa367ab
Merge pull request #1368 from SimonCropp/using-declarations
baywet Oct 3, 2023
d80c99f
Merge pull request #1389 from SimonCropp/use-char-overloads-where-pos…
baywet Oct 3, 2023
0bb99af
- removes unecessary argument
baywet Oct 3, 2023
b1ee58c
Merge pull request #1376 from SimonCropp/remove-some-trailing-whitespace
baywet Oct 3, 2023
60b72fc
Merge pull request #1373 from SimonCropp/use-negation-pattern
baywet Oct 3, 2023
540f02b
Merge pull request #1367 from SimonCropp/elide-some-asyncs
baywet Oct 3, 2023
af877cc
Merge pull request #1365 from SimonCropp/cleanup-csproj
baywet Oct 3, 2023
53c7441
Merge pull request #1377 from SimonCropp/remove-some-un-used-fields
baywet Oct 3, 2023
bff184b
Merge pull request #1387 from SimonCropp/remove-some-redundant-interf…
baywet Oct 3, 2023
21c1f14
- fixes hidi docker image release
baywet Oct 3, 2023
a05c169
Merge pull request #1390 from microsoft/bugfix/hidi-docker
baywet Oct 3, 2023
a680a6b
Merge remote-tracking branch 'upstream/vnext' into inline-some-out-va…
SimonCropp Oct 3, 2023
4126f8a
Merge pull request #1372 from SimonCropp/inline-some-out-variables
baywet Oct 3, 2023
3fae2f4
redundant ctor in OpenApiDocumentTests
SimonCropp Oct 4, 2023
c9dfc86
Bump hidi version
andrueastman Oct 4, 2023
934494e
Merge pull request #1392 from microsoft/andrueastman/bumpHidi
andrueastman Oct 4, 2023
9934507
Merge pull request #1391 from SimonCropp/redundant-ctor-in-OpenApiDoc…
andrueastman Oct 4, 2023
d66a59a
Fix release warnings
andrueastman Oct 4, 2023
d8c39ee
Merge remote-tracking branch 'origin/vnext' into andrueastman/fixRelease
andrueastman Oct 4, 2023
fa716cf
Merge pull request #1394 from microsoft/andrueastman/fixRelease
andrueastman Oct 4, 2023
f2b5132
Fixes failing tests
andrueastman Oct 5, 2023
8c8eb30
Fix CI
andrueastman Oct 5, 2023
a99db00
Fix environment specific issues
andrueastman Oct 5, 2023
cdf9f84
Merge pull request #1395 from microsoft/andrueastman/IgnoreTrailingWh…
andrueastman Oct 5, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
79 changes: 2 additions & 77 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,85 +59,10 @@ jobs:
id: build_projects
shell: pwsh
run: |
$projectsArray = @(
'.\src\Microsoft.OpenApi\Microsoft.OpenApi.csproj',
'.\src\Microsoft.OpenApi.Readers\Microsoft.OpenApi.Readers.csproj',
'.\src\Microsoft.OpenApi.Hidi\Microsoft.OpenApi.Hidi.csproj'
)
$gitNewVersion = if ("${{ steps.tag_generator.outputs.new_version }}") {"${{ steps.tag_generator.outputs.new_version }}"} else {$null}
$projectCurrentVersion = ([xml](Get-Content .\src\Microsoft.OpenApi\Microsoft.OpenApi.csproj)).Project.PropertyGroup.Version
$projectNewVersion = $gitNewVersion ?? $projectCurrentVersion

$projectsArray | ForEach-Object {
dotnet build $PSItem `
-c Release # `
# -o $env:ARTIFACTS_FOLDER `
# /p:Version=$projectNewVersion
}

# Move NuGet packages to separate folder for pipeline convenience
# New-Item Artifacts/NuGet -ItemType Directory
# Get-ChildItem Artifacts/*.nupkg | Move-Item -Destination "Artifacts/NuGet"
dotnet build Microsoft.OpenApi.sln -c Release

- name: Run unit tests
id: run_unit_tests
shell: pwsh
run: |
$testProjectsArray = @(
'.\test\Microsoft.OpenApi.Tests\Microsoft.OpenApi.Tests.csproj',
'.\test\Microsoft.OpenApi.Readers.Tests\Microsoft.OpenApi.Readers.Tests.csproj',
'.\test\Microsoft.OpenApi.SmokeTests\Microsoft.OpenApi.SmokeTests.csproj'
)

$testProjectsArray | ForEach-Object {
dotnet test $PSItem `
-c Release
}

# - if: steps.tag_generator.outputs.new_version != ''
# name: Upload NuGet packages as artifacts
# id: ul_packages_artifact
# uses: actions/upload-artifact@v1
# with:
# name: NuGet packages
# path: Artifacts/NuGet/

cd:
if: needs.ci.outputs.is_default_branch == 'true' && needs.ci.outputs.latest_version != ''
name: Continuous Deployment
needs: ci
runs-on: ubuntu-latest
steps:
# - name: Download and extract NuGet packages
# id: dl_packages_artifact
# uses: actions/download-artifact@v2
# with:
# name: NuGet packages
# path: NuGet/

# - name: Push NuGet packages to NuGet.org
# id: push_nuget_packages
# continue-on-error: true
# shell: pwsh
# run: |
# Get-ChildItem NuGet/*.nupkg | ForEach-Object {
# nuget push $PSItem `
# -ApiKey $env:NUGET_API_KEY `
# -Source https://api.nuget.org/v3/index.json
# }
# env:
# NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}

- name: Create and publish release
id: create_release
uses: softprops/action-gh-release@v1
with:
name: OpenApi v${{ needs.ci.outputs.latest_version }}
tag_name: v${{ needs.ci.outputs.latest_version }}
# files: |
# NuGet/Microsoft.OpenApi.${{ needs.ci.outputs.latest_version }}.nupkg
# NuGet/Microsoft.OpenApi.Readers.${{ needs.ci.outputs.latest_version }}.nupkg
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# Built with ❤ by [Pipeline Foundation](https://pipeline.foundation)
dotnet test Microsoft.OpenApi.sln -c Release -v n
25 changes: 25 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<Project>
<PropertyGroup>
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
<Authors>Microsoft</Authors>
<Company>Microsoft</Company>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<RepositoryUrl>https://github.com/Microsoft/OpenAPI.NET</RepositoryUrl>
<PackageReleaseNotes>https://github.com/microsoft/OpenAPI.NET/releases</PackageReleaseNotes>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<PackageIconUrl>http://go.microsoft.com/fwlink/?LinkID=288890</PackageIconUrl>
<PackageProjectUrl>https://github.com/Microsoft/OpenAPI.NET</PackageProjectUrl>
<Copyright>© Microsoft Corporation. All rights reserved.</Copyright>
<PackageTags>OpenAPI .NET</PackageTags>
</PropertyGroup>
<!-- https://github.com/clairernovotny/DeterministicBuilds#deterministic-builds -->
<PropertyGroup Condition="'$(TF_BUILD)' == 'true'">
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
</PropertyGroup>
<ItemGroup>
<PackageReference
Condition="!$(MSBuildProjectName.EndsWith('Tests'))"
Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All"/>
</ItemGroup>
</Project>
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@ FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build-env
WORKDIR /app

COPY ./src ./hidi/src
COPY ./Directory.Build.props ./hidi/Directory.Build.props
COPY ./README.md ./hidi/README.md
WORKDIR /app/hidi
RUN dotnet publish ./src/Microsoft.OpenApi.Hidi/Microsoft.OpenApi.Hidi.csproj -c Release

FROM mcr.microsoft.com/dotnet/runtime:7.0 as runtime
FROM mcr.microsoft.com/dotnet/runtime:7.0 AS runtime
WORKDIR /app

COPY --from=build-env /app/hidi/src/Microsoft.OpenApi.Hidi/bin/Release/net7.0 ./
Expand Down
8 changes: 0 additions & 8 deletions src/Directory.Build.props

This file was deleted.

2 changes: 1 addition & 1 deletion src/Microsoft.OpenApi.Hidi/Extensions/CommandExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
// Licensed under the MIT license.

using System.Collections.Generic;
using System.CommandLine;
Expand Down
8 changes: 4 additions & 4 deletions src/Microsoft.OpenApi.Hidi/Formatters/PowerShellFormatter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ static PowerShellFormatter()
{
// Add singularization exclusions.
// Enhancement: Read exclusions from a user provided file.
Vocabularies.Default.AddSingular("(drive)s$", "$1"); // drives does not properly singularize to drive.
Vocabularies.Default.AddSingular("(drive)s$", "$1"); // drives does not properly singularize to drive.
Vocabularies.Default.AddSingular("(data)$", "$1"); // exclude the following from singularization.
Vocabularies.Default.AddSingular("(delta)$", "$1");
Vocabularies.Default.AddSingular("(quota)$", "$1");
Expand Down Expand Up @@ -133,7 +133,7 @@ private static string SingularizeAndDeduplicateOperationId(IList<string> operati

singularizedSegments.Add(segment);
}
return string.Join(".", singularizedSegments);
return string.Join('.', singularizedSegments);
}

private static string RemoveHashSuffix(string operationId)
Expand All @@ -153,7 +153,7 @@ private static string RemoveKeyTypeSegment(string operationId, IList<OpenApiPara
segments.Remove(keyTypeExtension);
}
}
return string.Join(".", segments);
return string.Join('.', segments);
}

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

/* Because 'additionalProperties' are now being walked,
* we need a way to keep track of visited schemas to avoid
Expand Down
2 changes: 1 addition & 1 deletion src/Microsoft.OpenApi.Hidi/Logger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public static ILoggerFactory ConfigureLogger(LogLevel logLevel)
{
c.IncludeScopes = true;
})
#if DEBUG
#if DEBUG
.AddDebug()
#endif
.SetMinimumLevel(logLevel);
Expand Down
19 changes: 2 additions & 17 deletions src/Microsoft.OpenApi.Hidi/Microsoft.OpenApi.Hidi.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,14 @@
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<PackAsTool>true</PackAsTool>
<Nullable>enable</Nullable>
<PackageIconUrl>http://go.microsoft.com/fwlink/?LinkID=288890</PackageIconUrl>
<PackageProjectUrl>https://github.com/Microsoft/OpenAPI.NET</PackageProjectUrl>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<Authors>Microsoft</Authors>
<Company>Microsoft</Company>
<Title>Microsoft.OpenApi.Hidi</Title>
<PackageId>Microsoft.OpenApi.Hidi</PackageId>
<ToolCommandName>hidi</ToolCommandName>
<PackageOutputPath>./../../artifacts</PackageOutputPath>
<Version>1.3.0</Version>
<Version>1.3.1</Version>
<Description>OpenAPI.NET CLI tool for slicing OpenAPI documents</Description>
<Copyright>© Microsoft Corporation. All rights reserved.</Copyright>
<PackageTags>OpenAPI .NET</PackageTags>
<RepositoryUrl>https://github.com/Microsoft/OpenAPI.NET</RepositoryUrl>
<PackageReleaseNotes>https://github.com/microsoft/OpenAPI.NET/releases</PackageReleaseNotes>
<AssemblyName>Microsoft.OpenApi.Hidi</AssemblyName>
<RootNamespace>Microsoft.OpenApi.Hidi</RootNamespace>
<SignAssembly>true</SignAssembly>
<!-- https://github.com/dotnet/sourcelink/blob/main/docs/README.md#embeduntrackedsources -->
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<NoWarn>$(NoWarn);NU5048;NU5104;CA1848;</NoWarn>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<PackageReadmeFile>readme.md</PackageReadmeFile>
<AnalysisMode>All</AnalysisMode>
</PropertyGroup>
Expand All @@ -50,7 +35,7 @@
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="7.0.0" />
<PackageReference Include="System.CommandLine" Version="2.0.0-beta4.22272.1" />
<PackageReference Include="Microsoft.OData.Edm" Version="7.18.0" />
<PackageReference Include="Microsoft.OpenApi.OData" Version="1.5.0-preview4" />
<PackageReference Include="Microsoft.OpenApi.OData" Version="1.5.0-preview5" />
<PackageReference Include="Microsoft.OpenApi.ApiManifest" Version="0.5.0-preview" />
<PackageReference Include="System.CommandLine.Hosting" Version="0.4.0-alpha.22272.1" />
</ItemGroup>
Expand Down
Loading
Loading