-
Notifications
You must be signed in to change notification settings - Fork 369
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Copy runtime into new bot projects (#1016)
* add deploy scripts * remove commented line. * rename the script and add environment. * add output * add luis config. * add custom config from PR #719 * minor fix for comments. * deploy steps in settings page * add runtime generate script * update design of deploy wizard, include realistic commands, copy to clipboard, improvements to nav glow * add currently open bot projects' path to the state * remove admin controller for key managment, use script instead. * add deployment runtime * use dotnet set user secrets command to set luis key and app password * add application insights deloyment template. * add cosmos db deployment * add error message for deploy script. * delete scripts in local runtime. only keep scripts in deployment runtime instead. * add azure storage deployment * change folder name * 2 buttons on deploy screen * 2 buttons on deploy screen * reset the local runtime. * remove docker related file for templates. * change namespace. * remove auto reloading in template runtime * add settings check for cosmosdb && azure storage for tranScript * delete user secret id, change nuget settings. * remove composerdata folder. * init user secret. * include composerdialogs. * bot path is not necessary. * remove debugger. * Adjust new bot creation to include the runtime code Move dialog content in the templates into a folder called ComposerDialogs/ * update to validation, form values * sync validators * gif file * Add support for copying files from the local folder rather than some externally specified folder * add final GIF for deploy * move generated folder into ComposerDialogs * Fix case of Scripts folder in deploy instructions * ensure lu and dialog files end up inside the composerDialogs folder * add luis feature * Update template-with-preexisting-rg.json * complete luis feature. * make sure bot content is loaded from ComposerDialogs * use settings from project file to determine luis * slightly adjust paths * clean up * fix path * fix path * update assetmanager test to include runtime path * add empty runtime * adjust tests to compensate for new folders * update paths for test settings files * fix linter error * update tests
- Loading branch information
Showing
114 changed files
with
10,856 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# NuGet Packages | ||
*.nupkg | ||
# The packages folder can be ignored because of Package Restore | ||
**/[Pp]ackages/* | ||
# except build/, which is used as an MSBuild target. | ||
!**/[Pp]ackages/build/ | ||
|
||
!Properties/launchSettings.json | ||
!packages/packages.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<Project Sdk="Microsoft.NET.Sdk.Web"> | ||
<PropertyGroup> | ||
<TargetFramework>netcoreapp2.1</TargetFramework> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Compile Remove="Tests\**" /> | ||
<Content Remove="Tests\**" /> | ||
<EmbeddedResource Remove="Tests\**" /> | ||
<None Remove="Tests\**" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<None Include="ComposerDialogs\**"> | ||
<CopyToOutputDirectory>Always</CopyToOutputDirectory> | ||
</None> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.1.1" /> | ||
<PackageReference Include="Microsoft.Bot.Builder" Version="4.6.0-Daily-2019-08-31-01" /> | ||
<PackageReference Include="Microsoft.Bot.Builder.ApplicationInsights" Version="4.6.0-Daily-2019-08-31-01" /> | ||
<PackageReference Include="Microsoft.Bot.Builder.Azure" Version="4.6.0-Daily-2019-08-31-01" /> | ||
<PackageReference Include="Microsoft.Bot.Builder.Dialogs.Adaptive" Version="4.6.0-Daily-2019-08-31-01" /> | ||
<PackageReference Include="Microsoft.Bot.Builder.Dialogs.Debugging" Version="4.6.0-Daily-2019-08-31-01" /> | ||
<PackageReference Include="Microsoft.Bot.Builder.Dialogs.Declarative" Version="4.6.0-Daily-2019-08-31-01" /> | ||
<PackageReference Include="Microsoft.Bot.Builder.Integration.ApplicationInsights.Core" Version="4.6.0-Daily-2019-08-31-01" /> | ||
<PackageReference Include="Microsoft.Bot.Builder.Integration.AspNet.Core" Version="4.6.0-Daily-2019-08-31-01" /> | ||
<PackageReference Include="Microsoft.Bot.Builder.LanguageGeneration.Renderer" Version="4.6.0-Daily-2019-08-31-01" /> | ||
<PackageReference Include="Microsoft.Bot.Connector" Version="4.6.0-Daily-2019-08-31-01" /> | ||
<PackageReference Include="MSTest.TestFramework" Version="1.4.0" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Folder Include="ComposerDialogs\" /> | ||
</ItemGroup> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio 15 | ||
VisualStudioVersion = 15.0.28307.136 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BotProject", "BotProject.csproj", "{80ACF5BE-4A04-46F8-A83E-530FB21948D5}" | ||
EndProject | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tests", "Tests\Tests.csproj", "{5AFADEA2-A18F-46DF-8080-2CA418880318}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{80ACF5BE-4A04-46F8-A83E-530FB21948D5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{80ACF5BE-4A04-46F8-A83E-530FB21948D5}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{80ACF5BE-4A04-46F8-A83E-530FB21948D5}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{80ACF5BE-4A04-46F8-A83E-530FB21948D5}.Release|Any CPU.Build.0 = Release|Any CPU | ||
{5AFADEA2-A18F-46DF-8080-2CA418880318}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{5AFADEA2-A18F-46DF-8080-2CA418880318}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{5AFADEA2-A18F-46DF-8080-2CA418880318}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{5AFADEA2-A18F-46DF-8080-2CA418880318}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
GlobalSection(ExtensibilityGlobals) = postSolution | ||
SolutionGuid = {B13FC467-1A63-4C8F-A29E-43B2D8B79B17} | ||
EndGlobalSection | ||
EndGlobal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
using Microsoft.ApplicationInsights.Extensibility; | ||
using Microsoft.Bot.Builder.Azure; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Threading.Tasks; | ||
|
||
namespace Microsoft.Bot.Builder.ComposerBot.json | ||
{ | ||
public class BotSettings | ||
{ | ||
public BotSettings() | ||
{ | ||
|
||
} | ||
|
||
public BlobStorageConfiguration BlobStorage { get; set; } | ||
|
||
public string MicrosoftAppId { get; set; } | ||
|
||
public string MicrosoftAppPassword { get; set; } | ||
|
||
public CosmosDbStorageOptions CosmosDb { get; set; } | ||
|
||
public TelemetryConfiguration AppInsights { get; set; } | ||
|
||
public class BlobStorageConfiguration | ||
{ | ||
public BlobStorageConfiguration() | ||
{ | ||
|
||
} | ||
|
||
public string ConnectionString { get; set; } | ||
public string Container { get; set; } | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
using System.IO; | ||
using System.Linq; | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
using Microsoft.Bot.Builder.Dialogs; | ||
using Microsoft.Bot.Builder.Dialogs.Adaptive; | ||
using Microsoft.Bot.Builder.Dialogs.Debugging; | ||
using Microsoft.Bot.Builder.Dialogs.Declarative; | ||
using Microsoft.Bot.Builder.Dialogs.Declarative.Resources; | ||
using Microsoft.Bot.Schema; | ||
using Microsoft.Extensions.Configuration; | ||
using Microsoft.Recognizers.Text; | ||
using Newtonsoft.Json; | ||
|
||
|
||
namespace Microsoft.Bot.Builder.ComposerBot.json | ||
{ | ||
public class ComposerBot : ActivityHandler | ||
{ | ||
private AdaptiveDialog rootDialog; | ||
private readonly ResourceExplorer resourceExplorer; | ||
private UserState userState; | ||
private DialogManager dialogManager; | ||
private ConversationState conversationState; | ||
private IStatePropertyAccessor<DialogState> dialogState; | ||
private Source.IRegistry registry; | ||
private string rootDialogFile { get; set; } | ||
private IBotTelemetryClient telemetryClient; | ||
|
||
public ComposerBot(string rootDialogFile, ConversationState conversationState, UserState userState, ResourceExplorer resourceExplorer, Source.IRegistry registry, IBotTelemetryClient telemetryClient) | ||
{ | ||
this.conversationState = conversationState; | ||
this.userState = userState; | ||
this.dialogState = conversationState.CreateProperty<DialogState>("DialogState"); | ||
this.registry = registry; | ||
this.resourceExplorer = resourceExplorer; | ||
this.rootDialogFile = rootDialogFile; | ||
this.telemetryClient = telemetryClient; | ||
|
||
LoadRootDialogAsync(); | ||
} | ||
|
||
private void LoadRootDialogAsync() | ||
{ | ||
var rootFile = resourceExplorer.GetResource(rootDialogFile); | ||
rootDialog = DeclarativeTypeLoader.Load<AdaptiveDialog>(rootFile, resourceExplorer, registry); | ||
this.dialogManager = new DialogManager(rootDialog); | ||
} | ||
|
||
public override async Task OnTurnAsync(ITurnContext turnContext, CancellationToken cancellationToken = default(CancellationToken)) | ||
{ | ||
this.telemetryClient.TrackTrace("Activity:" + turnContext.Activity.Text, Severity.Information, null); | ||
await this.dialogManager.OnTurnAsync(turnContext, cancellationToken: cancellationToken); | ||
await this.conversationState.SaveChangesAsync(turnContext, false, cancellationToken); | ||
await this.userState.SaveChangesAsync(turnContext, false, cancellationToken); | ||
} | ||
} | ||
} |
Oops, something went wrong.