Skip to content

Commit 4e1c3b0

Browse files
authored
Re apply PR 936 - Fix Build Problems (#1166)
* - cherry-pick for PR 936 * - fixed build problem with npm update
1 parent 44761a9 commit 4e1c3b0

File tree

15 files changed

+397
-147
lines changed

15 files changed

+397
-147
lines changed

Extensions/ExternalTfs/Src/Tasks/DownloadArtifactsTfsGit/downloadTfGit.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
var tl = require('vsts-task-lib/task');
22
var path = require('path');
3-
var webApim = require('vso-node-api/WebApi');
4-
var gitInterfaces = require('vso-node-api/interfaces/GitInterfaces');
3+
var webApim = require('azure-devops-node-api/WebApi');
54
var Q = require('q');
65
var url = require('url');
76
var shell = require("shelljs");
@@ -111,10 +110,12 @@ Q.resolve(gitRepositoryPromise).then( function (gitRepository) {
111110

112111
function getRepositoryDetails(tfsEndpoint, repositoryId, projectId){
113112
var handler = webApim.getBasicHandler(tfsEndpoint.Username, tfsEndpoint.Password);
114-
var gitClient = new webApim.WebApi(tfsEndpoint.Url, handler).getGitApi();
115-
var promise = gitClient.getRepository(repositoryId, projectId);
116-
117-
return promise;
113+
var webApi = new webApim.WebApi(tfsEndpoint.Url, handler);
114+
var gitClientPromise = webApi.getGitApi();
115+
Q.resolve(gitClientPromise).then( function (gitClient) {
116+
var promise = gitClient.getRepository(repositoryId, projectId);
117+
return promise;
118+
});
118119
}
119120

120121
function getEndpointDetails(inputFieldName) {

Extensions/ExternalTfs/Src/Tasks/DownloadArtifactsTfsGit/gitwrapper.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ var GitWrapper = (function (_super) {
7070
git.on('debug', function (message) {
7171
if (options.debugOutput) {
7272
var repl = message.replace(creds, '...');
73-
repl = message.replace(escapedCreds, '...');
73+
repl = repl.replace(escapedCreds, '...');
7474
_this.emit('stdout', '[debug]' + repl);
7575
}
7676
});

Extensions/ExternalTfs/Src/Tasks/DownloadArtifactsTfsGit/package-lock.json

Lines changed: 122 additions & 39 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Extensions/ExternalTfs/Src/Tasks/DownloadArtifactsTfsGit/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "DownloadArtifactsTfsGit",
33
"main": "download.js",
44
"dependencies": {
5-
"vso-node-api": "6.0.1-preview",
5+
"azure-devops-node-api": "10.2.1",
66
"vsts-task-lib": "2.0.5"
77
}
88
}

Extensions/ExternalTfs/Src/Tasks/DownloadArtifactsTfsGit/task.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
"demands": [],
1414
"version": {
1515
"Major": 15,
16-
"Minor": 223,
17-
"Patch": 2
16+
"Minor": 225,
17+
"Patch": 0
1818
},
1919
"minimumAgentVersion": "1.99.0",
2020
"instanceNameFormat": "Download Artifacts - External TFS Git",

Extensions/ExternalTfs/Src/Tasks/DownloadArtifactsTfsVersionControl/downloadTfsVersionControl.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
var shell = require('shelljs');
22
var path = require('path');
33
var tl = require('vsts-task-lib/task');
4-
var webApim = require('vso-node-api/WebApi');
5-
var tfvcInterfaces = require('vso-node-api/interfaces/TfvcInterfaces');
64
var Q = require('q');
75
var url = require('url');
86
var tfvcwm = require('./tfvcwrapper');
@@ -17,7 +15,7 @@ console.log("project: " + projectId.toString());
1715
console.log("definition: " + repositoryId.toString());
1816
console.log("version: " + (!!changesetId ? changesetId.toString() : "Latest"));
1917
console.log("downloadPath: " + downloadPath.toString());
20-
console.log("tfsEndpoint:" + JSON.stringify(tfsEndpoint));
18+
console.log("tfsEndpoint:" + JSON.stringify(tfsEndpoint.Url));
2119

2220
var tfvcw = new tfvcwm.TfvcWrapper();
2321
tfvcw.on('stdout', function (data) {

0 commit comments

Comments
 (0)