Skip to content

Commit

Permalink
3.2.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
karamem0 committed Dec 9, 2024
1 parent f8a5001 commit 5788406
Show file tree
Hide file tree
Showing 39 changed files with 519 additions and 364 deletions.
24 changes: 1 addition & 23 deletions .github/workflows/build-bot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,13 @@ jobs:
shell: pwsh
run: |
$content = Get-Content -Path ${{env.FILE_PATH}}
$content = $content -replace "{{APP_DOMAIN_NAME}}", "${{vars.APP_DOMAIN_NAME}}"
$content = $content -Replace "{{APP_DOMAIN_NAME}}", "${{vars.APP_DOMAIN_NAME}}"
Out-File -FilePath ${{env.FILE_PATH}} -InputObject $content -Encoding UTF8
env:
FILE_PATH: source/server/Karamem0.Commistant.Bot/wwwroot/index.html
- name: Restore source
run: dotnet restore
working-directory: source/server
- name: Test source
shell: pwsh
run: |
dotnet test `
Karamem0.Commistant.Tests/Karamem0.Commistant.Tests.csproj `
--filter TestCategory=Karamem0.Commistant.Bot `
-p:AltCover=true `
-- NUnit.TestOutputXml=${{github.workspace}}/source/server/test
working-directory: source/server
- name: Build source
shell: pwsh
run: |
Expand All @@ -53,16 +44,3 @@ jobs:
name: bot
path: source/server/build
include-hidden-files: true
- name: Upload test results
uses: enricomi/publish-unit-test-result-action/linux@v2
if: always()
with:
files: source/server/test/*.xml
check_name: Bot test results
- name: Upload coverage reports
uses: codecov/codecov-action@v4
if: always()
with:
fail_ci_if_error: true
token: ${{secrets.CODECOV_TOKEN}}
slug: karamem0/commistant
22 changes: 0 additions & 22 deletions .github/workflows/build-func.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,6 @@ jobs:
- name: Restore source
run: dotnet restore
working-directory: source/server
- name: Test source
shell: pwsh
run: |
dotnet test `
Karamem0.Commistant.Tests/Karamem0.Commistant.Tests.csproj `
--filter TestCategory=Karamem0.Commistant.Functions `
-p:AltCover=true `
-- NUnit.TestOutputXml=${{github.workspace}}/source/server/test
working-directory: source/server
- name: Build source
shell: pwsh
run: |
Expand All @@ -45,16 +36,3 @@ jobs:
name: func
path: source/server/build
include-hidden-files: true
- name: Upload test results
uses: enricomi/publish-unit-test-result-action/linux@v2
if: always()
with:
files: source/server/test/*.xml
check_name: Func test results
- name: Upload coverage reports
uses: codecov/codecov-action@v4
if: always()
with:
fail_ci_if_error: true
token: ${{secrets.CODECOV_TOKEN}}
slug: karamem0/commistant
26 changes: 2 additions & 24 deletions .github/workflows/build-web.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ jobs:
shell: pwsh
run: |
$content = Get-Content -Path ${{env.FILE_PATH}}
$content = $content -replace "{{APP_DOMAIN_NAME}}", "${{vars.APP_DOMAIN_NAME}}"
$content = $content -replace "{{TELEMETRY_CONNECTION_STRING}}", "${{vars.TELEMETRY_CONNECTION_STRING}}"
$content = $content -Replace "{{APP_DOMAIN_NAME}}", "${{vars.APP_DOMAIN_NAME}}"
$content = $content -Replace "{{TELEMETRY_CONNECTION_STRING}}", "${{vars.TELEMETRY_CONNECTION_STRING}}"
Out-File -FilePath ${{env.FILE_PATH}} -InputObject $content -Encoding UTF8
env:
FILE_PATH: source/client/.env
Expand All @@ -42,15 +42,6 @@ jobs:
- name: Restore server
run: dotnet restore
working-directory: source/server
- name: Test source
shell: pwsh
run: |
dotnet test `
Karamem0.Commistant.Tests/Karamem0.Commistant.Tests.csproj `
--filter TestCategory=Karamem0.Commistant.Web `
-p:AltCover=true `
-- NUnit.TestOutputXml=${{github.workspace}}/source/server/test
working-directory: source/server
- name: Build source
shell: pwsh
run: |
Expand All @@ -67,16 +58,3 @@ jobs:
name: web
path: source/server/build
include-hidden-files: true
- name: Upload test results
uses: enricomi/publish-unit-test-result-action/linux@v2
if: always()
with:
files: source/server/test/*.xml
check_name: Web test results
- name: Upload coverage reports
uses: codecov/codecov-action@v4
if: always()
with:
fail_ci_if_error: true
token: ${{secrets.CODECOV_TOKEN}}
slug: karamem0/commistant
21 changes: 15 additions & 6 deletions .github/workflows/develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,29 @@ on:
- develop

jobs:
test:
name: Test source
uses: ./.github/workflows/test.yml
secrets: inherit
with:
environment: dev
build-bot:
name: Build bot
needs: test
uses: ./.github/workflows/build-bot.yml
secrets: inherit
with:
environment: dev
deploy-bot:
name: Deploy bot
needs: build-bot
uses: ./.github/workflows/deploy-bot.yml
secrets: inherit
with:
environment: dev
name: Deploy bot
needs: build-bot
uses: ./.github/workflows/deploy-bot.yml
secrets: inherit
with:
environment: dev
build-web:
name: Build web
needs: test
uses: ./.github/workflows/build-web.yml
secrets: inherit
with:
Expand All @@ -32,6 +40,7 @@ jobs:
environment: dev
build-func:
name: Build func
needs: test
uses: ./.github/workflows/build-func.yml
secrets: inherit
with:
Expand Down
43 changes: 43 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
on:
workflow_call:
inputs:
environment:
required: true
type: string

jobs:
run:
name: Run
environment: ${{inputs.environment}}
runs-on: ubuntu-latest
steps:
- name: Checkout repos
uses: actions/checkout@v4
- name: Setup .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.x
- name: Restore source
run: dotnet restore
working-directory: source/server
- name: Test source
shell: pwsh
run: |
dotnet test `
Karamem0.Commistant.Tests/Karamem0.Commistant.Tests.csproj `
-p:AltCover=true `
-- NUnit.TestOutputXml=${{github.workspace}}/source/server/test
working-directory: source/server
- name: Upload test results
uses: enricomi/publish-unit-test-result-action/linux@v2
if: always()
with:
files: source/server/test/*.xml
check_name: Test results
- name: Upload coverage reports
uses: codecov/codecov-action@v4
if: always()
with:
fail_ci_if_error: true
token: ${{secrets.CODECOV_TOKEN}}
slug: karamem0/commistant
1 change: 0 additions & 1 deletion source/server/.vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"dependsOn": "clean",
"problemMatcher": "$msCompile"
},
{
Expand Down
4 changes: 2 additions & 2 deletions source/server/Karamem0.Commistant.Bot/Bots/ActivityBot.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ namespace Karamem0.Commistant.Bots;
public class ActivityBot(
ConversationState conversationState,
DialogSet dialogSet,
OpenAIService openAIService,
IOpenAIService openAIService,
ILogger<ActivityBot> logger
) : TeamsActivityHandler
{
Expand All @@ -37,7 +37,7 @@ ILogger<ActivityBot> logger

private readonly DialogSet dialogSet = dialogSet;

private readonly OpenAIService openAIService = openAIService;
private readonly IOpenAIService openAIService = openAIService;

private readonly ILogger logger = logger;

Expand Down
16 changes: 9 additions & 7 deletions source/server/Karamem0.Commistant.Bot/ConfigureServices.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Karamem0.Commistant;
Expand All @@ -33,7 +34,7 @@ public static class ConfigureServices

public static IServiceCollection AddBots(this IServiceCollection services, IConfiguration configuration)
{
var blobContainerUrl = configuration.GetValue<string>("AzureBotStatesStorageUrl") ?? throw new InvalidOperationException();
var blobContainerUrl = configuration["AzureBotStatesStorageUrl"] ?? throw new InvalidOperationException();
_ = services.AddSingleton<BotFrameworkAuthentication, ConfigurationBotFrameworkAuthentication>();
_ = services.AddSingleton<IBotFrameworkHttpAdapter, AdapterWithErrorHandler>();
_ = services.AddSingleton<IStorage>(new BlobsStorage(
Expand Down Expand Up @@ -64,18 +65,19 @@ public static IServiceCollection AddDialogs(this IServiceCollection services)

public static IServiceCollection AddServices(this IServiceCollection services, IConfiguration configuration)
{
var openAIEndpointUrl = configuration.GetValue<string>("AzureOpenAIEndpointUrl") ?? throw new InvalidOperationException();
var openAIModelName = configuration.GetValue<string>("AzureOpenAIModelName") ?? throw new InvalidOperationException();
var openAIEndpointUrl = configuration["AzureOpenAIEndpointUrl"] ?? throw new InvalidOperationException();
var openAIModelName = configuration["AzureOpenAIModelName"] ?? throw new InvalidOperationException();
_ = services.AddScoped(provider => new AzureOpenAIClient(
new Uri(openAIEndpointUrl),
new DefaultAzureCredential()
));
_ = services.AddScoped(provider => new OpenAIService(
provider.GetRequiredService<AzureOpenAIClient>() ?? throw new InvalidOperationException(),
_ = services.AddScoped<QRCodeGenerator>();
_ = services.AddScoped<IAdaptiveCardService, AdaptiveCardService>();
_ = services.AddScoped<IOpenAIService>(provider => new OpenAIService(
provider.GetRequiredService<AzureOpenAIClient>(),
openAIModelName
));
_ = services.AddScoped<QRCodeGenerator>();
_ = services.AddScoped<QrCodeService>();
_ = services.AddScoped<IQRCodeService, QRCodeService>();
return services;
}

Expand Down
Loading

0 comments on commit 5788406

Please sign in to comment.