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

Remove the unnecessary domain check when enriching tfsgit commit comments so on-premise Azure DevOps Service is supported #966

Merged
merged 1 commit into from
Mar 6, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -410,12 +410,12 @@ export async function enrichChangesWithFileDetails(
agentApi.logInfo (`Enriched change ${change.id} of type ${change.type}`);
if (change.type === "TfsGit") {
// we need the repository ID for the API call
// the alternative is to take the basic location value and build a rest call form that
// the alternative is to take the basic location value and build a rest call from that
// neither are that nice.
var url = require("url");
// split the url up, check it is the expected format and then get the ID
var urlParts = url.parse(change.location);
if ((urlParts.host === "dev.azure.com") || (urlParts.host.includes(".visualstudio.com") === true)) {
try {
var pathParts = urlParts.path.split("/");
var repoId = "";
for (let index = 0; index < pathParts.length; index++) {
Expand All @@ -427,8 +427,8 @@ export async function enrichChangesWithFileDetails(
let gitDetails = await gitApi.getChanges(change.id, repoId);
agentApi.logInfo (`Enriched with details of ${gitDetails.changes.length} files`);
extraDetail = gitDetails.changes;
} else {
agentApi.logInfo (`Cannot enriched as location URL not in dev.azure.com or xxx.visualstudio.com format`);
} catch (ex) {
agentApi.logInfo (`Cannot enriched ${ex}`);
}
} else if (change.type === "TfsVersionControl") {
var tfvcDetail = await tfvcApi.getChangesetChanges(parseInt(change.id.substring(1)));
Expand Down