Skip to content

Commit fe17f61

Browse files
committed
Rename remote to variant analysis
1 parent 611f6e3 commit fe17f61

5 files changed

Lines changed: 33 additions & 25 deletions

File tree

extensions/ql-vscode/src/databases/config/db-config-store.ts

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ export class DbConfigStore extends DisposableObject {
146146
parentList?: string,
147147
): Promise<void> {
148148
if (!this.config) {
149-
throw Error("Cannot add remote repo if config is not loaded");
149+
throw Error("Cannot add variant analysis repo if config is not loaded");
150150
}
151151

152152
if (repoNwo === "") {
@@ -155,7 +155,7 @@ export class DbConfigStore extends DisposableObject {
155155

156156
if (this.doesRemoteDbExist(repoNwo)) {
157157
throw Error(
158-
`A remote repository with the name '${repoNwo}' already exists`,
158+
`A variant analysis repository with the name '${repoNwo}' already exists`,
159159
);
160160
}
161161

@@ -177,15 +177,15 @@ export class DbConfigStore extends DisposableObject {
177177

178178
public async addRemoteOwner(owner: string): Promise<void> {
179179
if (!this.config) {
180-
throw Error("Cannot add remote owner if config is not loaded");
180+
throw Error("Cannot add owner if config is not loaded");
181181
}
182182

183183
if (owner === "") {
184184
throw Error("Owner name cannot be empty");
185185
}
186186

187187
if (this.doesRemoteOwnerExist(owner)) {
188-
throw Error(`A remote owner with the name '${owner}' already exists`);
188+
throw Error(`An owner with the name '${owner}' already exists`);
189189
}
190190

191191
const config = cloneDbConfig(this.config);
@@ -212,7 +212,7 @@ export class DbConfigStore extends DisposableObject {
212212

213213
public async addRemoteList(listName: string): Promise<void> {
214214
if (!this.config) {
215-
throw Error("Cannot add remote list if config is not loaded");
215+
throw Error("Cannot add variant analysis list if config is not loaded");
216216
}
217217

218218
this.validateRemoteListName(listName);
@@ -250,7 +250,9 @@ export class DbConfigStore extends DisposableObject {
250250
newName: string,
251251
) {
252252
if (!this.config) {
253-
throw Error("Cannot rename remote list if config is not loaded");
253+
throw Error(
254+
"Cannot rename variant analysis list if config is not loaded",
255+
);
254256
}
255257

256258
this.validateRemoteListName(newName);
@@ -287,7 +289,9 @@ export class DbConfigStore extends DisposableObject {
287289

288290
public doesRemoteListExist(listName: string): boolean {
289291
if (!this.config) {
290-
throw Error("Cannot check remote list existence if config is not loaded");
292+
throw Error(
293+
"Cannot check variant analysis list existence if config is not loaded",
294+
);
291295
}
292296

293297
return this.config.databases.variantAnalysis.repositoryLists.some(
@@ -306,7 +310,7 @@ export class DbConfigStore extends DisposableObject {
306310
public doesLocalDbExist(dbName: string, listName?: string): boolean {
307311
if (!this.config) {
308312
throw Error(
309-
"Cannot check remote database existence if config is not loaded",
313+
"Cannot check variant analysis repository existence if config is not loaded",
310314
);
311315
}
312316

@@ -323,7 +327,7 @@ export class DbConfigStore extends DisposableObject {
323327
public doesRemoteDbExist(dbName: string, listName?: string): boolean {
324328
if (!this.config) {
325329
throw Error(
326-
"Cannot check remote database existence if config is not loaded",
330+
"Cannot check variant analysis repository existence if config is not loaded",
327331
);
328332
}
329333

@@ -338,9 +342,7 @@ export class DbConfigStore extends DisposableObject {
338342

339343
public doesRemoteOwnerExist(owner: string): boolean {
340344
if (!this.config) {
341-
throw Error(
342-
"Cannot check remote owner existence if config is not loaded",
343-
);
345+
throw Error("Cannot check owner existence if config is not loaded");
344346
}
345347

346348
return this.config.databases.variantAnalysis.owners.includes(owner);
@@ -482,7 +484,9 @@ export class DbConfigStore extends DisposableObject {
482484
}
483485

484486
if (this.doesRemoteListExist(listName)) {
485-
throw Error(`A remote list with the name '${listName}' already exists`);
487+
throw Error(
488+
`A variant analysis list with the name '${listName}' already exists`,
489+
);
486490
}
487491
}
488492

extensions/ql-vscode/src/databases/config/db-config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ function getRemoteList(
381381
);
382382

383383
if (!list) {
384-
throw Error(`Cannot find remote list '${listName}'`);
384+
throw Error(`Cannot find variant analysis list '${listName}'`);
385385
}
386386

387387
return list;

extensions/ql-vscode/src/databases/ui/db-panel.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -135,14 +135,14 @@ export class DbPanel extends DisposableObject {
135135
const quickPickItems = [
136136
{
137137
label: "$(repo) From a GitHub repository",
138-
detail: "Add a remote repository from GitHub",
138+
detail: "Add a variant analysis repository from GitHub",
139139
alwaysShow: true,
140140
kind: "repo",
141141
},
142142
{
143143
label: "$(organization) All repositories of a GitHub org or owner",
144144
detail:
145-
"Add a remote list of repositories from a GitHub organization/owner",
145+
"Add a variant analysis list of repositories from a GitHub organization/owner",
146146
alwaysShow: true,
147147
kind: "owner",
148148
},
@@ -151,7 +151,7 @@ export class DbPanel extends DisposableObject {
151151
await window.showQuickPick<RemoteDatabaseQuickPickItem>(
152152
quickPickItems,
153153
{
154-
title: "Add a remote repository",
154+
title: "Add a variant analysis repository",
155155
placeHolder: "Select an option",
156156
ignoreFocusOut: true,
157157
},
@@ -171,7 +171,7 @@ export class DbPanel extends DisposableObject {
171171

172172
private async addNewRemoteRepo(parentList?: string): Promise<void> {
173173
const repoName = await window.showInputBox({
174-
title: "Add a remote repository",
174+
title: "Add a repository",
175175
prompt: "Insert a GitHub repository URL or name with owner",
176176
placeHolder: "github.com/<owner>/<repo> or <owner>/<repo>",
177177
});
@@ -246,8 +246,8 @@ export class DbPanel extends DisposableObject {
246246
} else {
247247
const quickPickItems = [
248248
{
249-
label: "$(cloud) Remote",
250-
detail: "Add a remote database from GitHub",
249+
label: "$(cloud) Variant Analysis",
250+
detail: "Add a repository from GitHub",
251251
alwaysShow: true,
252252
kind: DbListKind.Remote,
253253
},
@@ -419,7 +419,7 @@ export class DbPanel extends DisposableObject {
419419
const githubUrl = getGitHubUrl(treeViewItem.dbItem);
420420
if (!githubUrl) {
421421
throw new Error(
422-
"Unable to open on GitHub. Please select a remote repository or owner.",
422+
"Unable to open on GitHub. Please select a variant analysis repository or owner.",
423423
);
424424
}
425425

extensions/ql-vscode/test/unit-tests/databases/config/db-config-store.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,9 @@ describe("db config store", () => {
482482
});
483483
await expect(
484484
configStore.renameRemoteList(currentDbItem, "list2"),
485-
).rejects.toThrow(`A remote list with the name 'list2' already exists`);
485+
).rejects.toThrow(
486+
`A variant analysis list with the name 'list2' already exists`,
487+
);
486488

487489
configStore.dispose();
488490
});

extensions/ql-vscode/test/vscode-tests/minimal-workspace/databases/db-panel.test.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -715,7 +715,9 @@ describe("db panel", () => {
715715
await expect(
716716
dbManager.addNewList(DbListKind.Remote, "my-list-1"),
717717
).rejects.toThrow(
718-
new Error("A remote list with the name 'my-list-1' already exists"),
718+
new Error(
719+
"A variant analysis list with the name 'my-list-1' already exists",
720+
),
719721
);
720722
});
721723

@@ -738,7 +740,7 @@ describe("db panel", () => {
738740

739741
await expect(dbManager.addNewRemoteRepo("owner1/repo1")).rejects.toThrow(
740742
new Error(
741-
"A remote repository with the name 'owner1/repo1' already exists",
743+
"A variant analysis repository with the name 'owner1/repo1' already exists",
742744
),
743745
);
744746
});
@@ -761,7 +763,7 @@ describe("db panel", () => {
761763
await saveDbConfig(dbConfig);
762764

763765
await expect(dbManager.addNewRemoteOwner("owner1")).rejects.toThrow(
764-
new Error("A remote owner with the name 'owner1' already exists"),
766+
new Error("An owner with the name 'owner1' already exists"),
765767
);
766768
});
767769
});

0 commit comments

Comments
 (0)