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

EOL warnings for V2/V3 runtimes #3771

Merged
merged 2 commits into from
Aug 2, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
13 changes: 10 additions & 3 deletions src/FuncVersion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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...`),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
label: localize('runtimeWarning', `$(extensions-warning-message) Azure Functions runtime v2.x and v3.x have reached the EOL. Learn more...`),
label: localize('runtimeWarning', `$(extensions-warning-message) v2 and v3 have reached the end of life. Learn more...`),
  • It bothers me if we are inconsistent with "v2" vs "v2.x"
  • I like spelling out acronyms at least once when possible, and this feel like a good place to do "end of life"

Copy link
Contributor

Choose a reason for hiding this comment

The 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:

  1. Get rid of one learn more. I guess I think the version overview page is more generally applicable. After all, this prompt in used in several scenarios, including cases where the user doesn't have an existing app they need to migrate.
  2. Update the learn more text. Maybe "Learn how to upgrade to v4..." and "Learn about Azure Functions versioning..."

bwateratmsft marked this conversation as resolved.
Show resolved Hide resolved
onPicked: async () => {
await openUrl(funcRuntimeVersionWarningLink);
},
data: undefined
}
];

picks = picks.filter(p => osSupportsVersion(p.data));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Forgot to pass majorVersion into the localize call

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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.')
const upgradeMessage = localize('eolWarning', '$(warning) Azure Functions v{0} has reached end of life. Upgrade your runtime version to see available stacks. Learn more...')

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

Copy link
Member Author

Choose a reason for hiding this comment

The 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
Expand All @@ -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
});
Expand Down
2 changes: 1 addition & 1 deletion src/commands/createFunctionApp/stacks/getStackPicks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export async function getStackPicks(context: IFunctionAppWizardContext): Promise
}

if (shouldShowEolWarning(minorVersion)) {
description = localize('endOfLife', `$(extensions-warning-message)`)
description = '$(extensions-warning-message)'
hasEndOfLife = true;
}

Expand Down