From 677d515995b822ac847dc73bff2b61096f0fd859 Mon Sep 17 00:00:00 2001 From: Takashi Shinohara Date: Sat, 3 Jun 2023 15:05:39 +0900 Subject: [PATCH] 1.1.3 release --- .github/workflows/development.yml | 2 +- .github/workflows/production.yml | 3 +- manifest/manifest.json | 2 +- source/client/package-lock.json | 4 +- source/client/package.json | 2 +- .../Commands/EndMeetingCommand.cs | 1 - .../Commands/InMeetingCommand.cs | 1 - .../ConfigureServices.cs | 36 +++++++-------- .../Functions/ExecuteCommandFunction.cs | 1 - .../Karamem0.Commistant.Functions.csproj | 1 + .../appsettings.json | 3 +- .../ConfigureServices.cs | 46 ++++++++++--------- .../Karamem0.Commistant.Web.csproj | 1 + .../server/Karamem0.Commistant.Web/Program.cs | 11 +++-- .../Karamem0.Commistant.Web/appsettings.json | 3 +- 15 files changed, 59 insertions(+), 58 deletions(-) diff --git a/.github/workflows/development.yml b/.github/workflows/development.yml index b85d082..cf897f8 100644 --- a/.github/workflows/development.yml +++ b/.github/workflows/development.yml @@ -4,7 +4,7 @@ on: - develop env: - BUILD_VERSION: 1.1.2.${{github.run_number}} + BUILD_VERSION: 1.1.3.${{github.run_number}} BUILD_CONFIGURATION: Release jobs: diff --git a/.github/workflows/production.yml b/.github/workflows/production.yml index 482983f..081f745 100644 --- a/.github/workflows/production.yml +++ b/.github/workflows/production.yml @@ -6,7 +6,7 @@ on: - v*.*.* env: - BUILD_VERSION: 1.1.2.${{github.run_number}} + BUILD_VERSION: 1.1.3.${{github.run_number}} BUILD_CONFIGURATION: Release jobs: @@ -69,6 +69,7 @@ jobs: path: manifest deploy: needs: build + if: contains(github.ref, 'refs/heads/main') environment: production runs-on: windows-latest steps: diff --git a/manifest/manifest.json b/manifest/manifest.json index 42b7841..d4ffaf3 100644 --- a/manifest/manifest.json +++ b/manifest/manifest.json @@ -1,7 +1,7 @@ { "$schema": "https://developer.microsoft.com/en-us/json-schemas/teams/v1.16/MicrosoftTeams.schema.json", "manifestVersion": "1.16", - "version": "1.1.2", + "version": "1.1.3", "id": "{{AppId}}", "packageName": "dev.karamem0.commistant", "name": { diff --git a/source/client/package-lock.json b/source/client/package-lock.json index bdb63ea..ba4fb44 100644 --- a/source/client/package-lock.json +++ b/source/client/package-lock.json @@ -1,12 +1,12 @@ { "name": "commistant", - "version": "1.1.1", + "version": "1.1.3", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "commistant", - "version": "1.1.1", + "version": "1.1.3", "dependencies": { "@emotion/react": "^11.9.0", "@fluentui/react-icons-mdl2": "^1.3.16", diff --git a/source/client/package.json b/source/client/package.json index 346085c..ffaabd8 100644 --- a/source/client/package.json +++ b/source/client/package.json @@ -1,7 +1,7 @@ { "name": "commistant", "private": true, - "version": "1.1.1", + "version": "1.1.3", "scripts": { "start": "tsc && vite", "build": "tsc && vite build" diff --git a/source/server/Karamem0.Commistant.Functions/Commands/EndMeetingCommand.cs b/source/server/Karamem0.Commistant.Functions/Commands/EndMeetingCommand.cs index 20d033b..84489cd 100644 --- a/source/server/Karamem0.Commistant.Functions/Commands/EndMeetingCommand.cs +++ b/source/server/Karamem0.Commistant.Functions/Commands/EndMeetingCommand.cs @@ -10,7 +10,6 @@ using Karamem0.Commistant.Logging; using Karamem0.Commistant.Models; using Karamem0.Commistant.Services; -using Microsoft.Bot.Builder; using Microsoft.Bot.Connector; using Microsoft.Bot.Schema; using Microsoft.Extensions.Logging; diff --git a/source/server/Karamem0.Commistant.Functions/Commands/InMeetingCommand.cs b/source/server/Karamem0.Commistant.Functions/Commands/InMeetingCommand.cs index 1d05629..5df529f 100644 --- a/source/server/Karamem0.Commistant.Functions/Commands/InMeetingCommand.cs +++ b/source/server/Karamem0.Commistant.Functions/Commands/InMeetingCommand.cs @@ -10,7 +10,6 @@ using Karamem0.Commistant.Logging; using Karamem0.Commistant.Models; using Karamem0.Commistant.Services; -using Microsoft.Bot.Builder; using Microsoft.Bot.Connector; using Microsoft.Bot.Schema; using Microsoft.Extensions.Logging; diff --git a/source/server/Karamem0.Commistant.Functions/ConfigureServices.cs b/source/server/Karamem0.Commistant.Functions/ConfigureServices.cs index 8d08625..6fd207d 100644 --- a/source/server/Karamem0.Commistant.Functions/ConfigureServices.cs +++ b/source/server/Karamem0.Commistant.Functions/ConfigureServices.cs @@ -6,6 +6,7 @@ // https://github.com/karamem0/commistant/blob/main/LICENSE // +using Azure.Identity; using Azure.Storage.Blobs; using Karamem0.Commistant.Commands; using Karamem0.Commistant.Commands.Abstraction; @@ -27,33 +28,30 @@ public static class ConfigureServices public static IServiceCollection AddBlobContainerClient(this IServiceCollection services, IConfiguration configuration) { - return services - .AddSingleton(provider => new BlobServiceClient( - configuration.GetValue("AzureBlobStogageConnectionString"))) - .AddSingleton(provider => provider - .GetService()? - .GetBlobContainerClient(configuration.GetValue("AzureBlobStogageContainerName")) - ?? throw new InvalidOperationException()); + var blobContainerUrl = configuration.GetValue("AzureBlobStogageContainerUrl") ?? throw new InvalidOperationException(); + _ = services.AddSingleton(provider => new BlobContainerClient(new Uri(blobContainerUrl), new DefaultAzureCredential())); + return services; } public static IServiceCollection AddCommands(this IServiceCollection services, IConfiguration configuration) { - return services - .AddSingleton(new MicrosoftAppCredentials( - configuration.GetValue("MicrosoftAppId"), - configuration.GetValue("MicrosoftAppPassword"))) - .AddSingleton() - .AddSingleton() - .AddSingleton() - .AddSingleton((provider) => new CommandSet() - .Add(provider.GetService()) - .Add(provider.GetService()) - .Add(provider.GetService())); + _ = services.AddSingleton(new MicrosoftAppCredentials( + configuration.GetValue("MicrosoftAppId"), + configuration.GetValue("MicrosoftAppPassword"))); + _ = services.AddSingleton(); + _ = services.AddSingleton(); + _ = services.AddSingleton(); + _ = services.AddSingleton((provider) => new CommandSet() + .Add(provider.GetService()) + .Add(provider.GetService()) + .Add(provider.GetService())); + return services; } public static IServiceCollection AddServices(this IServiceCollection services) { - return services.AddTransient(); + _ = services.AddTransient(); + return services; } } diff --git a/source/server/Karamem0.Commistant.Functions/Functions/ExecuteCommandFunction.cs b/source/server/Karamem0.Commistant.Functions/Functions/ExecuteCommandFunction.cs index f697a00..826309d 100644 --- a/source/server/Karamem0.Commistant.Functions/Functions/ExecuteCommandFunction.cs +++ b/source/server/Karamem0.Commistant.Functions/Functions/ExecuteCommandFunction.cs @@ -12,7 +12,6 @@ using Karamem0.Commistant.Commands.Abstraction; using Karamem0.Commistant.Logging; using Karamem0.Commistant.Models; -using Microsoft.ApplicationInsights; using Microsoft.Azure.Functions.Worker; using Microsoft.Bot.Schema; using Microsoft.Extensions.Logging; diff --git a/source/server/Karamem0.Commistant.Functions/Karamem0.Commistant.Functions.csproj b/source/server/Karamem0.Commistant.Functions/Karamem0.Commistant.Functions.csproj index 5f0c1f5..ad304cd 100644 --- a/source/server/Karamem0.Commistant.Functions/Karamem0.Commistant.Functions.csproj +++ b/source/server/Karamem0.Commistant.Functions/Karamem0.Commistant.Functions.csproj @@ -21,6 +21,7 @@ + diff --git a/source/server/Karamem0.Commistant.Functions/appsettings.json b/source/server/Karamem0.Commistant.Functions/appsettings.json index 76045b6..904498a 100644 --- a/source/server/Karamem0.Commistant.Functions/appsettings.json +++ b/source/server/Karamem0.Commistant.Functions/appsettings.json @@ -13,6 +13,5 @@ }, "MicrosoftAppId": "", "MicrosoftAppPassword": "", - "AzureBlobStogageConnectionString": "", - "AzureBlobStogageContainerName": "" + "AzureBlobStogageContainerUrl": "" } diff --git a/source/server/Karamem0.Commistant.Web/ConfigureServices.cs b/source/server/Karamem0.Commistant.Web/ConfigureServices.cs index 8c3ddc2..f3c45ef 100644 --- a/source/server/Karamem0.Commistant.Web/ConfigureServices.cs +++ b/source/server/Karamem0.Commistant.Web/ConfigureServices.cs @@ -6,6 +6,8 @@ // https://github.com/karamem0/commistant/blob/main/LICENSE // +using Azure.Identity; +using Azure.Storage; using Karamem0.Commistant.Adapters; using Karamem0.Commistant.Dialogs; using Karamem0.Commistant.Webs; @@ -29,31 +31,33 @@ public static class ConfigureServices public static IServiceCollection AddBots(this IServiceCollection services, IConfiguration configuration) { - return services - .AddSingleton() - .AddSingleton() - // .AddSingleton(new MemoryStorage()) - .AddSingleton(new BlobsStorage( - configuration.GetValue("AzureBlobStogageConnectionString"), - configuration.GetValue("AzureBlobStogageContainerName"))) - .AddSingleton() - .AddScoped(); + var blobContainerUrl = configuration.GetValue("AzureBlobStogageContainerUrl") ?? throw new InvalidOperationException(); + _ = services.AddSingleton(); + _ = services.AddSingleton(); + // _ = services.AddSingleton(new MemoryStorage()); + _ = services.AddSingleton(new BlobsStorage( + new Uri(blobContainerUrl), + new DefaultAzureCredential(), + new StorageTransferOptions())); + _ = services.AddSingleton(); + _ = services.AddScoped(); + return services; } public static IServiceCollection AddDialogs(this IServiceCollection services) { - return services - .AddScoped() - .AddScoped() - .AddScoped() - .AddScoped() - .AddScoped(provider => new DialogSet(provider - .GetService()? - .CreateProperty(nameof(DialogState))) - .Add(provider.GetService()) - .Add(provider.GetService()) - .Add(provider.GetService()) - .Add(provider.GetService())); + _ = services.AddScoped(); + _ = services.AddScoped(); + _ = services.AddScoped(); + _ = services.AddScoped(); + _ = services.AddScoped(provider => new DialogSet(provider + .GetService()? + .CreateProperty(nameof(DialogState))) + .Add(provider.GetService()) + .Add(provider.GetService()) + .Add(provider.GetService()) + .Add(provider.GetService())); + return services; } } diff --git a/source/server/Karamem0.Commistant.Web/Karamem0.Commistant.Web.csproj b/source/server/Karamem0.Commistant.Web/Karamem0.Commistant.Web.csproj index 771632d..4131b24 100644 --- a/source/server/Karamem0.Commistant.Web/Karamem0.Commistant.Web.csproj +++ b/source/server/Karamem0.Commistant.Web/Karamem0.Commistant.Web.csproj @@ -21,6 +21,7 @@ + diff --git a/source/server/Karamem0.Commistant.Web/Program.cs b/source/server/Karamem0.Commistant.Web/Program.cs index bf92bdb..f431fa7 100644 --- a/source/server/Karamem0.Commistant.Web/Program.cs +++ b/source/server/Karamem0.Commistant.Web/Program.cs @@ -6,6 +6,8 @@ // https://github.com/karamem0/commistant/blob/main/LICENSE // +#pragma warning disable CA1852 + using Karamem0.Commistant; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; @@ -39,10 +41,9 @@ _ = app.UseWebSockets(); _ = app.UseRouting(); _ = app.UseAuthorization(); -_ = app.UseEndpoints(endpoints => -{ - _ = endpoints.MapControllers(); - _ = endpoints.MapFallbackToFile("/index.html"); -}); +_ = app.MapControllers(); +_ = app.MapFallbackToFile("/index.html"); app.Run(); + +#pragma warning restore CA1852 diff --git a/source/server/Karamem0.Commistant.Web/appsettings.json b/source/server/Karamem0.Commistant.Web/appsettings.json index 13bc56f..4a5526e 100644 --- a/source/server/Karamem0.Commistant.Web/appsettings.json +++ b/source/server/Karamem0.Commistant.Web/appsettings.json @@ -15,6 +15,5 @@ "MicrosoftAppId": "", "MicrosoftAppPassword": "", "MicrosoftAppTenantId": "", - "AzureBlobStogageConnectionString": "", - "AzureBlobStogageContainerName": "" + "AzureBlobStogageContainerUrl": "" }