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

release: 12-10-2019 #1752

Merged
merged 45 commits into from
Dec 11, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
f0ebe56
docs: update coveralls badge (#1621)
a-b-r-o-w-n Nov 20, 2019
29b4232
fix: Fix interruption sample (#1624)
luhan2017 Nov 21, 2019
2f96b52
refactor: convert cypress tests to typescript (#1630)
a-b-r-o-w-n Nov 21, 2019
7e84f05
add directlinespeech support (#1637)
xieofxie Nov 22, 2019
4be03bf
ci: include better information in validate-pr action errors (#1634)
a-b-r-o-w-n Nov 22, 2019
1904471
test: allow running composer in hosted mode for tests (#1356)
p-nagpal Nov 22, 2019
9e70664
fix: support horizontal scrolling in visual eidtor (#1607)
alanlong9278 Nov 25, 2019
fefa1bb
chore: bump browserslist (#1645)
cwhitten Nov 25, 2019
1f9bd35
chore: reduce form width to 400px (#1648)
cwhitten Nov 25, 2019
49b4997
add browserslist to dependencies (#1656)
a-b-r-o-w-n Nov 25, 2019
b2faf6a
ci: do not fail CI if coveralls step fails (#1655)
a-b-r-o-w-n Nov 25, 2019
01d70e4
fix: dialog name incorrect when creating new dialog in form editor (#…
alanlong9278 Nov 25, 2019
32ce909
ci: run cypress in single job for now (#1658)
a-b-r-o-w-n Nov 26, 2019
6c8b9cf
feat: support default path environment variable (#1652)
liweitian Nov 26, 2019
3609b4e
chore: enforce node >=12 (#1665)
a-b-r-o-w-n Nov 26, 2019
f492bef
ci: correctly clean up server process after e2e tests (#1666)
a-b-r-o-w-n Nov 26, 2019
70e13ef
feat: Trigger Node (#1529)
yeze322 Nov 29, 2019
ae7fa1d
feat: LG LSP in Composer (#1504)
zhixzhan Nov 29, 2019
9bfd927
chore: add startup script to check for oudated versions (#1674)
cwhitten Dec 2, 2019
0048f8d
build: give more memory available to Node in docker (#1670)
benbrown Dec 2, 2019
12f6c62
refactor: centralize lg parsing logic to 'shared' lib (#1663)
yeze322 Dec 2, 2019
cc6ed01
make update script cross platform compatible (#1687)
a-b-r-o-w-n Dec 3, 2019
8c55ba3
add fault tolerance for syntax highlighting (#1690)
cosmicshuai Dec 3, 2019
076439b
chore: update typescript, eslint and prettier (#1686)
a-b-r-o-w-n Dec 3, 2019
9b4831f
chore: Adds license fields, fixes incorrect link, hides some left-nav…
cwhitten Dec 3, 2019
730433c
fix: ability to view storages when in local dev on mac (#1696)
a-b-r-o-w-n Dec 3, 2019
a470770
refactor: upgrade lg parser and syntax (#1676)
zhixzhan Dec 4, 2019
997df62
feat: Align with the new design in form for inline error display (#1683)
alanlong9278 Dec 4, 2019
f74ce9c
fix: location select Content component (#1668)
liweitian Dec 5, 2019
9d93ad8
update LGTheme (#1706)
cosmicshuai Dec 5, 2019
01cd533
build: make docker great again (#1709)
a-b-r-o-w-n Dec 6, 2019
797900e
fix: visual editor lg template don't show (#1707)
zhixzhan Dec 6, 2019
844df12
feat: Deep linking for the notification page (#1667)
lei9444 Dec 7, 2019
a0a144f
fix: minor styling and labeling for linting ux (#1716)
cwhitten Dec 7, 2019
cde21e2
fix unsync bug, optimize error display (#1704)
zhixzhan Dec 7, 2019
7677101
build: add ability to configure runtime path (#1713)
a-b-r-o-w-n Dec 9, 2019
2cf35f1
greed lg parse (#1733)
zhixzhan Dec 9, 2019
a5f8a7c
style: update visual editor action title style (#1710)
yeze322 Dec 9, 2019
21d1b7f
feat: link to tab (#1738)
lei9444 Dec 9, 2019
1eeac22
ci: disallow opening pr against stable branch unless a release (#1740)
a-b-r-o-w-n Dec 9, 2019
4180fed
style: Updated Array UI (#1617)
tdurnford Dec 10, 2019
6ea46cd
feat: show error message in form editor. (#1737)
alanlong9278 Dec 10, 2019
72197a2
fix sample (#1749)
boydc2014 Dec 10, 2019
978e8a9
docs: R7 Doc Release (#1743)
Kaiqb Dec 10, 2019
99e87dc
docs: update changelog (#1750)
a-b-r-o-w-n Dec 11, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
32 changes: 23 additions & 9 deletions .github/actions/conventional-pr/src/conventional-pr.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
import * as core from '@actions/core';
import * as github from '@actions/github';

import { validateTitle, validateBody } from './utils';
import {
validateTitle,
validateBody,
validateBaseBranch,
PullRequestInfo,
isRelease,
} from './utils';

const OWNER = github.context.repo.owner;
const REPO = github.context.repo.repo;
Expand All @@ -22,6 +28,7 @@ const prQuery = `
pullRequest(number: $prNumber) {
title
body
baseRefName
}
}
}
Expand All @@ -43,22 +50,29 @@ async function run() {
repo: REPO,
prNumber,
});
const pr = repository.pullRequest;
const pr = repository?.pullRequest as PullRequestInfo;

if (!pr) {
core.setFailed('Not in a Pull Request context.');
return;
}

const titleErrors = validateTitle(pr.title);
const bodyErrors = validateBody(pr.body);
if (!isRelease(pr)) {
const titleErrors = validateTitle(pr.title);
const bodyErrors = validateBody(pr.body);
const branchErrors = validateBaseBranch(pr.title, pr.baseRefName);

if (titleErrors.length) {
core.setFailed(titleErrors.join('\n'));
}
if (titleErrors.length) {
core.setFailed(titleErrors.join('\n'));
}

if (bodyErrors.length) {
core.setFailed(bodyErrors.join('\n'));
if (bodyErrors.length) {
core.setFailed(bodyErrors.join('\n'));
}

if (branchErrors.length) {
core.setFailed(branchErrors.join('\n'));
}
}
} catch (err) {
core.error(err);
Expand Down
38 changes: 34 additions & 4 deletions .github/actions/conventional-pr/src/utils.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
import * as core from '@actions/core';

export interface PullRequestInfo {
title: string;
body: string;
baseRefName: string;
}
type ValidationResult = string[];

const validTypes = [
Expand All @@ -14,6 +19,7 @@ const validTypes = [
'ci',
'chore',
'revert',
'release',
];

const typeList = validTypes.map(t => ` - ${t}`).join('\n');
Expand All @@ -28,22 +34,46 @@ export function validateTitle(title: string): ValidationResult {
const hastype = validTypes.some(t => title.startsWith(`${t}: `));

if (!hastype) {
core.info(
`[Title] Missing type in title. Choose from the following:\n${typeList}`
errors.push(
`[Title] Must start with type (ex. 'feat: ').\nThe valid types are:\n${typeList}`
);
errors.push("[Title] Must start with type. i.e. 'feat: '");
}

return errors;
}

const refMatch = /(refs?|close(d|s)?|fix(ed|es)?) \#\d+/i;
const helpLink =
'https://help.github.com/en/github/managing-your-work-on-github/closing-issues-using-keywords';

export function validateBody(body: string): ValidationResult {
let errors: ValidationResult = [];

if (!refMatch.test(body)) {
errors.push('[Body] Must reference an issue.');
errors.push(
`[Body] Must reference an issue (ex. 'fixes #1234').\nSee ${helpLink} for more details.`
);
}

return errors;
}

export function isRelease(pr: PullRequestInfo) {
return pr.title.startsWith('release: ') && pr.baseRefName === 'stable';
}

export function validateBaseBranch(
title: string,
baseBranch: string
): ValidationResult {
let errors: ValidationResult = [];

if (title.startsWith('release: ') && baseBranch !== 'stable') {
errors.push("[Release] Release pull request must target 'stable' branch.");
} else if (baseBranch === 'stable') {
errors.push(
"[Branch] Pull requests cannot target 'stable' branch. Perhaps you meant to create a release or are targeting the wrong branch."
);
}

return errors;
Expand Down
39 changes: 26 additions & 13 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,19 +42,12 @@ jobs:
- name: yarn test:coverage
run: yarn test:coverage
working-directory: Composer
# secrets are not exposed to PRs opened by forks, so just skip this step if it is not defined
- name: Publish coverage results
run: |
if [[ -z $COVERALLS_REPO_TOKEN ]]; then
echo "Coveralls token not found. Skipping."
else
cat coverage/lcov.info | ./node_modules/.bin/coveralls
fi
working-directory: Composer
env:
COVERALLS_SERVICE_NAME: "Github Actions"
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
COVERALLS_GIT_BRANCH: ${{ github.ref }}
- name: Coveralls
uses: coverallsapp/github-action@master
continue-on-error: true
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: ./Composer/coverage/lcov.info

botproject:
name: BotProject
Expand All @@ -74,3 +67,23 @@ jobs:
- name: dotnet test
run: dotnet test
working-directory: BotProject/CSharp

docker-build:
name: Docker Build
timeout-minutes: 20
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v1
- name: docker-compose build
run: docker-compose build
- name: Health check
run: |
docker-compose up -d
sleep 10
curl -Is http://localhost:3000 | grep -q "200 OK"
shell: bash
- name: Cleanup
if: always()
run: docker-compose down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -397,3 +397,7 @@ MyBots/*

# VsCode
Composer/.vscode/

# Docker App Data
.appdata
docker-compose.override.yml
41 changes: 37 additions & 4 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,41 @@
{
"version": "0.2.0",
"configurations": [
{
"type": "chrome",
"request": "attach",
"name": "Attach to Chrome",
"port": 9222,
"webRoot": "${workspaceFolder}"
},
{
"name": "LSP Server",
"type": "node",
"request": "launch",
"args": [
"${workspaceFolder}/Composer/packages/tools/language-servers/language-generation/demo/src/server.ts"
],
"runtimeArgs": [
"--nolazy",
"-r",
"${workspaceFolder}/Composer/node_modules/ts-node/register"
],
"sourceMaps": true,
"cwd": "${workspaceFolder}/Composer/packages/tools/language-servers/language-generation/demo/src",
"protocol": "inspector",
},
{
"type": "node",
"request": "launch",
"name": "Server: Launch",
"args": ["./build/server.js"],
"args": [
"./build/server.js"
],
"preLaunchTask": "server: build",
"restart": true,
"outFiles": ["./build/*"],
"outFiles": [
"./build/*"
],
"envFile": "${workspaceFolder}/Composer/packages/server/.env",
"outputCapture": "std",
"cwd": "${workspaceFolder}/Composer/packages/server"
Expand All @@ -20,8 +47,14 @@
"name": "Jest Debug",
"program": "${workspaceRoot}/Composer/node_modules/jest/bin/jest",
"stopOnEntry": false,
"args": ["--runInBand", "--env=jsdom", "--config=jest.config.js"],
"runtimeArgs": ["--inspect-brk"],
"args": [
"--runInBand",
"--env=jsdom",
"--config=jest.config.js"
],
"runtimeArgs": [
"--inspect-brk"
],
"cwd": "${workspaceRoot}/Composer/packages/server",
"sourceMaps": true,
"console": "integratedTerminal"
Expand Down
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
{ "language": "typescript", "autoFix": true },
{ "language": "typescriptreact", "autoFix": true }
],
"eslint.workingDirectories": ["./Composer"],
"editor.formatOnSave": true,
"typescript.tsdk": "./Composer/node_modules/typescript/lib"
}
}
2 changes: 1 addition & 1 deletion BotProject/CSharp/ComposerDialogs/Main/Main.dialog
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"actions": [
{
"$type": "Microsoft.SendActivity",
"activity": "[bfdactivity-003038]"
"activity": "@{bfdactivity-003038()}"
}
]
}
Expand Down
1 change: 1 addition & 0 deletions BotProject/CSharp/Controllers/BotController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ public BotController(BotManager botManager)
}

[HttpPost]
[HttpGet]
public async Task PostAsync()
{
// Delegate the processing of the HTTP POST to the adapter.
Expand Down
7 changes: 4 additions & 3 deletions BotProject/CSharp/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM mcr.microsoft.com/dotnet/core/sdk:2.1-alpine AS build

WORKDIR /app/botproject/csharp
WORKDIR /src/botproject/csharp

COPY *.sln .
COPY *.csproj .
Expand All @@ -15,5 +15,6 @@ RUN dotnet publish -o out

FROM mcr.microsoft.com/dotnet/core/aspnet:2.1-alpine AS runtime
WORKDIR /app/botproject/csharp
COPY --from=build /app/botproject/csharp/out .
CMD ["dotnet", "BotProject.dll"]
COPY --from=build /src/botproject/csharp/ComposerDialogs ./ComposerDialogs
COPY --from=build /src/botproject/csharp/out .
CMD ["dotnet", "BotProject.dll"]
2 changes: 1 addition & 1 deletion BotProject/CSharp/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
## Bot Project
Bot project is the launcher project for the bots written in declarative form (JSON), using the Composer, for the Bot Framework SDK. They follow pattern defined in [OBI](https://github.com/Microsoft/botframework-obi) format.
Bot project is the launcher project for the bots written in declarative form (JSON), using the Composer, for the Bot Framework SDK.

## Instructions for setting up the Bot Project runtime
The Bot Project is a regular Bot Framework SDK V4 project. Before you can launch it from the emulator, you need to make sure you can run the bot.
Expand Down
1 change: 1 addition & 0 deletions BotProject/CSharp/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ public void Configure(IApplicationBuilder app, IHostingEnvironment env)

app.UseDefaultFiles();
app.UseStaticFiles();
app.UseWebSockets();

//app.UseHttpsRedirection();
app.UseMvc();
Expand Down
1 change: 1 addition & 0 deletions BotProject/Templates/CSharp/Controllers/BotController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ public BotController(IBotFrameworkHttpAdapter adapter, IBot bot)
}

[HttpPost]
[HttpGet]
public async Task PostAsync()
{
// Delegate the processing of the HTTP POST to the adapter.
Expand Down
2 changes: 1 addition & 1 deletion BotProject/Templates/CSharp/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
## Bot Project
Bot project is the launcher project for the bots written in declarative form (JSON), using the Composer, for the Bot Framework SDK. They follow pattern defined in [OBI](https://github.com/Microsoft/botframework-obi) format.
Bot project is the launcher project for the bots written in declarative form (JSON), using the Composer, for the Bot Framework SDK.

## Instructions for setting up the Bot Project runtime
The Bot Project is a regular Bot Framework SDK V4 project. Before you can launch it from the emulator, you need to make sure you can run the bot.
Expand Down
1 change: 1 addition & 0 deletions BotProject/Templates/CSharp/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ public void Configure(IApplicationBuilder app, IHostingEnvironment env)

app.UseDefaultFiles();
app.UseStaticFiles();
app.UseWebSockets();

//app.UseHttpsRedirection();
app.UseMvc();
Expand Down
Loading