mirror of
https://github.com/Unleash/unleash.git
synced 2025-01-25 00:07:47 +01:00
chore: remove unused clone code (#7529)
Removing this code, because variants per env are GA and I did not find any usage of it.
This commit is contained in:
parent
990ea1ffb2
commit
08533d7224
@ -303,41 +303,6 @@ export class FeatureEnvironmentStore implements IFeatureEnvironmentStore {
|
|||||||
.del();
|
.del();
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: remove this once variants per env are GA
|
|
||||||
async clonePreviousVariants(
|
|
||||||
environment: string,
|
|
||||||
project: string,
|
|
||||||
): Promise<void> {
|
|
||||||
const rows = await this.db(`${T.features} as f`)
|
|
||||||
.select([
|
|
||||||
this.db.raw(`'${environment}' as environment`),
|
|
||||||
'fe.enabled',
|
|
||||||
'fe.feature_name',
|
|
||||||
'fe.variants',
|
|
||||||
])
|
|
||||||
.distinctOn(['environment', 'feature_name'])
|
|
||||||
.join(`${T.featureEnvs} as fe`, 'f.name', 'fe.feature_name')
|
|
||||||
.whereNot({ environment })
|
|
||||||
.andWhere({ project });
|
|
||||||
|
|
||||||
const newRows = rows.map((row) => {
|
|
||||||
const r = row as any as IFeatureEnvironmentRow;
|
|
||||||
return {
|
|
||||||
variants: JSON.stringify(r.variants),
|
|
||||||
enabled: r.enabled,
|
|
||||||
environment: r.environment,
|
|
||||||
feature_name: r.feature_name,
|
|
||||||
};
|
|
||||||
});
|
|
||||||
|
|
||||||
if (newRows.length > 0) {
|
|
||||||
await this.db(T.featureEnvs)
|
|
||||||
.insert(newRows)
|
|
||||||
.onConflict(['environment', 'feature_name'])
|
|
||||||
.merge(['variants']);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
async connectFeatureToEnvironmentsForProject(
|
async connectFeatureToEnvironmentsForProject(
|
||||||
featureName: string,
|
featureName: string,
|
||||||
projectId: string,
|
projectId: string,
|
||||||
|
@ -85,7 +85,5 @@ export interface IFeatureEnvironmentStore
|
|||||||
featureEnvironment: IFeatureEnvironment,
|
featureEnvironment: IFeatureEnvironment,
|
||||||
): Promise<void>;
|
): Promise<void>;
|
||||||
|
|
||||||
clonePreviousVariants(environment: string, project: string): Promise<void>;
|
|
||||||
|
|
||||||
variantExists(featureName: string): Promise<boolean>;
|
variantExists(featureName: string): Promise<boolean>;
|
||||||
}
|
}
|
||||||
|
@ -224,15 +224,6 @@ export default class FakeFeatureEnvironmentStore
|
|||||||
throw new Error('Method not implemented.');
|
throw new Error('Method not implemented.');
|
||||||
}
|
}
|
||||||
|
|
||||||
clonePreviousVariants(
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
||||||
environment: string,
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
||||||
project: string,
|
|
||||||
): Promise<void> {
|
|
||||||
throw new Error('Method not implemented.');
|
|
||||||
}
|
|
||||||
|
|
||||||
async getAllByFeatures(
|
async getAllByFeatures(
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||||
features: string[],
|
features: string[],
|
||||||
|
Loading…
Reference in New Issue
Block a user