-
Notifications
You must be signed in to change notification settings - Fork 136
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
EOL warnings for V2/V3 runtimes #3771
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,14 +16,21 @@ export enum FuncVersion { | |
|
||
export const latestGAVersion: FuncVersion = FuncVersion.v4; | ||
export const funcVersionLink: string = 'https://aka.ms/AA1tpij'; | ||
const funcRuntimeVersionWarningLink: string = 'https://aka.ms/function-runtime-host-warning'; | ||
|
||
export async function promptForFuncVersion(context: IActionContext, message?: string): Promise<FuncVersion> { | ||
const recommended: string = localize('recommended', '(Recommended)'); | ||
let picks: IAzureQuickPickItem<FuncVersion | undefined>[] = [ | ||
{ label: 'Azure Functions v4', description: recommended, data: FuncVersion.v4 }, | ||
{ label: 'Azure Functions v3', data: FuncVersion.v3 }, | ||
{ label: 'Azure Functions v2', data: FuncVersion.v2 }, | ||
{ label: 'Azure Functions v1', data: FuncVersion.v1 } | ||
{ label: 'Azure Functions v3', data: FuncVersion.v3, description: '(EOL)' }, | ||
{ label: 'Azure Functions v2', data: FuncVersion.v2, description: '(EOL)' }, | ||
{ label: 'Azure Functions v1', data: FuncVersion.v1 }, { | ||
label: localize('runtimeWarning', `$(extensions-warning-message) Azure Functions runtime v2.x and v3.x have reached the EOL. Learn more...`), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's a bit weird to have two "learn more"s in a row. Potential solutions:
bwateratmsft marked this conversation as resolved.
Show resolved
Hide resolved
|
||
onPicked: async () => { | ||
await openUrl(funcRuntimeVersionWarningLink); | ||
}, | ||
data: undefined | ||
} | ||
]; | ||
|
||
picks = picks.filter(p => osSupportsVersion(p.data)); | ||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -54,13 +54,15 @@ export class FunctionAppStackStep extends AzureWizardPromptStep<IFunctionAppWiza | |||||
|
||||||
private async getPicks(context: IFunctionAppWizardContext): Promise<IAzureQuickPickItem<FullFunctionAppStack | undefined>[]> { | ||||||
const picks: IAzureQuickPickItem<FullFunctionAppStack | undefined>[] = await getStackPicks(context); | ||||||
const majorVersion = getMajorVersion(context.version); | ||||||
const isEol = Number(majorVersion) === 2 || Number(majorVersion) === 3; | ||||||
if (picks.length === 0) { | ||||||
const majorVersion = getMajorVersion(context.version); | ||||||
const noPicksMessage = context.stackFilter ? | ||||||
localize('noStacksFoundWithFilter', '$(warning) No stacks found for "{0}" on Azure Functions v{1}', context.stackFilter, majorVersion) : | ||||||
localize('noStacksFound', '$(warning) No stacks found for Azure Functions v{0}', majorVersion); | ||||||
const upgradeMessage = localize('eolWarning', '$(warning) No stacks found for Azure Functions v{0} due to being EOL. Upgrade your runtime version to see available stacks.') | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Forgot to pass There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
I think this message is the best place to have the migration guide link. In this case, we know they have an existing app locally using v3 (otherwise they wouldn't be seeing v3 stacks), so we know they need to migrate There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That makes sense. I guess knowing the migration guide isn't that useful when you're selecting a runtime version for the first time. |
||||||
picks.push({ | ||||||
label: noPicksMessage, | ||||||
label: isEol ? upgradeMessage : noPicksMessage, | ||||||
data: undefined, | ||||||
onPicked: () => { | ||||||
// do nothing | ||||||
|
@@ -70,7 +72,7 @@ export class FunctionAppStackStep extends AzureWizardPromptStep<IFunctionAppWiza | |||||
|
||||||
picks.push({ | ||||||
label: localize('changeFuncVersion', '$(gear) Change Azure Functions version'), | ||||||
description: localize('currentFuncVersion', 'Current: {0}', context.version), | ||||||
description: localize('currentFuncVersion', 'Current: {0}', context.version) + (isEol ? ' $(warning)' : ''), | ||||||
data: undefined, | ||||||
suppressPersistence: true | ||||||
}); | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.