Skip to content

Commit

Permalink
Merge pull request #277 from alibaba/update-schema
Browse files Browse the repository at this point in the history
update service and function schema
  • Loading branch information
rsonghuster authored Apr 27, 2021
2 parents 08778b2 + 5f3ff5d commit 8fe4e98
Show file tree
Hide file tree
Showing 13 changed files with 259 additions and 170 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,18 @@

所有对 "Aliyun Serverless" 插件的更改都将记录在这个文件中。

## 1.27.17 - 2021-04-27

### Fixed

1. 修复无法显示工作流的问题。

### Added

1. Service schema 中增加 TracingConfig 字段
2. Function schema 中增加 InstanceLifecycleConfig 字段
3. Function ros schema 中增加 InstanceType、CustomContainerConfig、CAPort 以及 AsyncConfiguration 字段

## 1.27.16 - 2020-12-04

### Fixed
Expand Down
248 changes: 131 additions & 117 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"publisher": "aliyun",
"icon": "media/aliyun-serverless-extension.png",
"description": "Aliyun Function Compute extension. Lets you develop your serverless application of Aliyun within VSCode.",
"version": "1.27.16",
"version": "1.27.17",
"engines": {
"vscode": "^1.31.0"
},
Expand Down
15 changes: 10 additions & 5 deletions src/commands/createFunction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ import { getSupportedRuntimes, isSupportedRuntime, isNodejs, isPython } from '..
import { serverlessCommands, serverlessConfigs } from '../utils/constants';
import { isNotEmpty, checkExistsWithTimeout } from '../utils/file';
import { createCodeFile, isCustomRuntime } from '../utils/runtime';
import { getSupportedCustomRuntimeTemplates, isSupportedCustomRuntimeTemplates, createCustomRuntimeCodeFile } from '../utils/runtime';
import {
getSupportedCustomRuntimeTemplates,
isSupportedCustomRuntimeTemplates,
createCustomRuntimeCodeFile
} from '../utils/runtime';
import { recordPageView } from '../utils/visitor';
import { ServiceResource } from '../models/resource';
import { TemplateService } from '../services/TemplateService';
Expand Down Expand Up @@ -37,7 +41,8 @@ async function process(context: vscode.ExtensionContext, serviceName: string, te
label: 'HTTP',
description: 'HTTP Trigger',
}];
const customRuntimeTemplates: vscode.QuickPickItem[] = getSupportedCustomRuntimeTemplates().map(label => <vscode.QuickPickItem>{ label });
const customRuntimeTemplates: vscode.QuickPickItem[] =
getSupportedCustomRuntimeTemplates().map(label => <vscode.QuickPickItem>{ label });

const runtimes: vscode.QuickPickItem[] = getSupportedRuntimes().map(label => <vscode.QuickPickItem>{ label });

Expand Down Expand Up @@ -162,9 +167,9 @@ async function process(context: vscode.ExtensionContext, serviceName: string, te
async function validateCreateFuncionState(state: State): Promise<boolean> {
const functionTypes = ['NORMAL', 'HTTP'];
if (!state || !state.serviceName
|| !state.functionName
|| !state.functionName
|| (!isCustomRuntime(state.runtime) && !functionTypes.includes(state.type))
|| !isSupportedRuntime(state.runtime)
|| !isSupportedRuntime(state.runtime)
|| (isCustomRuntime(state.runtime) && !isSupportedCustomRuntimeTemplates(state.functionTemplate))) {
return false;
}
Expand Down Expand Up @@ -194,7 +199,7 @@ async function process(context: vscode.ExtensionContext, serviceName: string, te
await createCodeFile(type, runtime, codeUriPath);
}
}

const state = await collectFuncInfo();
if (!await validateCreateFuncionState(state)) {
return;
Expand Down
Loading

0 comments on commit 8fe4e98

Please sign in to comment.