-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
chore: bump DSL version to 91 and update migration logic #38516
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -68,11 +68,35 @@ public Mono<ApplicationJson> migrateApplicationJsonToLatestSchema( | |||||||||||||||||||||||||||||||||
return Mono.empty(); | ||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||
return migrateServerSchema(applicationJson, baseApplicationId, refName); | ||||||||||||||||||||||||||||||||||
return migrateClientSchema(appJson, baseApplicationId, refName) | ||||||||||||||||||||||||||||||||||
.flatMap(clientJson -> migrateServerSchema(clientJson, baseApplicationId, refName)); | ||||||||||||||||||||||||||||||||||
}) | ||||||||||||||||||||||||||||||||||
.switchIfEmpty(Mono.error(new AppsmithException(AppsmithError.INCOMPATIBLE_IMPORTED_JSON))); | ||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||
private Mono<ApplicationJson> migrateClientSchema( | ||||||||||||||||||||||||||||||||||
ApplicationJson applicationJson, String baseApplicationId, String branchName) { | ||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||
Mono<ApplicationJson> migrateApplicationJsonMono = Mono.just(applicationJson); | ||||||||||||||||||||||||||||||||||
if (jsonSchemaVersions.getClientVersion().equals(applicationJson.getClientSchemaVersion())) { | ||||||||||||||||||||||||||||||||||
return migrateApplicationJsonMono; | ||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||
// Run migration linearly | ||||||||||||||||||||||||||||||||||
// Updating the schema version after each migration is not required as we are not exiting by breaking the switch | ||||||||||||||||||||||||||||||||||
// cases, but this keeps the version number and the migration in sync | ||||||||||||||||||||||||||||||||||
switch (applicationJson.getClientSchemaVersion()) { | ||||||||||||||||||||||||||||||||||
case 0: | ||||||||||||||||||||||||||||||||||
applicationJson.setClientSchemaVersion(1); | ||||||||||||||||||||||||||||||||||
case 1: | ||||||||||||||||||||||||||||||||||
applicationJson.setClientSchemaVersion(2); | ||||||||||||||||||||||||||||||||||
default: | ||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||
Comment on lines
+88
to
+94
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add missing 'break' statements in switch cases to prevent fall-through The switch cases in Apply this diff to add switch (applicationJson.getClientSchemaVersion()) {
case 0:
applicationJson.setClientSchemaVersion(1);
+ break;
case 1:
applicationJson.setClientSchemaVersion(2);
+ break;
default:
// No action needed
} 📝 Committable suggestion
Suggested change
|
||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||
applicationJson.setClientSchemaVersion(jsonSchemaVersions.getClientVersion()); | ||||||||||||||||||||||||||||||||||
return migrateApplicationJsonMono; | ||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||
/** | ||||||||||||||||||||||||||||||||||
* This method may be moved to the publisher chain itself | ||||||||||||||||||||||||||||||||||
* | ||||||||||||||||||||||||||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codebase verification
Follow established pattern for skipped migration 90
The empty
functionLookup
array breaks consistency with other skipped migrations in the codebase. Versions 47 and 50 use a clear pattern withskippedMigrationX
function names and documentation. Update version 90 to match this pattern:• Add a comment above the migration explaining why version 90 is skipped, similar to the existing comment for version 50.
🔗 Analysis chain
Document the reason for skipping migration 90.
The empty
functionLookup
array suggests this is a skipped migration. While this pattern is used elsewhere (e.g., skippedMigration47, skippedMigration50), those cases include a placeholder function name. Consider adding a comment or placeholder to maintain consistency with other skipped migrations.Apply this diff to maintain consistency:
Let's verify if there are any other skipped migrations that follow this pattern:
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
Length of output: 54
Script:
Length of output: 65854
Script:
Length of output: 1253