Skip to content

Commit 69b06ae

Browse files
committed
Make getVariantAnalysisRepoResult return the correct type
We expect this method to return a zip file which can be typed to an `ArrayBuffer`. In the following commits we'll read this buffer and save it as a zip file.
1 parent 81b53c9 commit 69b06ae

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

extensions/ql-vscode/src/remote-queries/gh-api/gh-api-client.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,9 @@ export async function getVariantAnalysisRepo(
7777
export async function getVariantAnalysisRepoResult(
7878
credentials: Credentials,
7979
downloadUrl: string,
80-
): Promise<unknown> {
80+
): Promise<ArrayBuffer> {
8181
const octokit = await credentials.getOctokit();
82-
83-
const response: OctokitResponse<VariantAnalysisRepoTask> = await octokit.request(
84-
`GET ${downloadUrl}`
85-
);
82+
const response = await octokit.request(`GET ${downloadUrl}`);
8683

8784
return response.data;
8885
}

extensions/ql-vscode/src/vscode-tests/cli-integration/remote-queries/variant-analysis-manager.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ describe('Variant Analysis Manager', async function() {
8888
delete dummyRepoTask.artifact_url;
8989
getVariantAnalysisRepoStub = sandbox.stub(ghApiClient, 'getVariantAnalysisRepo').resolves(dummyRepoTask);
9090

91-
const dummyResult = 'this-is-a-repo-result';
91+
const dummyResult = new ArrayBuffer(24);
9292
getVariantAnalysisRepoResultStub = sandbox.stub(ghApiClient, 'getVariantAnalysisRepoResult').resolves(dummyResult);
9393
});
9494

@@ -108,7 +108,7 @@ describe('Variant Analysis Manager', async function() {
108108
const dummyRepoTask = createMockVariantAnalysisRepoTask();
109109
getVariantAnalysisRepoStub = sandbox.stub(ghApiClient, 'getVariantAnalysisRepo').resolves(dummyRepoTask);
110110

111-
const dummyResult = 'this-is-a-repo-result';
111+
const dummyResult = new ArrayBuffer(24);
112112
getVariantAnalysisRepoResultStub = sandbox.stub(ghApiClient, 'getVariantAnalysisRepoResult').resolves(dummyResult);
113113
});
114114

0 commit comments

Comments
 (0)