Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: import service validate duplicates #4558

Merged
merged 1 commit into from
Aug 24, 2023

Conversation

kwasniew
Copy link
Contributor

About the changes

Validate if we have duplicate feature in import.

Also preparing for duplication removal in the enterprise service by extracting shared methods.

Important files

Discussion points

@vercel
Copy link

vercel bot commented Aug 23, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
unleash-monorepo-frontend ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 23, 2023 2:56pm
1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
unleash-docs ⬜️ Ignored (Inspect) Aug 23, 2023 2:56pm

@@ -144,6 +145,7 @@ export default class ExportImportService {
async validate(
dto: ImportTogglesSchema,
user: User,
mode = 'regular' as Mode,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

enterprise can pass change-request mode

unsupportedStrategies,
unsupportedContextFields || [],
[],
const errors = ImportValidationMessages.compileErrors({
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

introduced object to make it more manageable

await this.createOrUpdateToggles(cleanedDto, user);
}

async importToggleLevelInfo(
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

used by enterprise

async import(dto: ImportTogglesSchema, user: User): Promise<void> {
const cleanedDto = await this.cleanData(dto);

async importVerify(
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

used by enterprise

@@ -46,35 +59,28 @@ export class ImportValidationMessages {
),
});
}
if (segments.length > 0) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moved to enterprise

});
}
if (changeRequestExists) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moved to enterprise

@kwasniew kwasniew merged commit 2c35149 into main Aug 24, 2023
17 checks passed
@kwasniew kwasniew deleted the import-service-deuplicate-validation branch August 24, 2023 08:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

2 participants