From 16198ed92fce6c728c5ac37f213b46dab64bd47b Mon Sep 17 00:00:00 2001 From: KennethTang Date: Mon, 21 Dec 2020 21:00:23 +0800 Subject: [PATCH] Release 1.1.2.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修正呼叫 PermissionsApi 的更新分享連結權限流程失敗 bug: https://github.com/NTUT-SELab/MicrosoftGraphBot/issues/19 --- Dockerfile | 4 +- .../MicrosoftGraph/PermissionsApi.cs | 2 +- .../MicrosoftGraphAPIBot.csproj | 38 +++++++++---------- MicrosoftGraphAPIBot/Program.cs | 2 +- .../MicrosoftGraphBotTests.csproj | 8 ++-- ReleaseNotes/1.1.2.0.md | 10 +++++ azure-pipelines.yml | 2 +- 7 files changed, 38 insertions(+), 28 deletions(-) create mode 100644 ReleaseNotes/1.1.2.0.md diff --git a/Dockerfile b/Dockerfile index cbfc889..96c04e2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,9 @@ #See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging. -FROM mcr.microsoft.com/dotnet/core/runtime:3.1-buster-slim AS base +FROM mcr.microsoft.com/dotnet/runtime:5.0 AS base WORKDIR /app -FROM mcr.microsoft.com/dotnet/core/sdk:3.1-buster AS build +FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build WORKDIR /src COPY ["MicrosoftGraphAPIBot/MicrosoftGraphAPIBot.csproj", "MicrosoftGraphAPIBot/"] RUN dotnet restore "MicrosoftGraphAPIBot/MicrosoftGraphAPIBot.csproj" diff --git a/MicrosoftGraphAPIBot/MicrosoftGraph/PermissionsApi.cs b/MicrosoftGraphAPIBot/MicrosoftGraph/PermissionsApi.cs index f999259..fbd35de 100644 --- a/MicrosoftGraphAPIBot/MicrosoftGraph/PermissionsApi.cs +++ b/MicrosoftGraphAPIBot/MicrosoftGraph/PermissionsApi.cs @@ -257,7 +257,7 @@ private static async Task GetShareLinkAsync(IGraphServiceClient grap /// private static async Task UpdateShareLinkAsync(IGraphServiceClient graphClient, string itemId, string linkId) { - var permission = new Permission { Roles = new List{ "write" }}; + var permission = new Permission { Roles = new List{ "write" }, ExpirationDateTime = DateTimeOffset.MaxValue}; Permission item = await graphClient.Me.Drive.Items[itemId].Permissions[linkId] .Request() diff --git a/MicrosoftGraphAPIBot/MicrosoftGraphAPIBot.csproj b/MicrosoftGraphAPIBot/MicrosoftGraphAPIBot.csproj index 09cf94e..3f17f04 100644 --- a/MicrosoftGraphAPIBot/MicrosoftGraphAPIBot.csproj +++ b/MicrosoftGraphAPIBot/MicrosoftGraphAPIBot.csproj @@ -1,8 +1,8 @@ - + Exe - netcoreapp3.1 + net5.0 @@ -10,13 +10,13 @@ - - - + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive @@ -24,29 +24,29 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - - - + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - - + + + + + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all diff --git a/MicrosoftGraphAPIBot/Program.cs b/MicrosoftGraphAPIBot/Program.cs index 2410964..d00b45b 100644 --- a/MicrosoftGraphAPIBot/Program.cs +++ b/MicrosoftGraphAPIBot/Program.cs @@ -42,7 +42,7 @@ private static IHostBuilder CreateHostBuilder(string[] args) => if (!Utils.CheckConfig(hostContext.Configuration)) throw new BotException("Configuration file check failed."); string DBConnection = Utils.GetDBConnection(hostContext.Configuration); - services.AddDbContext(options => + services.AddDbContextPool(options => { options.UseSqlServer(DBConnection); }); diff --git a/MicrosoftGraphBotTests/MicrosoftGraphBotTests.csproj b/MicrosoftGraphBotTests/MicrosoftGraphBotTests.csproj index 01d1529..9f6734c 100644 --- a/MicrosoftGraphBotTests/MicrosoftGraphBotTests.csproj +++ b/MicrosoftGraphBotTests/MicrosoftGraphBotTests.csproj @@ -1,7 +1,7 @@  - netcoreapp3.1 + net5.0 false @@ -11,9 +11,9 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - - - + + + diff --git a/ReleaseNotes/1.1.2.0.md b/ReleaseNotes/1.1.2.0.md new file mode 100644 index 0000000..9134c7e --- /dev/null +++ b/ReleaseNotes/1.1.2.0.md @@ -0,0 +1,10 @@ +## 新功能: + +## 變更: +1. 專案更新,使用 .Net 5 +1. 專案套件更新 + +## Bug 修復: +呼叫 **PermissionsApi 的更新分享連結權限流程**失敗 [(#19)](https://github.com/NTUT-SELab/MicrosoftGraphBot/issues/19) + +## 文檔: diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 126eb6b..7bfe000 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -1,6 +1,6 @@ variables: buildConfiguration: 'Release' - version: '1.1.1.0' + version: '1.1.2.0' stages: - stage: Build_and_Test