Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: azure publish plugin #2733

Merged
merged 90 commits into from
May 5, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
90 commits
Select commit Hold shift + click to select a range
917d55f
split the configuration as object
VanyLaw Apr 17, 2020
ea63c3b
fix deployment script, change settings path
Apr 17, 2020
f983141
fix bugs in deploy script and change credential type:
VanyLaw Apr 19, 2020
1be2ea2
Merge remote-tracking branch 'origin/master' into wenyluo/azure
VanyLaw Apr 19, 2020
88913c6
finish gethistory, getstatus, update history and status after publish
VanyLaw Apr 20, 2020
80f097e
add some code comments for clarity
benbrown Apr 21, 2020
72e2074
more code comments
benbrown Apr 21, 2020
92a035f
more code comments for clarity
benbrown Apr 21, 2020
ef6200f
add login script and hash the config as folder name
VanyLaw Apr 22, 2020
c6f043c
fix conflict
VanyLaw Apr 22, 2020
fb8bc82
add bot deploy package build into lib build
VanyLaw Apr 23, 2020
a6e0f45
fix conflict
VanyLaw Apr 23, 2020
455b1f4
split the provision part out of composer
VanyLaw Apr 23, 2020
2965613
Merge remote-tracking branch 'origin/master' into wenyluo/azure
VanyLaw Apr 24, 2020
ccb3516
fix luis appid unfound error
Apr 24, 2020
b4c4544
fix typo
Apr 24, 2020
96dac2e
Merge branch 'master' into qika/luisfix
cwhitten Apr 24, 2020
289329b
polish
VanyLaw Apr 26, 2020
89ad619
Merge remote-tracking branch 'origin/master' into wenyluo/azure
VanyLaw Apr 26, 2020
fa1f7e0
use bot root to config the path of settings
Apr 26, 2020
b7d4a09
Merge branch 'qika/luisfix' of https://github.com/microsoft/BotFramew…
Apr 26, 2020
4ba7e17
differ bot to different layer
Apr 26, 2020
2a50531
change the order of loading settings
Apr 26, 2020
3debaf4
remove customizeConfiguration object in config
VanyLaw Apr 26, 2020
1fadb22
use project files instead dataDir, remove cred file and provisionResu…
VanyLaw Apr 27, 2020
bed80c4
update schema
VanyLaw Apr 27, 2020
ab25d87
change login and provision script, from save file to output to console
VanyLaw Apr 27, 2020
50d9d5a
add comment
benbrown Apr 27, 2020
1b9d780
Merge branch 'wenyluo/azure' of github.com:microsoft/BotFramework-Com…
benbrown Apr 27, 2020
4575055
Merge branch 'master' of github.com:microsoft/BotFramework-Composer i…
benbrown Apr 27, 2020
01eda4f
fix merge conflict
benbrown Apr 27, 2020
6be07e0
format resulting profile
benbrown Apr 27, 2020
a2e6684
add comment about security
benbrown Apr 27, 2020
ebd17fb
use Bearer token auth when doing zipdeploy
benbrown Apr 27, 2020
3a4ce80
Merge remote-tracking branch 'origin/master' into wenyluo/azure
VanyLaw Apr 28, 2020
28d19c2
move provision out of composer, and make sure it not depend on intern…
VanyLaw Apr 28, 2020
0038555
add provision subfields schema
VanyLaw Apr 28, 2020
39559d7
use token replace the credential
VanyLaw Apr 28, 2020
31587c0
Merge branch 'master' of github.com:microsoft/BotFramework-Composer i…
benbrown Apr 28, 2020
c013942
fix output of token
benbrown Apr 28, 2020
b4ab009
Merge branch 'wenyluo/azure' of github.com:microsoft/BotFramework-Com…
benbrown Apr 28, 2020
099d44e
Merge branch 'master' of github.com:microsoft/BotFramework-Composer i…
benbrown Apr 28, 2020
dd22ff6
Merge remote-tracking branch 'origin/master' into wenyluo/azure
VanyLaw Apr 29, 2020
2a6d21f
change the error message when token expire
VanyLaw Apr 29, 2020
4a479d8
add provision error details, add configurable
Apr 29, 2020
da0f0f6
Merge branch 'wenyluo/azure' of https://github.com/microsoft/BotFrame…
Apr 29, 2020
f1327d2
update schema require and log message return
VanyLaw Apr 29, 2020
08adf7b
Merge branch 'wenyluo/azure' of https://github.com/microsoft/BotFrame…
VanyLaw Apr 29, 2020
0048b4a
fix parse
Apr 29, 2020
63b3249
Merge branch 'wenyluo/azure' of https://github.com/microsoft/BotFrame…
VanyLaw Apr 29, 2020
7a709f4
fix template
Apr 29, 2020
a79c0bb
Merge branch 'wenyluo/azure' of https://github.com/microsoft/BotFrame…
VanyLaw Apr 29, 2020
0a288e0
update schema and provision script
VanyLaw Apr 29, 2020
c8936bd
fix provision luis configurable
VanyLaw Apr 29, 2020
203582e
detail the token's error handle
VanyLaw Apr 29, 2020
418690b
Merge branch 'wenyluo/azure' of github.com:microsoft/BotFramework-Com…
benbrown Apr 29, 2020
0db1838
Merge branch 'wenyluo/azure' of github.com:microsoft/BotFramework-Com…
benbrown Apr 29, 2020
5e1f0d0
Merge branch 'master' of github.com:microsoft/BotFramework-Composer i…
benbrown Apr 29, 2020
d428f6e
Add support for using the ejected runtime code instead of the built i…
benbrown Apr 29, 2020
ddb492e
Make it optional to persist the history to disk.
benbrown Apr 29, 2020
6c3a227
Merge branch 'master' of github.com:microsoft/BotFramework-Composer i…
benbrown Apr 29, 2020
72a03dc
move provision script into shared asset folder that is copied into al…
benbrown Apr 29, 2020
f1a53b1
add to readme
benbrown Apr 29, 2020
a605ccf
more readme
benbrown Apr 29, 2020
421ba26
more readme
benbrown Apr 29, 2020
7916c04
clean up tmp folder after publish completes or fails
benbrown Apr 29, 2020
a8ef620
remove empty config in provision and appPassword in provision result,…
VanyLaw Apr 30, 2020
20e614c
Merge remote-tracking branch 'origin/master' into wenyluo/azure
VanyLaw Apr 30, 2020
b2e0d21
add token error handle when zipdeploy fail
VanyLaw Apr 30, 2020
aa67614
improve output of provision script:
benbrown Apr 30, 2020
28b69ee
improve output
benbrown Apr 30, 2020
8805ab3
Merge remote-tracking branch 'origin/master' into wenyluo/azure
VanyLaw May 1, 2020
f38555e
remove webManagerClient and use token instead
VanyLaw May 1, 2020
5f897e7
clean up the order of fields, remove unused fields from profile
benbrown May 1, 2020
2cd96c1
use publisher description rather than package name
benbrown May 1, 2020
2694ffd
feat: Runtime refactor, new directory structure and Azure Function in…
carlosscastro May 1, 2020
99a2359
add an optional instructions field to the publish plugin so we ca nex…
benbrown May 1, 2020
f3d8374
Merge branch 'wenyluo/azure' of github.com:microsoft/BotFramework-Com…
benbrown May 1, 2020
5e748ad
merge master
benbrown May 1, 2020
2993d4a
merge commit
benbrown May 1, 2020
5403cea
Merge branch 'master' into wenyluo/azure
benbrown May 4, 2020
af1b00d
fix linter warning
benbrown May 4, 2020
7f3d4f6
handle errors in kill procss
benbrown May 4, 2020
e095acb
Fix issue where luis key was included twice, causing conflicts
benbrown May 5, 2020
4c4b922
Merge branch 'master' of github.com:microsoft/BotFramework-Composer i…
benbrown May 5, 2020
0619988
remove unnecessary dupe fields from schema
benbrown May 5, 2020
cc3305c
Merge branch 'master' of github.com:microsoft/BotFramework-Composer i…
benbrown May 5, 2020
6f6de59
Merge branch 'master' into wenyluo/azure
cwhitten May 5, 2020
a87ff76
fix for modified schema path
benbrown May 5, 2020
b40de0f
erge branch 'wenyluo/azure' of github.com:microsoft/BotFramework-Comp…
benbrown May 5, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

* @cwhitten @boydc2014 @a-b-r-o-w-n

/BotProject/ @boydc2014 @luhan2017
/runtime/ @boydc2014 @luhan2017 @carlosscastro @benbrown

/Composer/ @cwhitten @boydc2014 @a-b-r-o-w-n @corinagum @beyackle @srinaath @tonyanziano

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,10 @@ jobs:
dotnet-version: "3.1.102" # SDK Version to use.
- name: dotnet build
run: dotnet build
working-directory: BotProject/Templates/CSharp
working-directory: runtime/dotnet
- name: dotnet test
run: dotnet test
working-directory: BotProject/Templates/CSharp
working-directory: runtime/dotnet/tests

docker-build:
name: Docker Build
Expand Down
1 change: 0 additions & 1 deletion BotProject/Node/README.md

This file was deleted.

31 changes: 0 additions & 31 deletions BotProject/Templates/CSharp/BotProject.sln

This file was deleted.

44 changes: 0 additions & 44 deletions BotProject/Templates/CSharp/README.md

This file was deleted.

19 changes: 0 additions & 19 deletions BotProject/Templates/CSharp/Tests/Tests.csproj

This file was deleted.

6 changes: 3 additions & 3 deletions Composer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@
"build:server": "yarn workspace @bfc/server build",
"build:client": "yarn workspace @bfc/client build",
"build:tools": "yarn workspace @bfc/tools build:all",
"build:plugins": "cd plugins/localPublish && yarn install && yarn build",
"build:plugins": "concurrently \"cd plugins/localPublish && yarn install && yarn build\" \"cd plugins/azurePublish && yarn install && yarn build\" ",
"start": "cross-env NODE_ENV=production PORT=3000 yarn start:server",
"startall": "node scripts/update.js && yarn start",
"start:dev": "concurrently \"npm:start:client\" \"npm:start:server:dev\"",
"start:client": "yarn workspace @bfc/client start",
"start:server": "yarn workspace @bfc/server start",
"start:server:dev": "yarn workspace @bfc/server start:dev",
"runtime": "cd ../BotProject/CSharp/ && dotnet build && dotnet run",
"runtime": "cd ../runtime/dotnet/azurewebapp && dotnet build && dotnet run",
"test": "yarn typecheck && jest",
"test:watch": "yarn typecheck && jest --watch",
"test:coverage": "yarn test --coverage --no-cache --reporters=default",
Expand Down Expand Up @@ -113,4 +113,4 @@
"dependencies": {
"cross-env": "^6.0.3"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const CreatePublishTarget: React.FC<CreatePublishTargetProps> = props => {
const [errorMessage, setErrorMsg] = useState('');

const targetTypes = useMemo(() => {
return props.types.map(t => ({ key: t.name, text: t.name }));
return props.types.map(t => ({ key: t.name, text: t.description }));
}, [props.targets]);

const updateType = (_e, option?: IDropdownOption) => {
Expand All @@ -57,6 +57,10 @@ const CreatePublishTarget: React.FC<CreatePublishTargetProps> = props => {
}
};

const instructions: string | undefined = useMemo((): string | undefined => {
return targetType ? props.types.find(t => t.name === targetType)?.instructions : '';
}, [props.targets, targetType]);

const schema = useMemo(() => {
return targetType ? props.types.find(t => t.name === targetType)?.schema : undefined;
}, [props.targets, targetType]);
Expand Down Expand Up @@ -99,6 +103,7 @@ const CreatePublishTarget: React.FC<CreatePublishTargetProps> = props => {
defaultSelectedKey={props.current ? props.current.type : null}
onChange={updateType}
/>
{instructions && <p>{instructions}</p>}
<div css={label}>{formatMessage('Publish Configuration')}</div>
<JsonEditor key={targetType} onChange={updateConfig} height={200} value={config} schema={schema} />
<button type="submit" hidden disabled={isDisable()} />
Expand Down
4 changes: 2 additions & 2 deletions Composer/packages/client/src/pages/publish/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ const Publish: React.FC<PublishPageProps> = props => {
actions.getPublishHistory(projectId, _selected);
}
}
}, [settings.publishTargets, selectedTargetName]);
}, [projectId, selectedTargetName]);

// once history is loaded, display it
useEffect(() => {
Expand Down Expand Up @@ -197,7 +197,7 @@ const Publish: React.FC<PublishPageProps> = props => {
},
]);
}
}, [publishHistory, selectedTargetName, settings.publishTargets]);
}, [publishHistory, selectedTargetName]);

// check history to see if a 202 is found
useEffect(() => {
Expand Down
1 change: 1 addition & 0 deletions Composer/packages/client/src/store/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ export interface StorageFolder extends File {
export interface PublishType {
name: string;
description: string;
instructions?: string;
schema?: JSONSchema7;
features: {
history: boolean;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const fs = require('fs-extra');
const { resolve } = require('path');
const electronBuildConfig = require('../electron-builder-config.json');

const source = resolve(__dirname, '../../../../BotProject');
const source = resolve(__dirname, '../../../../runtime');

let destination;
switch (process.platform) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export function resolveRef(
): JSONSchema7 {
if (typeof schema?.$ref === 'string') {
const defName = schema.$ref.replace('#/definitions/', '');
const defSchema = typeof definitions[defName] === 'object' ? (definitions[defName] as JSONSchema7) : {};
const defSchema = typeof definitions?.[defName] === 'object' ? (definitions?.[defName] as JSONSchema7) : {};

const resolvedSchema = {
...defSchema,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,11 @@ export class ComposerPluginRegistration {
/**************************************************************************************
* Publish related features
*************************************************************************************/
public async addPublishMethod(plugin: PublishPlugin, schema?: JSONSchema7) {
public async addPublishMethod(plugin: PublishPlugin, schema?: JSONSchema7, instructions?: string) {
log('registering publish method', this.name);
this.loader.extensions.publish[this.name] = {
plugin: this,
instructions: instructions,
methods: plugin,
schema: schema,
};
Expand All @@ -77,9 +78,9 @@ export class ComposerPluginRegistration {
* to communicate with the Bot Framework Emulator.
* ```ts
* await composer.addRuntimeTemplate({
* key: 'csharp',
* key: 'azurewebapp',
* name: 'C#',
* path: __dirname + '/../../../../BotProject/Templates/CSharp',
* path: __dirname + '/../../../../runtime/dotnet/azurewebapp',
* startCommand: 'dotnet run',
* });
* ```
Expand Down
2 changes: 2 additions & 0 deletions Composer/packages/extensions/plugin-loader/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ export interface ExtensionCollection {
[key: string]: {
plugin: ComposerPluginRegistration;
methods: PublishPlugin;
/** (Optional instructions displayed in the UI) */
instructions?: string;
/** (Optional) Schema for publishing configuration. */
schema?: JSONSchema7;
};
Expand Down
2 changes: 2 additions & 0 deletions Composer/packages/lib/bot-deploy/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/node_modules
/lib
2 changes: 1 addition & 1 deletion Composer/packages/lib/bot-deploy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
// The ARM template file path, default is 'DeploymentTemplates/template-with-preexisting-rg.json'
templatePath?: string

// Dotnet project path, default is 'BotProject.csproj'
// Dotnet project path, default is 'Microsoft.BotFramework.Composer.WebApp.csproj'
dotnetProjectPath?: string

// Lubuild generated folder path, default is 'generated'
Expand Down
5 changes: 3 additions & 2 deletions Composer/packages/lib/bot-deploy/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"description": "typescript version of bot deployment",
"main": "lib/index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "echo \"Error: no test specified\" && exit 1",
"build": "tsc"
},
"author": "",
"license": "MIT",
Expand All @@ -28,4 +29,4 @@
"request": "^2.88.2",
"request-promise": "^4.2.5"
}
}
}
Loading