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

Fail build team deprecated tasks nodejs #19471

Merged
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,6 @@
"loc.messages.CannotFindAnyFile": "Cannot find any file based on %s.",
"loc.messages.FoundMultipleFiles": "Found multiple files matching %s.",
"loc.messages.FailedToCreateFile": "Failed to create %s with error: %s.",
"loc.messages.FailedToFindFile": "Failed to find %s at %s."
"loc.messages.FailedToFindFile": "Failed to find %s at %s.",
"loc.messages.DeprecatedTask": "The AppCenterDistribute@1 (App Center distribute) task has been deprecated since November 14, 2022 and will soon be retired. Use the AppCenterDistribute@3 task instead."
Pranshu-Negi marked this conversation as resolved.
Show resolved Hide resolved
}
6 changes: 6 additions & 0 deletions Tasks/AppCenterDistributeV1/appcenterdistribute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -558,6 +558,12 @@ async function run() {
await commitSymbols(effectiveApiServer, effectiveApiVersion, appSlug, symbolsUploadInfo.symbol_upload_id, apiToken, userAgent);
}

let shouldFail = tl.getVariable('FAIL_DEPRECATED_BUILD_TASK');

if (shouldFail != null && shouldFail.toLowerCase() === 'true') {
throw new Error(tl.loc("DeprecatedTask"));
}

tl.setResult(tl.TaskResult.Succeeded, tl.loc("Succeeded"));
} catch (err) {
tl.setResult(tl.TaskResult.Failed, `${err}`);
Expand Down
5 changes: 3 additions & 2 deletions Tasks/AppCenterDistributeV1/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"author": "Microsoft Corporation",
"version": {
"Major": 1,
"Minor": 234,
"Minor": 235,
"Patch": 0
},
"minimumAgentVersion": "2.144.0",
Expand Down Expand Up @@ -201,6 +201,7 @@
"CannotFindAnyFile": "Cannot find any file based on %s.",
"FoundMultipleFiles": "Found multiple files matching %s.",
"FailedToCreateFile": "Failed to create %s with error: %s.",
"FailedToFindFile": "Failed to find %s at %s."
"FailedToFindFile": "Failed to find %s at %s.",
"DeprecatedTask": "The AppCenterDistribute@1 (App Center distribute) task has been deprecated since November 14, 2022 and will soon be retired. Use the AppCenterDistribute@3 task instead."
}
}
5 changes: 3 additions & 2 deletions Tasks/AppCenterDistributeV1/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"author": "Microsoft Corporation",
"version": {
"Major": 1,
"Minor": 234,
"Minor": 235,
"Patch": 0
},
"minimumAgentVersion": "2.144.0",
Expand Down Expand Up @@ -201,6 +201,7 @@
"CannotFindAnyFile": "ms-resource:loc.messages.CannotFindAnyFile",
"FoundMultipleFiles": "ms-resource:loc.messages.FoundMultipleFiles",
"FailedToCreateFile": "ms-resource:loc.messages.FailedToCreateFile",
"FailedToFindFile": "ms-resource:loc.messages.FailedToFindFile"
"FailedToFindFile": "ms-resource:loc.messages.FailedToFindFile",
"DeprecatedTask": "ms-resource:loc.messages.DeprecatedTask"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,6 @@
"loc.messages.CannotFindAnyFile": "Cannot find any file based on %s.",
"loc.messages.FoundMultipleFiles": "Found multiple files matching %s.",
"loc.messages.FailedToCreateFile": "Failed to create %s with error: %s.",
"loc.messages.FailedToFindFile": "Failed to find %s at %s."
"loc.messages.FailedToFindFile": "Failed to find %s at %s.",
"loc.messages.DeprecatedTask": "The AppCenterDistribute@2 (App Center distribute) task has been deprecated since November 14, 2022 and will soon be retired. Use the AppCenterDistribute@3 task instead."
}
6 changes: 6 additions & 0 deletions Tasks/AppCenterDistributeV2/appcenterdistribute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -547,6 +547,12 @@ async function run() {
await commitSymbols(effectiveApiServer, effectiveApiVersion, appSlug, symbolsUploadInfo.symbol_upload_id, apiToken, userAgent);
}

let shouldFail = tl.getVariable('FAIL_DEPRECATED_BUILD_TASK');

if (shouldFail != null && shouldFail.toLowerCase() === 'true') {
throw new Error(tl.loc("DeprecatedTask"));
}

tl.setResult(tl.TaskResult.Succeeded, tl.loc("Succeeded"));
} catch (err) {
tl.setResult(tl.TaskResult.Failed, `${err}`);
Expand Down
5 changes: 3 additions & 2 deletions Tasks/AppCenterDistributeV2/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"author": "Microsoft Corporation",
"version": {
"Major": 2,
"Minor": 234,
"Minor": 235,
"Patch": 0
},
"minimumAgentVersion": "2.144.0",
Expand Down Expand Up @@ -203,6 +203,7 @@
"CannotFindAnyFile": "Cannot find any file based on %s.",
"FoundMultipleFiles": "Found multiple files matching %s.",
"FailedToCreateFile": "Failed to create %s with error: %s.",
"FailedToFindFile": "Failed to find %s at %s."
"FailedToFindFile": "Failed to find %s at %s.",
"DeprecatedTask": "The AppCenterDistribute@2 (App Center distribute) task has been deprecated since November 14, 2022 and will soon be retired. Use the AppCenterDistribute@3 task instead."
}
}
5 changes: 3 additions & 2 deletions Tasks/AppCenterDistributeV2/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"author": "Microsoft Corporation",
"version": {
"Major": 2,
"Minor": 234,
"Minor": 235,
"Patch": 0
},
"minimumAgentVersion": "2.144.0",
Expand Down Expand Up @@ -203,6 +203,7 @@
"CannotFindAnyFile": "ms-resource:loc.messages.CannotFindAnyFile",
"FoundMultipleFiles": "ms-resource:loc.messages.FoundMultipleFiles",
"FailedToCreateFile": "ms-resource:loc.messages.FailedToCreateFile",
"FailedToFindFile": "ms-resource:loc.messages.FailedToFindFile"
"FailedToFindFile": "ms-resource:loc.messages.FailedToFindFile",
"DeprecatedTask": "ms-resource:loc.messages.DeprecatedTask"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,6 @@
"loc.messages.ReactivateExistingEnvironment": "Found existing environment %s and the task's \"Clean environment\" parameter is not set. Reactivating ...",
"loc.messages.ParameterRequired": "The `%s` parameter is required",
"loc.messages.PlatformNotRecognized": "Platform not recognized",
"loc.messages.PrependPath": "Prepending PATH environment variable with directory: %s"
"loc.messages.PrependPath": "Prepending PATH environment variable with directory: %s",
"loc.messages.DeprecatedTask": "The CondaEnvironment@1 (Conda environment) task has been deprecated since February 13, 2019 and will soon be retired. Use the Conda CLI ('conda') directly from a bash/pwsh/script task."
}
5 changes: 5 additions & 0 deletions Tasks/CondaEnvironmentV1/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ import { condaEnvironment } from './conda';
cleanEnvironment: task.getBoolInput('cleanEnvironment')
},
getPlatform());
let shouldFail = task.getVariable('FAIL_DEPRECATED_BUILD_TASK');

if (shouldFail != null && shouldFail.toLowerCase() === 'true') {
throw new Error(task.loc("DeprecatedTask"));
}
task.setResult(task.TaskResult.Succeeded, "");
} catch (e) {
#if NODE20
Expand Down
5 changes: 3 additions & 2 deletions Tasks/CondaEnvironmentV1/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"author": "Microsoft Corporation",
"version": {
"Major": 1,
"Minor": 234,
"Minor": 235,
"Patch": 0
},
"deprecated": true,
Expand Down Expand Up @@ -101,6 +101,7 @@
"ReactivateExistingEnvironment": "Found existing environment %s and the task's \"Clean environment\" parameter is not set. Reactivating ...",
"ParameterRequired": "The `%s` parameter is required",
"PlatformNotRecognized": "Platform not recognized",
"PrependPath": "Prepending PATH environment variable with directory: %s"
"PrependPath": "Prepending PATH environment variable with directory: %s",
"DeprecatedTask": "The CondaEnvironment@1 (Conda environment) task has been deprecated since February 13, 2019 and will soon be retired. Use the Conda CLI ('conda') directly from a bash/pwsh/script task."
}
}
9 changes: 7 additions & 2 deletions Tasks/CondaEnvironmentV1/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"author": "Microsoft Corporation",
"version": {
"Major": 1,
"Minor": 234,
"Minor": 235,
"Patch": 0
},
"deprecated": true,
Expand Down Expand Up @@ -101,6 +101,11 @@
"ReactivateExistingEnvironment": "ms-resource:loc.messages.ReactivateExistingEnvironment",
"ParameterRequired": "ms-resource:loc.messages.ParameterRequired",
"PlatformNotRecognized": "ms-resource:loc.messages.PlatformNotRecognized",
"PrependPath": "ms-resource:loc.messages.PrependPath"
"PrependPath": "ms-resource:loc.messages.PrependPath",
"DeprecatedTask": "ms-resource:loc.messages.DeprecatedTask"
},
"_buildConfigMapping": {
"Default": "1.234.2",
"Node20-225": "1.234.3"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -78,5 +78,6 @@
"loc.messages.FilesDataIsIncorrectInVersion": "In release %s for version %s, File data is incorrect (might have missing required fields, such as name, rid and url): %s",
"loc.messages.VersionFilesDataIncorrect": "Version's files data is missing or has missing required fields.",
"loc.messages.VersionInformationNotComplete": "Version: %s required information is not complete in releases.json file. Error: %s",
"loc.messages.FailedWhileExtractingPacakge": "Failed while extracting downloaded package with error: %s"
"loc.messages.FailedWhileExtractingPacakge": "Failed while extracting downloaded package with error: %s",
"loc.messages.DeprecatedTask": "The DotNetCoreInstaller@1 (.NET Core SDK/runtime installer) task has been deprecated since August 22, 2019 and will soon be retired. Use the UseDotNet@2 task instead."
}
6 changes: 6 additions & 0 deletions Tasks/DotNetCoreInstallerV1/dotnetcoreinstaller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ async function run() {

// Set DOTNET_ROOT for dotnet core Apphost to find runtime since it is installed to a non well-known location.
tl.setVariable('DOTNET_ROOT', installationPath);

let shouldFail = tl.getVariable('FAIL_DEPRECATED_BUILD_TASK');

if (shouldFail != null && shouldFail.toLowerCase() === 'true') {
throw new Error(tl.loc("DeprecatedTask"));
}
}

function addDotNetCoreToolPath() {
Expand Down
5 changes: 3 additions & 2 deletions Tasks/DotNetCoreInstallerV1/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"author": "Microsoft Corporation",
"version": {
"Major": 1,
"Minor": 234,
"Minor": 235,
"Patch": 0
},
"deprecated": true,
Expand Down Expand Up @@ -153,6 +153,7 @@
"FilesDataIsIncorrectInVersion": "In release %s for version %s, File data is incorrect (might have missing required fields, such as name, rid and url): %s",
"VersionFilesDataIncorrect": "Version's files data is missing or has missing required fields.",
"VersionInformationNotComplete": "Version: %s required information is not complete in releases.json file. Error: %s",
"FailedWhileExtractingPacakge": "Failed while extracting downloaded package with error: %s"
"FailedWhileExtractingPacakge": "Failed while extracting downloaded package with error: %s",
"DeprecatedTask": "The DotNetCoreInstaller@1 (.NET Core SDK/runtime installer) task has been deprecated since August 22, 2019 and will soon be retired. Use the UseDotNet@2 task instead."
}
}
5 changes: 3 additions & 2 deletions Tasks/DotNetCoreInstallerV1/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"author": "Microsoft Corporation",
"version": {
"Major": 1,
"Minor": 234,
"Minor": 235,
"Patch": 0
},
"deprecated": true,
Expand Down Expand Up @@ -153,6 +153,7 @@
"FilesDataIsIncorrectInVersion": "ms-resource:loc.messages.FilesDataIsIncorrectInVersion",
"VersionFilesDataIncorrect": "ms-resource:loc.messages.VersionFilesDataIncorrect",
"VersionInformationNotComplete": "ms-resource:loc.messages.VersionInformationNotComplete",
"FailedWhileExtractingPacakge": "ms-resource:loc.messages.FailedWhileExtractingPacakge"
"FailedWhileExtractingPacakge": "ms-resource:loc.messages.FailedWhileExtractingPacakge",
"DeprecatedTask": "ms-resource:loc.messages.DeprecatedTask"
}
}
4 changes: 2 additions & 2 deletions _generated/AppCenterDistributeV1.versionmap.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Default|1.234.0
Node20_229_7|1.234.1
Default|1.235.0
Node20_229_7|1.235.1
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,6 @@
"loc.messages.CannotFindAnyFile": "Cannot find any file based on %s.",
"loc.messages.FoundMultipleFiles": "Found multiple files matching %s.",
"loc.messages.FailedToCreateFile": "Failed to create %s with error: %s.",
"loc.messages.FailedToFindFile": "Failed to find %s at %s."
"loc.messages.FailedToFindFile": "Failed to find %s at %s.",
"loc.messages.DeprecatedTask": "The AppCenterDistribute@1 (App Center distribute) task has been deprecated since November 14, 2022 and will soon be retired. Use the AppCenterDistribute@3 task instead."
}
Original file line number Diff line number Diff line change
Expand Up @@ -558,6 +558,12 @@ async function run() {
await commitSymbols(effectiveApiServer, effectiveApiVersion, appSlug, symbolsUploadInfo.symbol_upload_id, apiToken, userAgent);
}

let shouldFail = tl.getVariable('FAIL_DEPRECATED_BUILD_TASK');

if (shouldFail != null && shouldFail.toLowerCase() === 'true') {
throw new Error(tl.loc("DeprecatedTask"));
}

tl.setResult(tl.TaskResult.Succeeded, tl.loc("Succeeded"));
} catch (err) {
tl.setResult(tl.TaskResult.Failed, `${err}`);
Expand Down
9 changes: 5 additions & 4 deletions _generated/AppCenterDistributeV1_Node20/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"author": "Microsoft Corporation",
"version": {
"Major": 1,
"Minor": 234,
"Minor": 235,
"Patch": 1
},
"minimumAgentVersion": "2.144.0",
Expand Down Expand Up @@ -205,10 +205,11 @@
"CannotFindAnyFile": "Cannot find any file based on %s.",
"FoundMultipleFiles": "Found multiple files matching %s.",
"FailedToCreateFile": "Failed to create %s with error: %s.",
"FailedToFindFile": "Failed to find %s at %s."
"FailedToFindFile": "Failed to find %s at %s.",
"DeprecatedTask": "The AppCenterDistribute@1 (App Center distribute) task has been deprecated since November 14, 2022 and will soon be retired. Use the AppCenterDistribute@3 task instead."
},
"_buildConfigMapping": {
"Default": "1.234.0",
"Node20_229_7": "1.234.1"
"Default": "1.235.0",
"Node20_229_7": "1.235.1"
}
}
9 changes: 5 additions & 4 deletions _generated/AppCenterDistributeV1_Node20/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"author": "Microsoft Corporation",
"version": {
"Major": 1,
"Minor": 234,
"Minor": 235,
"Patch": 1
},
"minimumAgentVersion": "2.144.0",
Expand Down Expand Up @@ -205,10 +205,11 @@
"CannotFindAnyFile": "ms-resource:loc.messages.CannotFindAnyFile",
"FoundMultipleFiles": "ms-resource:loc.messages.FoundMultipleFiles",
"FailedToCreateFile": "ms-resource:loc.messages.FailedToCreateFile",
"FailedToFindFile": "ms-resource:loc.messages.FailedToFindFile"
"FailedToFindFile": "ms-resource:loc.messages.FailedToFindFile",
"DeprecatedTask": "ms-resource:loc.messages.DeprecatedTask"
},
"_buildConfigMapping": {
"Default": "1.234.0",
"Node20_229_7": "1.234.1"
"Default": "1.235.0",
"Node20_229_7": "1.235.1"
}
}
4 changes: 2 additions & 2 deletions _generated/AppCenterDistributeV2.versionmap.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Default|2.234.0
Node20_229_7|2.234.1
Default|2.235.0
Node20_229_7|2.235.1
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,6 @@
"loc.messages.CannotFindAnyFile": "Cannot find any file based on %s.",
"loc.messages.FoundMultipleFiles": "Found multiple files matching %s.",
"loc.messages.FailedToCreateFile": "Failed to create %s with error: %s.",
"loc.messages.FailedToFindFile": "Failed to find %s at %s."
"loc.messages.FailedToFindFile": "Failed to find %s at %s.",
"loc.messages.DeprecatedTask": "The AppCenterDistribute@2 (App Center distribute) task has been deprecated since November 14, 2022 and will soon be retired. Use the AppCenterDistribute@3 task instead."
}
Original file line number Diff line number Diff line change
Expand Up @@ -547,6 +547,12 @@ async function run() {
await commitSymbols(effectiveApiServer, effectiveApiVersion, appSlug, symbolsUploadInfo.symbol_upload_id, apiToken, userAgent);
}

let shouldFail = tl.getVariable('FAIL_DEPRECATED_BUILD_TASK');

if (shouldFail != null && shouldFail.toLowerCase() === 'true') {
throw new Error(tl.loc("DeprecatedTask"));
}

tl.setResult(tl.TaskResult.Succeeded, tl.loc("Succeeded"));
} catch (err) {
tl.setResult(tl.TaskResult.Failed, `${err}`);
Expand Down
9 changes: 5 additions & 4 deletions _generated/AppCenterDistributeV2_Node20/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"author": "Microsoft Corporation",
"version": {
"Major": 2,
"Minor": 234,
"Minor": 235,
"Patch": 1
},
"minimumAgentVersion": "2.144.0",
Expand Down Expand Up @@ -207,10 +207,11 @@
"CannotFindAnyFile": "Cannot find any file based on %s.",
"FoundMultipleFiles": "Found multiple files matching %s.",
"FailedToCreateFile": "Failed to create %s with error: %s.",
"FailedToFindFile": "Failed to find %s at %s."
"FailedToFindFile": "Failed to find %s at %s.",
"DeprecatedTask": "The AppCenterDistribute@2 (App Center distribute) task has been deprecated since November 14, 2022 and will soon be retired. Use the AppCenterDistribute@3 task instead."
},
"_buildConfigMapping": {
"Default": "2.234.0",
"Node20_229_7": "2.234.1"
"Default": "2.235.0",
"Node20_229_7": "2.235.1"
}
}
9 changes: 5 additions & 4 deletions _generated/AppCenterDistributeV2_Node20/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"author": "Microsoft Corporation",
"version": {
"Major": 2,
"Minor": 234,
"Minor": 235,
"Patch": 1
},
"minimumAgentVersion": "2.144.0",
Expand Down Expand Up @@ -207,10 +207,11 @@
"CannotFindAnyFile": "ms-resource:loc.messages.CannotFindAnyFile",
"FoundMultipleFiles": "ms-resource:loc.messages.FoundMultipleFiles",
"FailedToCreateFile": "ms-resource:loc.messages.FailedToCreateFile",
"FailedToFindFile": "ms-resource:loc.messages.FailedToFindFile"
"FailedToFindFile": "ms-resource:loc.messages.FailedToFindFile",
"DeprecatedTask": "ms-resource:loc.messages.DeprecatedTask"
},
"_buildConfigMapping": {
"Default": "2.234.0",
"Node20_229_7": "2.234.1"
"Default": "2.235.0",
"Node20_229_7": "2.235.1"
}
}
Loading