Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Commit

Permalink
Add message and telemetry for getting latest VS2015 Update (#199)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeff Young authored May 1, 2017
1 parent 1e7dd5c commit 90ed9ef
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
2 changes: 2 additions & 0 deletions src/helpers/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export class Constants {
static TokenShowMeUrl: string = "https://aka.ms/o2wkmo";
static ReadmeLearnMoreUrl: string = "https://aka.ms/jkapah";
static ServerWorkspaceUrl: string = "https://github.com/Microsoft/vsts-vscode/blob/master/TFVC_README.md#what-is-the-difference-between-a-local-and-server-workspace-how-can-i-tell-which-one-im-working-with";
static VS2015U3CSRUrl: string = "https://msdn.microsoft.com/en-us/library/mt752379.aspx";
}

export class CommandNames {
Expand Down Expand Up @@ -104,6 +105,7 @@ export class TelemetryEvents {
static ViewPinnedQueryWorkItems: string = TelemetryEvents.TelemetryPrefix + "viewpinnedqueryworkitems";
static ViewWorkItem: string = TelemetryEvents.TelemetryPrefix + "viewworkitem";
static ViewWorkItems: string = TelemetryEvents.TelemetryPrefix + "viewworkitems";
static VS2015U3CSR: string = TelemetryEvents.TelemetryPrefix + "vs2015u3csr";
}

export class TfvcTelemetryEvents {
Expand Down
3 changes: 2 additions & 1 deletion src/helpers/strings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export class Strings {
static ThanksForFeedback: string = "Thanks for sending feedback!";
static LearnMore: string = "Learn more...";
static ShowMe: string = "Show Me!";
static VS2015Update3CSR: string = "Get Latest VS 2015 Update";

static ChoosePullRequest: string = "Choose a pull request";
static ChooseWorkItem: string = "Choose a work item";
Expand Down Expand Up @@ -65,7 +66,7 @@ export class Strings {
static TfMissingError: string = "Unable to find the TF executable. Please ensure TF is installed and the path specified contains the filename. Provided path: ";
static TfInitializeFailureError: string = "Unable to initialize the TF executable. Please verify the installation of Java and ensure it is in the PATH.";
static TfExecFailedError: string = "Execution of the TFVC command line failed unexpectedly.";
static TfVersionWarning: string = "The installed version of the TF command line does not meet the minimum suggested version. You may run into errors or limitations with certain commands until you upgrade. Minimum suggested version: ";
static TfVersionWarning: string = "The configured version of TF does not meet the minimum version. You may run into errors or limitations with certain commands until you upgrade. Minimum version: ";
static TfNoPendingChanges: string = "There are no matching pending changes.";
static TfServerWorkspace: string = "It appears you are using a Server workspace. Currently, TFVC support is limited to Local workspaces.";
static UndoChanges: string = "Undo Changes";
Expand Down
14 changes: 12 additions & 2 deletions src/tfvc/tfcommandlinerunner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@

import * as cp from "child_process";
import { TeamServerContext } from "../contexts/servercontext";
import { Constants, TelemetryEvents } from "../helpers/constants";
import { Logger } from "../helpers/logger";
import { Strings } from "../helpers/strings";
import { IButtonMessageItem } from "../helpers/vscodeutils.interfaces";
import { IDisposable, toDisposable, dispose } from "./util";
import { IArgumentProvider, IExecutionResult, ITfCommandLine } from "./interfaces";
import { TfvcError, TfvcErrorCodes } from "./tfvcerror";
Expand Down Expand Up @@ -78,7 +80,7 @@ export class TfCommandLineRunner {
const isExe: boolean = path.extname(tfvcPath) === ".exe";
let minVersion: string = "14.0.4"; //CLC min version
if (isExe) {
minVersion = "14.0.0"; //Minimum tf.exe version
minVersion = "14.102.0"; //Minimum tf.exe version
}

return {
Expand All @@ -105,8 +107,16 @@ export class TfCommandLineRunner {
const curVersion: TfvcVersion = TfvcVersion.FromString(version);
if (TfvcVersion.Compare(curVersion, minVersion) < 0) {
Logger.LogWarning(`TFVC ${version} is less that the min version of ${tfvc.minVersion}.`);
let options: IButtonMessageItem[] = [];
if (tfvc.isExe) {
//Provide more information on how to update tf.exe to the minimum version required
options = [{ title : Strings.VS2015Update3CSR,
url : Constants.VS2015U3CSRUrl,
telemetryId: TelemetryEvents.VS2015U3CSR }];
}
throw new TfvcError({
message: Strings.TfVersionWarning + minVersion.ToString(),
message: `${Strings.TfVersionWarning}${minVersion.ToString()}`,
messageOptions: options,
tfvcErrorCode: TfvcErrorCodes.MinVersionWarning
});
}
Expand Down

0 comments on commit 90ed9ef

Please sign in to comment.