Skip to content

Commit 5b41878

Browse files
Add issue sources for all internal issues (#1013)
* Added issue sources for all internal issues. * Bump package versions.
1 parent a766b2f commit 5b41878

File tree

8 files changed

+17
-17
lines changed

8 files changed

+17
-17
lines changed

node/internal.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export enum IssueSource {
3434

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

4040
//-----------------------------------------------------
@@ -138,7 +138,7 @@ function _loadLocStrings(resourceFile: string, culture: string): { [key: string]
138138
}
139139
}
140140
else {
141-
_warning('LIB_ResourceFile does not exist');
141+
_warning('LIB_ResourceFile does not exist', IssueSource.TaskInternal);
142142
}
143143

144144
return locStrings;
@@ -176,7 +176,7 @@ export function _setResourcePath(path: string, ignoreWarnings: boolean = false):
176176
if (ignoreWarnings) {
177177
_debug(_loc('LIB_ResourceFileAlreadySet', path));
178178
} else {
179-
_warning(_loc('LIB_ResourceFileAlreadySet', path));
179+
_warning(_loc('LIB_ResourceFileAlreadySet', path), IssueSource.TaskInternal);
180180
}
181181
}
182182
}
@@ -207,7 +207,7 @@ export function _loc(key: string, ...param: any[]): string {
207207
}
208208
else {
209209
if (Object.keys(_resourceFiles).length <= 0) {
210-
_warning(`Resource file haven't been set, can't find loc string for key: ${key}`);
210+
_warning(`Resource file haven't been set, can't find loc string for key: ${key}`, IssueSource.TaskInternal);
211211
}
212212
else {
213213
_warning(`Can't find loc string for key: ${key}`);

node/package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

node/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "azure-pipelines-task-lib",
3-
"version": "4.8.1",
3+
"version": "4.8.2",
44
"description": "Azure Pipelines Task SDK",
55
"main": "./task.js",
66
"typings": "./task.d.ts",

node/task.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,10 @@ export function setResult(result: TaskResult, message: string, done?: boolean):
8989

9090
// add an error issue
9191
if (result == TaskResult.Failed && message) {
92-
error(message);
92+
error(message, IssueSource.TaskInternal);
9393
}
9494
else if (result == TaskResult.SucceededWithIssues && message) {
95-
warning(message);
95+
warning(message, IssueSource.TaskInternal);
9696
}
9797

9898
// task.complete
@@ -906,7 +906,7 @@ export function cp(source: string, dest: string, options?: string, continueOnErr
906906
} catch (e) {
907907
if (retryCount <= 0) {
908908
if (continueOnError) {
909-
warning(e);
909+
warning(e, IssueSource.TaskInternal);
910910
break;
911911
} else {
912912
throw e;
@@ -1001,7 +1001,7 @@ export function retry(func: Function, args: any[], retryOptions: RetryOptions =
10011001
} catch (e) {
10021002
if (retryOptions.retryCount <= 0) {
10031003
if (retryOptions.continueOnError) {
1004-
warning(e);
1004+
warning(e, IssueSource.TaskInternal);
10051005
break;
10061006
} else {
10071007
throw e;
@@ -1109,7 +1109,7 @@ export function find(findPath: string, options?: FindOptions): string[] {
11091109
stats = _getStats(item.path, followSymbolicLink, options.allowBrokenSymbolicLinks);
11101110
} catch (err) {
11111111
if (err.code == 'ENOENT' && options.skipMissingFiles) {
1112-
warning(`No such file or directory: "${item.path}" - skipping.`);
1112+
warning(`No such file or directory: "${item.path}" - skipping.`, IssueSource.TaskInternal);
11131113
continue;
11141114
}
11151115
throw err;
@@ -2387,7 +2387,7 @@ exports.ToolRunner = trm.ToolRunner;
23872387

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

23932393
//-------------------------------------------------------------------

node/test/resulttests.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ describe('Result Tests', function () {
4747

4848
var expected = testutil.buildOutput(
4949
['##vso[task.debug]task result: SucceededWithIssues',
50-
'##vso[task.issue type=warning;]warning msg',
50+
'##vso[task.issue type=warning;source=TaskInternal;]warning msg',
5151
'##vso[task.complete result=SucceededWithIssues;]warning msg']);
5252

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

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

8888
var output = stdStream.getContents();

powershell/VstsTaskSdk/OutFunctions.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ function Out-Default {
3030
Write-Verbose -Message $_.Exception.ToString() 4>&1 | Out-Default
3131
Write-TaskError -Message $_.Exception.Message -IssueSource $IssueSources.TaskInternal
3232
} elseif ($_ -is [System.Management.Automation.WarningRecord]) {
33-
Write-TaskWarning -Message (Remove-TrailingNewLine (Out-String -InputObject $_ -Width 2147483647))
33+
Write-TaskWarning -Message (Remove-TrailingNewLine (Out-String -InputObject $_ -Width 2147483647)) -IssueSource $IssueSources.TaskInternal
3434
} elseif ($_ -is [System.Management.Automation.VerboseRecord] -and !$global:__vstsNoOverrideVerbose) {
3535
foreach ($private:str in (Format-DebugMessage -Object $_)) {
3636
Write-TaskVerbose -Message $private:str

powershell/package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

powershell/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": "0.18.1",
2+
"version": "0.18.2",
33
"private": true,
44
"scripts": {
55
"build": "node make.js build",

0 commit comments

Comments
 (0)