-
Notifications
You must be signed in to change notification settings - Fork 3
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
feat: Create Dialogporten Serviceowner client library #1513
base: main
Are you sure you want to change the base?
Changes from 115 commits
d33461f
afa5316
d4b96db
64db1f9
cbd3e76
3689808
7f17006
324cf3f
288175c
e538c94
7135268
2b9238b
a6e66b5
eb590e1
b499151
f8691de
ed42f73
2f613c0
71aefc8
1fb84e6
60571b6
2640a4b
1f3c8b3
76b5964
d3062a2
b09f6d4
fd8907e
41a2eb5
1bdca4d
1b7f5a7
c4f5daf
56a5ebe
af4f6a3
708b09e
4a15f4a
3849c42
0894c17
329e8eb
f46deb3
2a15b37
431cc85
4def26a
ff1d0f8
347d729
cdee031
d75e113
054c9ce
b85b008
457e9b7
81df398
020e538
bf88cdc
aac7bfa
21c9e87
4655774
40f54fe
0c663ee
5a3c578
a08e486
e71db25
b96fb3b
a82f91d
aba1aec
2d5dd74
075854b
b952394
9fd4304
8d6b5c0
2b203a1
e46f868
c5ae633
68d65bc
bcba03c
f159e5d
e1ae100
8588f26
a3113dc
1793fd7
0299d68
8a72bec
b034ddb
99ef7ec
d60ac48
5e5778c
f20e113
a3496be
65da398
8e7ac5b
480f159
40aec95
5b2fca1
9ca5505
f21d71d
810a809
e327f47
837b133
156d3da
741833a
4dfbf76
0025468
febc391
377cef1
a680681
024e3cb
44842d9
199607c
3c0d18d
3c9762e
acba3c3
1d5d9ac
948579b
fd86499
00ddab2
47bfc21
025dadb
a58f912
74170c6
c6d4a3f
3064ea0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -93,6 +93,16 @@ jobs: | |
version: ${{ needs.get-current-version.outputs.version }} | ||
runMigration: ${{ github.event_name == 'workflow_dispatch' || needs.check-for-changes.outputs.hasMigrationChanges == 'true' }} | ||
|
||
publish-sdk-to-nuget: | ||
uses: ./.github/workflows/workflow-publish-nuget.yml | ||
needs: [ get-current-version, check-for-changes ] | ||
if: ${{ needs.check-for-changes.outputs.hasBackendChanges == 'true' || needs.check-for-changes.outputs.hasTestChanges == 'true' }} | ||
with: | ||
version: ${{ needs.get-current-version.outputs.version }} | ||
path: $(find . -name '*Digdir.Library.Dialogporten.WebApiClient.csproj' -printf "%p" -quit) | ||
secrets: | ||
NUGET_API_KEY: ${{ secrets.NUGET_API_TEST_KEY }} | ||
Comment on lines
+96
to
+104
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Improve robustness of project file path resolution The current implementation has several potential issues:
Consider using a dedicated step to find the project file: publish-sdk-to-nuget:
uses: ./.github/workflows/workflow-publish-nuget.yml
needs: [ get-current-version, check-for-changes ]
if: ${{ needs.check-for-changes.outputs.hasBackendChanges == 'true' || needs.check-for-changes.outputs.hasTestChanges == 'true' }}
+ run: |
+ PROJECT_PATH=$(find . -name "Digdir.Library.Dialogporten.WebApiClient.csproj" -not -path "*/test/*" -print -quit)
+ echo "PROJECT_PATH=$PROJECT_PATH" >> $GITHUB_ENV
with:
version: ${{ needs.get-current-version.outputs.version }}
- path: $(find . -name '*Digdir.Library.Dialogporten.WebApiClient.csproj' -printf "%p" -quit)
+ path: ${{ env.PROJECT_PATH }}
secrets:
NUGET_API_KEY: ${{ secrets.NUGET_API_TEST_KEY }} This approach:
|
||
|
||
store-apps-version: | ||
name: Store Latest Deployed Apps Version as GitHub Variable | ||
needs: [deploy-apps, get-current-version] | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
name: "Publish nuget package" | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
version: | ||
description: "Version" | ||
required: true | ||
type: string | ||
Fargekritt marked this conversation as resolved.
Show resolved
Hide resolved
|
||
path: | ||
description: "Path to project" | ||
required: true | ||
type: string | ||
source: | ||
description: "Nuget Source" | ||
required: false | ||
type: string | ||
default: https://int.nugettest.org | ||
secrets: | ||
NUGET_API_KEY: | ||
required: true | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 15 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: set PROJECT variable to point to project | ||
run: | | ||
PROJECT="${{inputs.path}}" | ||
echo "PROJECT ${PROJECT}" | ||
echo "PROJECT=${PROJECT}" >> "$GITHUB_ENV" | ||
|
||
- name: Set up .NET | ||
uses: actions/setup-dotnet@v4 | ||
with: | ||
global-json-file: ./global.json | ||
|
||
- name: Build | ||
run: dotnet build --configuration Release /p:Version="${{ inputs.version }}" "${PROJECT}" | ||
|
||
- name: Pack with debug symbols | ||
run: dotnet pack --configuration Release /p:Version="${{ inputs.version }}" -p:IncludeSymbols=true -p:SymbolPackageFormat=snupkg --output . "${PROJECT}" | ||
|
||
- name: Upload artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: package | ||
path: '*.*nupkg' | ||
push: | ||
needs: build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Download artifact | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: package | ||
|
||
- name: Push to NuGet | ||
run: dotnet nuget push *.nupkg --source "${{ inputs.source }}" --api-key ${{secrets.NUGET_API_KEY}} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. kalle denne
|
||
"openApiPath": "docs/schema/V1/swagger.verified.json", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Blir refitter bare kalt kun en gang? Eller gjør vi det hver gang API endrer seg? Isåfall burde vi kanskje ha det som en del av bygg-steget? 🤔 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. akkurat nå blir den generert av en test lignene swaggerSnapshot testen. men holder på å prøver meg litt frem for å finne en løsning |
||
"namespace": "Digdir.Library.Dialogporten.WebApiClient.Features.V1", | ||
"outputFolder": "src/Digdir.Library.Dialogporten.WebApiClient/Features/V1/", | ||
"operationNameGenerator": "SingleClientFromOperationId", | ||
"multipleInterfaces": "ByTag", | ||
"includeTags": [ | ||
|
||
], | ||
"useCancellationTokens": true, | ||
"returnIApiResponse": true, | ||
"useDynamicQuerystringParameters": true, | ||
"outputFilename": "RefitterInterface.cs" | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,28 +9,41 @@ | |
<ItemGroup> | ||
<PackageReference Include="Azure.Identity" Version="1.13.2" /> | ||
<PackageReference Include="FastEndpoints.Swagger" Version="5.33.0"/> | ||
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="9.0.1" /> | ||
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="9.0.1" /> | ||
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="9.0.1" /> | ||
<PackageReference Include="Serilog.Sinks.OpenTelemetry" Version="4.1.1" /> | ||
<PackageReference Include="Microsoft.Azure.AppConfiguration.AspNetCore" Version="8.0.0" /> | ||
<PackageReference Include="Serilog.AspNetCore" Version="9.0.0" /> | ||
<PackageReference Include="Serilog.Enrichers.Environment" Version="3.0.1" /> | ||
<PackageReference Include="Azure.Monitor.OpenTelemetry.AspNetCore" Version="1.2.0" /> | ||
<PackageReference Include="OpenTelemetry.Exporter.Console" Version="1.10.0" /> | ||
<PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.10.0" /> | ||
<PackageReference Include="OpenTelemetry.Instrumentation.EntityFrameworkCore" Version="1.10.0-beta.1" /> | ||
<PackageReference Include="OpenTelemetry" Version="1.10.0" /> | ||
<PackageReference Include="OpenTelemetry.Instrumentation.Runtime" Version="1.10.0" /> | ||
<PackageReference Include="Npgsql.OpenTelemetry" Version="9.0.2" /> | ||
<PackageReference Include="ZiggyCreatures.FusionCache.OpenTelemetry" Version="1.4.1" /> | ||
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="9.0.1"/> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hva har skjedd her? Det er litt vanskelig å se hvilke endringer denne fila faktisk inneholder når space på slutten av hver package reference er blitt fjernet og alt er å regne som en endring. Kan du gjøre slik at change settet kun inneholder det som faktisk er endret? |
||
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="9.0.1"/> | ||
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="9.0.1"/> | ||
<PackageReference Include="NSwag.Generation" Version="14.2.0"/> | ||
<PackageReference Include="NSwag.MSBuild" Version="14.2.0"> | ||
<PrivateAssets>all</PrivateAssets> | ||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | ||
</PackageReference> | ||
<PackageReference Include="Serilog.Sinks.OpenTelemetry" Version="4.1.1"/> | ||
|
||
<PackageReference Include="Microsoft.Azure.AppConfiguration.AspNetCore" Version="8.0.0"/> | ||
<PackageReference Include="Serilog.AspNetCore" Version="9.0.0"/> | ||
<PackageReference Include="Serilog.Enrichers.Environment" Version="3.0.1"/> | ||
<PackageReference Include="Azure.Monitor.OpenTelemetry.AspNetCore" Version="1.2.0"/> | ||
<PackageReference Include="OpenTelemetry.Exporter.Console" Version="1.10.0"/> | ||
<PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.10.0"/> | ||
<PackageReference Include="OpenTelemetry.Instrumentation.EntityFrameworkCore" Version="1.10.0-beta.1"/> | ||
<PackageReference Include="OpenTelemetry" Version="1.10.0"/> | ||
<PackageReference Include="OpenTelemetry.Instrumentation.Runtime" Version="1.10.0"/> | ||
<PackageReference Include="Npgsql.OpenTelemetry" Version="9.0.2"/> | ||
<PackageReference Include="ZiggyCreatures.FusionCache.OpenTelemetry" Version="1.4.1"/> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\Digdir.Domain.Dialogporten.Application\Digdir.Domain.Dialogporten.Application.csproj" /> | ||
<ProjectReference Include="..\Digdir.Domain.Dialogporten.Infrastructure\Digdir.Domain.Dialogporten.Infrastructure.csproj" /> | ||
<ProjectReference Include="..\Digdir.Library.Utils.AspNet\Digdir.Library.Utils.AspNet.csproj" /> | ||
<ProjectReference Include="..\Digdir.Tool.Dialogporten.GenerateFakeData\Digdir.Tool.Dialogporten.GenerateFakeData.csproj" /> | ||
<ProjectReference Include="..\Digdir.Domain.Dialogporten.Application\Digdir.Domain.Dialogporten.Application.csproj"/> | ||
<ProjectReference Include="..\Digdir.Domain.Dialogporten.Infrastructure\Digdir.Domain.Dialogporten.Infrastructure.csproj"/> | ||
<ProjectReference Include="..\Digdir.Library.Utils.AspNet\Digdir.Library.Utils.AspNet.csproj"/> | ||
<ProjectReference Include="..\Digdir.Tool.Dialogporten.GenerateFakeData\Digdir.Tool.Dialogporten.GenerateFakeData.csproj"/> | ||
</ItemGroup> | ||
|
||
<Target Name="NSwag" AfterTargets="Build" Condition="$(Configuration)=='Release'"> | ||
<Exec WorkingDirectory="$(ProjectDir)" EnvironmentVariables="ASPNETCORE_ENVIRONMENT=Development" Command="$(NSwagExe_net90) aspnetcore2openapi /nobuild:true /project:$(MSBuildProjectFullPath) /configuration:$(Configuration) /output:$(TargetDir)/swagger.json"/> | ||
</Target> | ||
|
||
|
||
|
||
|
||
</Project> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace shell command with predefined path.
Using a shell command in YAML value is problematic as it:
Consider using a predefined path or workflow input parameter instead:
📝 Committable suggestion