Rename function to promptAndDownloadGitHubDatabase
This commit is contained in:
@@ -6,7 +6,7 @@ import { asError, getErrorMessage } from "../common/helpers-pure";
|
||||
import {
|
||||
CodeqlDatabase,
|
||||
findGitHubDatabasesForRepository,
|
||||
promptGitHubDatabaseDownload,
|
||||
promptAndDownloadGitHubDatabase,
|
||||
} from "./github-database-prompt";
|
||||
import {
|
||||
GitHubDatabaseConfig,
|
||||
@@ -124,7 +124,7 @@ export class GithubDatabaseModule extends DisposableObject {
|
||||
return;
|
||||
}
|
||||
|
||||
void promptGitHubDatabaseDownload(
|
||||
await promptAndDownloadGitHubDatabase(
|
||||
octokit,
|
||||
githubRepository.owner,
|
||||
githubRepository.name,
|
||||
|
||||
@@ -30,10 +30,9 @@ export async function findGitHubDatabasesForRepository(
|
||||
}
|
||||
|
||||
/**
|
||||
* Prompt the user to download a database from GitHub. This is a blocking method, so this should
|
||||
* almost never be called with `await`.
|
||||
* Prompt the user to download a database from GitHub and download that database.
|
||||
*/
|
||||
export async function promptGitHubDatabaseDownload(
|
||||
export async function promptAndDownloadGitHubDatabase(
|
||||
octokit: Octokit,
|
||||
owner: string,
|
||||
repo: string,
|
||||
|
||||
@@ -3,7 +3,7 @@ import { Octokit } from "@octokit/rest";
|
||||
import { mockedObject } from "../../utils/mocking.helpers";
|
||||
import {
|
||||
CodeqlDatabase,
|
||||
promptGitHubDatabaseDownload,
|
||||
promptAndDownloadGitHubDatabase,
|
||||
} from "../../../../src/databases/github-database-prompt";
|
||||
import { DatabaseManager } from "../../../../src/databases/local-databases";
|
||||
import { GitHubDatabaseConfig } from "../../../../src/config";
|
||||
@@ -12,7 +12,7 @@ import { createMockCommandManager } from "../../../__mocks__/commandsMock";
|
||||
import * as databaseFetcher from "../../../../src/databases/database-fetcher";
|
||||
import * as dialog from "../../../../src/common/vscode/dialog";
|
||||
|
||||
describe("promptGitHubDatabaseDownload", () => {
|
||||
describe("promptAndDownloadGitHubDatabase", () => {
|
||||
let octokit: Octokit;
|
||||
const owner = "github";
|
||||
const repo = "codeql";
|
||||
@@ -65,7 +65,7 @@ describe("promptGitHubDatabaseDownload", () => {
|
||||
});
|
||||
|
||||
it("downloads the database", async () => {
|
||||
await promptGitHubDatabaseDownload(
|
||||
await promptAndDownloadGitHubDatabase(
|
||||
octokit,
|
||||
owner,
|
||||
repo,
|
||||
@@ -103,7 +103,7 @@ describe("promptGitHubDatabaseDownload", () => {
|
||||
});
|
||||
|
||||
it("does not download the database", async () => {
|
||||
await promptGitHubDatabaseDownload(
|
||||
await promptAndDownloadGitHubDatabase(
|
||||
octokit,
|
||||
owner,
|
||||
repo,
|
||||
@@ -125,7 +125,7 @@ describe("promptGitHubDatabaseDownload", () => {
|
||||
});
|
||||
|
||||
it("does not download the database", async () => {
|
||||
await promptGitHubDatabaseDownload(
|
||||
await promptAndDownloadGitHubDatabase(
|
||||
octokit,
|
||||
owner,
|
||||
repo,
|
||||
@@ -147,7 +147,7 @@ describe("promptGitHubDatabaseDownload", () => {
|
||||
});
|
||||
|
||||
it("does not download the database", async () => {
|
||||
await promptGitHubDatabaseDownload(
|
||||
await promptAndDownloadGitHubDatabase(
|
||||
octokit,
|
||||
owner,
|
||||
repo,
|
||||
@@ -163,7 +163,7 @@ describe("promptGitHubDatabaseDownload", () => {
|
||||
});
|
||||
|
||||
it('sets the config to "never"', async () => {
|
||||
await promptGitHubDatabaseDownload(
|
||||
await promptAndDownloadGitHubDatabase(
|
||||
octokit,
|
||||
owner,
|
||||
repo,
|
||||
@@ -186,7 +186,7 @@ describe("promptGitHubDatabaseDownload", () => {
|
||||
});
|
||||
|
||||
it("does not download the database", async () => {
|
||||
await promptGitHubDatabaseDownload(
|
||||
await promptAndDownloadGitHubDatabase(
|
||||
octokit,
|
||||
owner,
|
||||
repo,
|
||||
@@ -229,7 +229,7 @@ describe("promptGitHubDatabaseDownload", () => {
|
||||
});
|
||||
|
||||
it("downloads the correct database", async () => {
|
||||
await promptGitHubDatabaseDownload(
|
||||
await promptAndDownloadGitHubDatabase(
|
||||
octokit,
|
||||
owner,
|
||||
repo,
|
||||
|
||||
Reference in New Issue
Block a user