Skip to content

Commit

Permalink
Add issue sources for all internal issues (#1013)
Browse files Browse the repository at this point in the history
* Added issue sources for all internal issues.

* Bump package versions.
  • Loading branch information
DenisNikulin5 authored Jan 22, 2024
1 parent b1f677a commit e1b882a
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 17 deletions.
8 changes: 4 additions & 4 deletions node/internal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export enum IssueSource {

// async await needs generators in node 4.x+
if (semver.lt(process.versions.node, '4.2.0')) {
_warning('Tasks require a new agent. Upgrade your agent or node to 4.2.0 or later');
_warning('Tasks require a new agent. Upgrade your agent or node to 4.2.0 or later', IssueSource.TaskInternal);
}

//-----------------------------------------------------
Expand Down Expand Up @@ -138,7 +138,7 @@ function _loadLocStrings(resourceFile: string, culture: string): { [key: string]
}
}
else {
_warning('LIB_ResourceFile does not exist');
_warning('LIB_ResourceFile does not exist', IssueSource.TaskInternal);
}

return locStrings;
Expand Down Expand Up @@ -176,7 +176,7 @@ export function _setResourcePath(path: string, ignoreWarnings: boolean = false):
if (ignoreWarnings) {
_debug(_loc('LIB_ResourceFileAlreadySet', path));
} else {
_warning(_loc('LIB_ResourceFileAlreadySet', path));
_warning(_loc('LIB_ResourceFileAlreadySet', path), IssueSource.TaskInternal);
}
}
}
Expand Down Expand Up @@ -207,7 +207,7 @@ export function _loc(key: string, ...param: any[]): string {
}
else {
if (Object.keys(_resourceFiles).length <= 0) {
_warning(`Resource file haven't been set, can't find loc string for key: ${key}`);
_warning(`Resource file haven't been set, can't find loc string for key: ${key}`, IssueSource.TaskInternal);
}
else {
_warning(`Can't find loc string for key: ${key}`);
Expand Down
2 changes: 1 addition & 1 deletion node/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 node/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "azure-pipelines-task-lib",
"version": "4.8.1",
"version": "4.8.2",
"description": "Azure Pipelines Task SDK",
"main": "./task.js",
"typings": "./task.d.ts",
Expand Down
12 changes: 6 additions & 6 deletions node/task.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,10 @@ export function setResult(result: TaskResult, message: string, done?: boolean):

// add an error issue
if (result == TaskResult.Failed && message) {
error(message);
error(message, IssueSource.TaskInternal);
}
else if (result == TaskResult.SucceededWithIssues && message) {
warning(message);
warning(message, IssueSource.TaskInternal);
}

// task.complete
Expand Down Expand Up @@ -906,7 +906,7 @@ export function cp(source: string, dest: string, options?: string, continueOnErr
} catch (e) {
if (retryCount <= 0) {
if (continueOnError) {
warning(e);
warning(e, IssueSource.TaskInternal);
break;
} else {
throw e;
Expand Down Expand Up @@ -1001,7 +1001,7 @@ export function retry(func: Function, args: any[], retryOptions: RetryOptions =
} catch (e) {
if (retryOptions.retryCount <= 0) {
if (retryOptions.continueOnError) {
warning(e);
warning(e, IssueSource.TaskInternal);
break;
} else {
throw e;
Expand Down Expand Up @@ -1109,7 +1109,7 @@ export function find(findPath: string, options?: FindOptions): string[] {
stats = _getStats(item.path, followSymbolicLink, options.allowBrokenSymbolicLinks);
} catch (err) {
if (err.code == 'ENOENT' && options.skipMissingFiles) {
warning(`No such file or directory: "${item.path}" - skipping.`);
warning(`No such file or directory: "${item.path}" - skipping.`, IssueSource.TaskInternal);
continue;
}
throw err;
Expand Down Expand Up @@ -2387,7 +2387,7 @@ exports.ToolRunner = trm.ToolRunner;

// async await needs generators in node 4.x+
if (semver.lt(process.versions.node, '4.2.0')) {
warning('Tasks require a new agent. Upgrade your agent or node to 4.2.0 or later');
warning('Tasks require a new agent. Upgrade your agent or node to 4.2.0 or later', IssueSource.TaskInternal);
}

//-------------------------------------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions node/test/resulttests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ describe('Result Tests', function () {

var expected = testutil.buildOutput(
['##vso[task.debug]task result: SucceededWithIssues',
'##vso[task.issue type=warning;]warning msg',
'##vso[task.issue type=warning;source=TaskInternal;]warning msg',
'##vso[task.complete result=SucceededWithIssues;]warning msg']);

var output = stdStream.getContents();
Expand Down Expand Up @@ -82,7 +82,7 @@ describe('Result Tests', function () {

var expected = testutil.buildOutput(
['##vso[task.debug]task result: Failed',
'##vso[task.issue type=error;]failed msg',
'##vso[task.issue type=error;source=TaskInternal;]failed msg',
'##vso[task.complete result=Failed;]failed msg']);

var output = stdStream.getContents();
Expand Down
2 changes: 1 addition & 1 deletion powershell/VstsTaskSdk/OutFunctions.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ function Out-Default {
Write-Verbose -Message $_.Exception.ToString() 4>&1 | Out-Default
Write-TaskError -Message $_.Exception.Message -IssueSource $IssueSources.TaskInternal
} elseif ($_ -is [System.Management.Automation.WarningRecord]) {
Write-TaskWarning -Message (Remove-TrailingNewLine (Out-String -InputObject $_ -Width 2147483647))
Write-TaskWarning -Message (Remove-TrailingNewLine (Out-String -InputObject $_ -Width 2147483647)) -IssueSource $IssueSources.TaskInternal
} elseif ($_ -is [System.Management.Automation.VerboseRecord] -and !$global:__vstsNoOverrideVerbose) {
foreach ($private:str in (Format-DebugMessage -Object $_)) {
Write-TaskVerbose -Message $private:str
Expand Down
2 changes: 1 addition & 1 deletion powershell/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 powershell/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "0.18.1",
"version": "0.18.2",
"private": true,
"scripts": {
"build": "node make.js build",
Expand Down

0 comments on commit e1b882a

Please sign in to comment.