-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Download replay file instead of RepoResult.zip file (#158)
* Download replay file instead of RepoResult.zip file * Fixed package-lock --------- Co-authored-by: Armando Aguirre Sepulveda <araguir@microsoft.com>
- Loading branch information
1 parent
cccbc2f
commit b8f135a
Showing
12 changed files
with
435 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import ado = require("azure-devops-node-api"); | ||
import { Params, Summary } from "../main"; | ||
|
||
interface ArtifactContent { | ||
items: [{ | ||
path: string; | ||
blob: { | ||
id: string; | ||
}; | ||
}]; | ||
}; | ||
|
||
export async function getReplayScriptDownloadUrl(summary: Summary, params: Params) { | ||
const cli = new ado.WebApi(`${params.teamFoundationCollectionUri}defaultcollection`, ado.getHandlerFromToken("")); // Empty token, anon auth | ||
const build = await cli.getBuildApi(); | ||
const artifact = await build.getArtifact(params.teamProject, params.buildId, summary.resultDirName); | ||
|
||
if (artifact.resource?.url) { | ||
const repoResultUrl = new URL(artifact.resource.url); | ||
repoResultUrl.search = `artifactName=${summary.resultDirName}&fileId=${artifact.resource.data}&fileName=${summary.resultDirName}`; | ||
|
||
const artifactContent = await (await fetch(repoResultUrl)).json() as ArtifactContent; | ||
|
||
const item = artifactContent.items.find(x => x.path.endsWith(summary.replayScriptName)); | ||
|
||
const replayScriptUrl = new URL(artifact.resource.url); | ||
replayScriptUrl.search = `artifactName=${summary.resultDirName}&fileId=${item!.blob.id}&fileName=${summary.replayScriptName}`; | ||
|
||
return replayScriptUrl; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters