Skip to content

Commit 452153a

Browse files
authored
CORE-430: retire snapshot-by-reference (#5316)
1 parent 0b103d4 commit 452153a

File tree

9 files changed

+51
-680
lines changed

9 files changed

+51
-680
lines changed

src/libs/ajax/workspaces/Workspaces.ts

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -285,28 +285,6 @@ export const Workspaces = (signal?: AbortSignal) => ({
285285
);
286286
},
287287

288-
snapshot: (snapshotId: string) => {
289-
const snapshotPath = `${root}/snapshots/v2/${snapshotId}`;
290-
291-
return {
292-
details: async () => {
293-
const res = await fetchRawls(snapshotPath, _.merge(authOpts(), { signal }));
294-
return res.json();
295-
},
296-
297-
update: (updateInfo) => {
298-
return fetchRawls(
299-
snapshotPath,
300-
_.mergeAll([authOpts(), jsonBody(updateInfo), { signal, method: 'PATCH' }])
301-
);
302-
},
303-
304-
delete: (): Promise<Response> => {
305-
return fetchRawls(snapshotPath, _.merge(authOpts(), { signal, method: 'DELETE' }));
306-
},
307-
};
308-
},
309-
310288
submission: (submissionId: string) => {
311289
const submissionPath = `${root}/submissions/${submissionId}`;
312290

src/libs/analysis.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { Workspaces } from 'src/libs/ajax/workspaces/Workspaces';
33
import * as Utils from 'src/libs/utils';
44

55
export const launch = async ({
6-
isSnapshot,
76
workspace: {
87
workspace: { namespace, name, googleProject, bucketName },
98
accessLevel,
@@ -48,7 +47,7 @@ export const launch = async ({
4847
);
4948
}
5049
const { entityName, processSet = false } = await Utils.cond(
51-
[isSnapshot || selectedEntityType === undefined, () => ({})],
50+
[selectedEntityType === undefined, () => ({})],
5251
[
5352
`${selectedEntityType}_set` === rootEntityType,
5453
async () => {
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
export const chooseRootType = Symbol('choose-root-type');
22
export const chooseBaseType = Symbol('choose-base-type');
33
export const chooseSetType = Symbol('choose-set-type');
4-
export const processSnapshotTable = Symbol('process snapshot table');

src/pages/workspaces/workspace/workflows/LaunchAnalysisModal.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,11 @@ import { useCancellation, useOnMount } from 'src/libs/react-utils';
1717
import { warningBoxStyle } from 'src/libs/style';
1818
import * as Utils from 'src/libs/utils';
1919
import { commentValidation } from 'src/pages/workspaces/workspace/submissionHistory/UpdateUserCommentModal';
20-
import { chooseBaseType, chooseRootType, chooseSetType, processSnapshotTable } from 'src/pages/workspaces/workspace/workflows/EntitySelectionType';
20+
import { chooseBaseType, chooseRootType, chooseSetType } from 'src/pages/workspaces/workspace/workflows/EntitySelectionType';
2121
import { isBatchSetting } from 'src/workspaces/SettingsModal/utils';
2222

2323
const LaunchAnalysisModal = ({
2424
onDismiss,
25-
entityMetadata,
2625
workspace,
2726
workspace: {
2827
workspace: { namespace, name: workspaceName, googleProject },
@@ -94,11 +93,9 @@ const LaunchAnalysisModal = ({
9493
};
9594
},
9695
],
97-
[type === chooseBaseType, () => ({ selectedEntityType: baseEntityType, selectedEntityNames: _.keys(selectedEntities) })],
98-
[type === processSnapshotTable, () => ({ selectedEntityType: rootEntityType })]
96+
[type === chooseBaseType, () => ({ selectedEntityType: baseEntityType, selectedEntityNames: _.keys(selectedEntities) })]
9997
);
10098
const { submissionId } = await launch({
101-
isSnapshot: type === processSnapshotTable,
10299
workspace,
103100
config,
104101
selectedEntityType,
@@ -129,7 +126,6 @@ const LaunchAnalysisModal = ({
129126
const mergeSets = _.flatMap(`attributes.${rootEntityType}s.items`);
130127
const entityCount = Utils.cond(
131128
[processSingle, () => 1],
132-
[type === processSnapshotTable, () => entityMetadata[rootEntityType].count],
133129
[type === chooseRootType, () => _.size(selectedEntities)],
134130
[type === chooseBaseType, () => 1],
135131
[type === chooseSetType, () => _.flow(mergeSets, _.uniqBy('entityName'))(selectedEntities).length]

src/pages/workspaces/workspace/workflows/LaunchAnalysisModal.test.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ describe('Launch Analysis Modal', () => {
4747
const namespace = 'test-namespace';
4848
const name = 'test-workspace';
4949
const googleProject = 'google-project-id';
50-
const entityMetadata = {};
5150
const workspace = { workspace: { namespace, name, googleProject } };
5251
const config = { rootEntityType: 'sample' };
5352
const entitySelectionModel = {
@@ -76,7 +75,6 @@ describe('Launch Analysis Modal', () => {
7675
render(
7776
h(LaunchAnalysisModal, {
7877
workspace,
79-
entityMetadata,
8078
config,
8179
entitySelectionModel,
8280
perWorkflowCostCap,
@@ -114,7 +112,6 @@ describe('Launch Analysis Modal', () => {
114112
const namespace = 'test-namespace';
115113
const name = 'test-workspace';
116114
const googleProject = 'google-project-id';
117-
const entityMetadata = {};
118115
const workspace = { workspace: { namespace, name, googleProject } };
119116
const config = { rootEntityType: 'sample' };
120117
const entitySelectionModel = {
@@ -143,7 +140,6 @@ describe('Launch Analysis Modal', () => {
143140
render(
144141
h(LaunchAnalysisModal, {
145142
workspace,
146-
entityMetadata,
147143
config,
148144
entitySelectionModel,
149145
perWorkflowCostCap,

0 commit comments

Comments
 (0)