Skip to content

Commit

Permalink
Release/4.8.0 (#206)
Browse files Browse the repository at this point in the history
* Google Adapter: Google Content Type not set to UTF-8
* Alexa Adapter: Add person to alexasystem to support Alexa voiceprint to know the ID of the speaker (#198) - Thanks @jamesemann 
* TwitterAdapter: Added unit tests (#197) - Thanks @matiasroldan6 @santgr11 
* DevOps: Azure DevOps Pipelines GitVersion issue
* Dependencies: Update to Bot Framework SDK 4.8
  • Loading branch information
garypretty authored Mar 20, 2020
1 parent 8d5383d commit 08a21b9
Show file tree
Hide file tree
Showing 34 changed files with 745 additions and 48 deletions.
27 changes: 19 additions & 8 deletions Bot.Builder.Community.sln
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Bot.Builder.Community.Adapt
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Bot.Builder.Community.Dialogs.Luis", "libraries\Bot.Builder.Community.Dialogs.Luis\Bot.Builder.Community.Dialogs.Luis.csproj", "{2FE9D83B-59AB-4475-BE6F-4803118B1A81}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Bot.Builder.Community.Adapters.Twitter.Tests", "tests\Bot.Builder.Community.Adapters.Tests\Bot.Builder.Community.Adapters.Twitter.Tests.csproj", "{873C9B8C-2677-4586-89D3-C80FB1263596}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug - NuGet Packages|Any CPU = Debug - NuGet Packages|Any CPU
Expand Down Expand Up @@ -223,14 +225,6 @@ Global
{1EF09D96-D5EB-4445-8369-E87A7A59FA93}.Documentation|Any CPU.Build.0 = Debug|Any CPU
{1EF09D96-D5EB-4445-8369-E87A7A59FA93}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1EF09D96-D5EB-4445-8369-E87A7A59FA93}.Release|Any CPU.Build.0 = Release|Any CPU
{2FE9D83B-59AB-4475-BE6F-4803118B1A81}.Debug - NuGet Packages|Any CPU.ActiveCfg = Debug|Any CPU
{2FE9D83B-59AB-4475-BE6F-4803118B1A81}.Debug - NuGet Packages|Any CPU.Build.0 = Debug|Any CPU
{2FE9D83B-59AB-4475-BE6F-4803118B1A81}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2FE9D83B-59AB-4475-BE6F-4803118B1A81}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2FE9D83B-59AB-4475-BE6F-4803118B1A81}.Documentation|Any CPU.ActiveCfg = Debug|Any CPU
{2FE9D83B-59AB-4475-BE6F-4803118B1A81}.Documentation|Any CPU.Build.0 = Debug|Any CPU
{2FE9D83B-59AB-4475-BE6F-4803118B1A81}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2FE9D83B-59AB-4475-BE6F-4803118B1A81}.Release|Any CPU.Build.0 = Release|Any CPU
{06CECA83-4578-467E-80DD-66C4D0526B9D}.Debug - NuGet Packages|Any CPU.ActiveCfg = Debug|Any CPU
{06CECA83-4578-467E-80DD-66C4D0526B9D}.Debug - NuGet Packages|Any CPU.Build.0 = Debug|Any CPU
{06CECA83-4578-467E-80DD-66C4D0526B9D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
Expand All @@ -239,6 +233,22 @@ Global
{06CECA83-4578-467E-80DD-66C4D0526B9D}.Documentation|Any CPU.Build.0 = Debug|Any CPU
{06CECA83-4578-467E-80DD-66C4D0526B9D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{06CECA83-4578-467E-80DD-66C4D0526B9D}.Release|Any CPU.Build.0 = Release|Any CPU
{2FE9D83B-59AB-4475-BE6F-4803118B1A81}.Debug - NuGet Packages|Any CPU.ActiveCfg = Debug|Any CPU
{2FE9D83B-59AB-4475-BE6F-4803118B1A81}.Debug - NuGet Packages|Any CPU.Build.0 = Debug|Any CPU
{2FE9D83B-59AB-4475-BE6F-4803118B1A81}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2FE9D83B-59AB-4475-BE6F-4803118B1A81}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2FE9D83B-59AB-4475-BE6F-4803118B1A81}.Documentation|Any CPU.ActiveCfg = Debug|Any CPU
{2FE9D83B-59AB-4475-BE6F-4803118B1A81}.Documentation|Any CPU.Build.0 = Debug|Any CPU
{2FE9D83B-59AB-4475-BE6F-4803118B1A81}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2FE9D83B-59AB-4475-BE6F-4803118B1A81}.Release|Any CPU.Build.0 = Release|Any CPU
{873C9B8C-2677-4586-89D3-C80FB1263596}.Debug - NuGet Packages|Any CPU.ActiveCfg = Debug|Any CPU
{873C9B8C-2677-4586-89D3-C80FB1263596}.Debug - NuGet Packages|Any CPU.Build.0 = Debug|Any CPU
{873C9B8C-2677-4586-89D3-C80FB1263596}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{873C9B8C-2677-4586-89D3-C80FB1263596}.Debug|Any CPU.Build.0 = Debug|Any CPU
{873C9B8C-2677-4586-89D3-C80FB1263596}.Documentation|Any CPU.ActiveCfg = Debug|Any CPU
{873C9B8C-2677-4586-89D3-C80FB1263596}.Documentation|Any CPU.Build.0 = Debug|Any CPU
{873C9B8C-2677-4586-89D3-C80FB1263596}.Release|Any CPU.ActiveCfg = Release|Any CPU
{873C9B8C-2677-4586-89D3-C80FB1263596}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -270,6 +280,7 @@ Global
{1EF09D96-D5EB-4445-8369-E87A7A59FA93} = {DC62D60A-2EA2-4DB1-B1BA-C8F38D3940B3}
{06CECA83-4578-467E-80DD-66C4D0526B9D} = {BF310E8A-8DA1-441F-90E9-DE0E66553048}
{2FE9D83B-59AB-4475-BE6F-4803118B1A81} = {08759E28-8592-4EBA-9A07-19A5BED3FB0C}
{873C9B8C-2677-4586-89D3-C80FB1263596} = {840D4038-9AB8-4750-9FFE-365386CE47E2}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {9FE3B75E-BA2B-45BC-BBF0-DDA8BA10C4F0}
Expand Down
11 changes: 7 additions & 4 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,12 @@ variables:

steps:

- task: gittools.gitversion.gitversion-task.GitVersion@4
- task: UseGitVersion@5
name: gv
displayName: GitVersion
inputs:
preferBundledVersion: false
versionSpec: '5.x'
additionalArguments: '/output BuildServer'

- task: DotNetCoreCLI@2
displayName: Restore
Expand All @@ -34,7 +36,7 @@ steps:
command: build
projects: 'Bot.Builder.Community.sln'
versioningScheme: byEnvVar
versionEnvVar: GitVersion.NuGetVersion
versionEnvVar: gv.GitVersion.NuGetVersion
arguments: "--configuration $(buildConfiguration)"

- task: DotNetCoreCLI@2
Expand All @@ -54,8 +56,9 @@ steps:
packDirectory: '$(Build.ArtifactStagingDirectory)/packages'
configuration: '$(buildConfiguration)'
versioningScheme: byEnvVar
versionEnvVar: GitVersion.NuGetVersion
versionEnvVar: gv.GitVersion.NuGetVersion
nobuild: true
arguments: "-IncludeReferencedProjects"
condition: succeeded()

- task: PublishBuildArtifacts@1
Expand Down
9 changes: 9 additions & 0 deletions libraries/Bot.Builder.Community.Adapters.Alexa/AlexaSchema.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ public class AlexaSystem
public AlexaDevice Device { get; set; }

public AlexaUser User { get; set; }

public AlexaPerson Person { get; set; }
}

public class AlexaApplication
Expand Down Expand Up @@ -98,6 +100,13 @@ public class AlexaUser
public string AccessToken { get; set; }
}

public class AlexaPerson
{
public string PersonId { get; set; }

public string AccessToken { get; set; }
}

public class AlexaAudioPlayer
{
public string Token{ get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Bot.Builder" Version="4.6.3" />
<PackageReference Include="Microsoft.Bot.Builder" Version="4.8.0" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="2.2.0" />
<PackageReference Include="Microsoft.AspNetCore.Hosting.Abstractions" Version="2.1.1" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="2.1.1" />
<PackageReference Include="Microsoft.Extensions.Options" Version="2.1.1" />
<PackageReference Include="Microsoft.Net.Http.Headers" Version="2.1.1" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.1" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@
<ItemGroup>
<PackageReference Include="JWT" Version="5.0.1" />
<PackageReference Include="Microsoft.AspNet.WebApi.Core" Version="5.2.4" />
<PackageReference Include="Microsoft.Bot.Builder" Version="4.6.3" />
<PackageReference Include="Microsoft.Bot.Builder" Version="4.8.0" />
<PackageReference Include="Microsoft.AspNetCore.Hosting.Abstractions" Version="2.1.1" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="2.1.1" />
<PackageReference Include="Microsoft.Extensions.Options" Version="2.1.1" />
<PackageReference Include="Microsoft.Net.Http.Headers" Version="2.1.1" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.1" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Http.Abstractions" Version="2.2.0" />
<PackageReference Include="Microsoft.Bot.Builder" Version="4.6.3" />
<PackageReference Include="Microsoft.Bot.Builder" Version="4.8.0" />
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="2.2.0" />
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="2.2.0" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Bot.Builder.Dialogs" Version="4.5.1" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.1" />
<PackageReference Include="Microsoft.Bot.Builder.Dialogs" Version="4.8.0" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Mvc.Core" Version="2.2.0" />
<PackageReference Include="Microsoft.Bot.Builder" Version="4.6.3" />
<PackageReference Include="Microsoft.Bot.Builder.Dialogs" Version="4.5.1" />
<PackageReference Include="Microsoft.Recognizers.Text.DataTypes.TimexExpression" Version="1.2.4" />
<PackageReference Include="Microsoft.Bot.Builder" Version="4.8.0" />
<PackageReference Include="Microsoft.Bot.Builder.Dialogs" Version="4.8.0" />
<PackageReference Include="Microsoft.Recognizers.Text.DataTypes.TimexExpression" Version="1.3.2" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Bot.Builder" Version="4.6.3" />
<PackageReference Include="Microsoft.Bot.Builder.Dialogs" Version="4.5.1" />
<PackageReference Include="Microsoft.Recognizers.Text" Version="1.2.6.1" />
<PackageReference Include="Microsoft.Recognizers.Text.Choice" Version="1.2.6.1" />
<PackageReference Include="Microsoft.Recognizers.Text.DataTypes.TimexExpression" Version="1.2.4" />
<PackageReference Include="Microsoft.Recognizers.Text.DateTime" Version="1.2.6.1" />
<PackageReference Include="Microsoft.Bot.Builder" Version="4.8.0" />
<PackageReference Include="Microsoft.Bot.Builder.Dialogs" Version="4.8.0" />
<PackageReference Include="Microsoft.Recognizers.Text" Version="1.3.2" />
<PackageReference Include="Microsoft.Recognizers.Text.Choice" Version="1.3.2" />
<PackageReference Include="Microsoft.Recognizers.Text.DataTypes.TimexExpression" Version="1.3.2" />
<PackageReference Include="Microsoft.Recognizers.Text.DateTime" Version="1.3.2" />
<PackageReference Include="SourceLink.Create.CommandLine" Version="2.8.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@

<ItemGroup>
<PackageReference Include="CoreCompat.System.Drawing" Version="1.0.0-beta006" />
<PackageReference Include="Microsoft.Bot.Builder" Version="4.6.3" />
<PackageReference Include="Microsoft.Bot.Builder.Dialogs" Version="4.5.1" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.1" />
<PackageReference Include="Microsoft.Bot.Builder" Version="4.8.0" />
<PackageReference Include="Microsoft.Bot.Builder.Dialogs" Version="4.8.0" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Bot.Builder.Dialogs" Version="4.6.3" />
<PackageReference Include="Microsoft.Bot.Builder.Dialogs" Version="4.8.0" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Bot.Builder.Dialogs" Version="4.6.3" />
<PackageReference Include="Microsoft.Bot.Builder.Dialogs" Version="4.8.0" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Mvc.Core" Version="2.2.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.ViewFeatures" Version="2.2.0" />
<PackageReference Include="Microsoft.Bot.Builder" Version="4.6.3" />
<PackageReference Include="Microsoft.Bot.Builder" Version="4.8.0" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="2.1.1" />
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="2.1.1" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Bot.Builder" Version="4.6.3" />
<PackageReference Include="Microsoft.Bot.Builder" Version="4.8.0" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Bot.Builder" Version="4.6.3" />
<PackageReference Include="Microsoft.Bot.Builder" Version="4.8.0" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<PackageReference Include="Microsoft.AspNetCore.Mvc.Core" Version="2.2.5" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.ViewFeatures" Version="2.2.0" />
<PackageReference Include="Microsoft.Azure.CognitiveServices.Language.TextAnalytics" Version="4.0.0" />
<PackageReference Include="Microsoft.Bot.Builder" Version="4.6.3" />
<PackageReference Include="Microsoft.Bot.Builder" Version="4.8.0" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="3.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="3.0.0" />
<PackageReference Include="SentimentAnalyzer" Version="1.1.0" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<PackageReference Include="Microsoft.AspNetCore.Mvc.Core" Version="2.2.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.ViewFeatures" Version="2.2.0" />
<PackageReference Include="Microsoft.Azure.CognitiveServices.Language.SpellCheck" Version="3.0.0" />
<PackageReference Include="Microsoft.Bot.Builder" Version="4.6.3" />
<PackageReference Include="Microsoft.Bot.Builder" Version="4.8.0" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="2.1.1" />
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="2.1.1" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Bot.Builder" Version="4.6.3" />
<PackageReference Include="Microsoft.Bot.Builder" Version="4.8.0" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Bot.Builder" Version="4.6.3" />
<PackageReference Include="Microsoft.Bot.Builder" Version="4.8.0" />
<PackageReference Include="NEST" Version="6.4.1" />
<PackageReference Include="NEST.JsonNetSerializer" Version="6.4.1" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.1" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Bot.Builder" Version="4.6.3" />
<PackageReference Include="Microsoft.Bot.Builder" Version="4.8.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="2.2.3" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="2.2.3" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.1" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
using System.Collections.Generic;
using Bot.Builder.Community.Adapters.Twitter.Webhooks.Models;
using Bot.Builder.Community.Adapters.Twitter.Webhooks.Models.Twitter;
using Microsoft.Bot.Schema;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace Bot.Builder.Community.Adapters.Twitter.Tests
{
[TestClass]
[TestCategory("Twitter")]
public class ActivityExtensionsTests
{
[TestMethod]
public void AsTwitterMessageWithEmptyMessageShouldFail()
{
var activity = new Activity()
{
Text = null,
Type = ActivityTypes.Message
};

Assert.ThrowsException<TwitterException>(
() =>
{
activity.AsTwitterMessage();
}, "You can't send an empty message.");
}

[TestMethod]
public void AsTwitterMessageWithLongMessageShouldFail()
{
var activity = new Activity()
{
Text = new string('a', 10001),
Type = ActivityTypes.Message
};

Assert.ThrowsException<TwitterException>(
() =>
{
activity.AsTwitterMessage();
}, "Invalid message, the length of the message should be less than 10000 chars.");
}

[TestMethod]
public void AsTwitterMessageShouldReturnNewDirectMessage()
{
var activity = new Activity()
{
Text = "test",
Type = ActivityTypes.Message,
Recipient = new ChannelAccount()
{
Id = null
}
};

Assert.IsInstanceOfType(activity.AsTwitterMessage(), typeof(NewDirectMessageObject));
}

[TestMethod]
public void AsTwitterMessageShouldReturnNewDirectMessageWithQuickReply()
{
var activity = new Activity()
{
Text = "test",
Type = ActivityTypes.Message,
Recipient = new ChannelAccount()
{
Id = null
},
SuggestedActions = new SuggestedActions()
{
Actions = new List<CardAction> { new CardAction(ActionTypes.OpenUrl, "Get Started", value: "https://docs.microsoft.com/bot-framework") }
}
};

Assert.IsInstanceOfType(activity.AsTwitterMessage().Event.MessageCreate.MessageData.QuickReply, typeof(NewEvent_QuickReply));
}
}
}
Loading

0 comments on commit 08a21b9

Please sign in to comment.