Skip to content

Commit ad58b0b

Browse files
committed
Added support for build links.
1 parent df9814b commit ad58b0b

File tree

1 file changed

+29
-2
lines changed

1 file changed

+29
-2
lines changed

src/HistoryDiffPageScript.js

+29-2
Original file line numberDiff line numberDiff line change
@@ -391,10 +391,12 @@ async function TryGetHTMLLinkNameAndUrlForArtifactLink(currentProjectName, artif
391391
}
392392

393393
// TODO:
394-
// - Resolve project and repository ids for better display? I.e. in the history, show the project and repository names?
394+
// - Retrieve information from the linked artifacts?
395+
// - Project and repository names for better display? I.e. in the history, show the project and repository names?
396+
// - Build information (succeeded, failed, deleted)?
397+
// - Show small icons, as in the default ADO history?
395398
// - Support all other artifact link types.
396399
// - Maybe call routeUrl() at the start of the initialization to trigger the REST request as early as possible?
397-
// - TFS code references? (Compare e.g. constructLinkToContentFromRouteId())
398400
// - Check all places whether EscapeHtml() or encode...() is missing.
399401
// - Split into multiple functions, or a map or so.
400402
// - Wrap in try...catch?
@@ -594,6 +596,31 @@ async function TryGetHTMLLinkNameAndUrlForArtifactLink(currentProjectName, artif
594596
return [filepath, url, readableChangeset];
595597
}
596598
}
599+
else if (artifactTool === 'Build') {
600+
// Used for 'Build', 'Found in build' and 'Integrated in build' links.
601+
// Example: vstfs:///Build/Build/5
602+
if (artifactType === 'Build') {
603+
const buildId = artifactId;
604+
605+
/*
606+
"routeTemplates": [
607+
"{project}/{team}/_build/results",
608+
"{project}/_build/results"
609+
],
610+
*/
611+
const url = await gLocationService.routeUrl(
612+
'ms.vss-build-web.ci-results-hub-route',
613+
{
614+
// TODO: The build can be in a different project. Using the current project in this case results
615+
// in a URL pointing to a non-existent build. The buildId is unique over all projects. So we would
616+
// need to query the project of the build.
617+
project: currentProjectName,
618+
buildId: buildId
619+
});
620+
621+
return [buildId, url, ''];
622+
}
623+
}
597624

598625
// Unknown artifact link.
599626
return undefined;

0 commit comments

Comments
 (0)