-
Notifications
You must be signed in to change notification settings - Fork 4.7k
chore: json migration changes #34238
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 7 additions & 1 deletion
8
app/server/appsmith-server/src/main/java/com/appsmith/server/helpers/ResponseUtils.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,15 @@ | ||
| package com.appsmith.server.helpers; | ||
|
|
||
| import com.appsmith.server.helpers.ce.ResponseUtilsCE; | ||
| import com.appsmith.server.migrations.JsonSchemaVersions; | ||
| import lombok.extern.slf4j.Slf4j; | ||
| import org.springframework.stereotype.Component; | ||
|
|
||
| @Slf4j | ||
| @Component | ||
| public class ResponseUtils extends ResponseUtilsCE {} | ||
| public class ResponseUtils extends ResponseUtilsCE { | ||
|
|
||
| public ResponseUtils(JsonSchemaVersions jsonSchemaVersions) { | ||
| super(jsonSchemaVersions); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -64,6 +64,8 @@ public class CommonGitFileUtilsCE { | |
| @Value("${appsmith.index.lock.file.time}") | ||
| public final int INDEX_LOCK_FILE_STALE_TIME = 300; | ||
|
|
||
| private final JsonSchemaVersions jsonSchemaVersions; | ||
|
|
||
| private ArtifactGitFileUtils<?> getArtifactBasedFileHelper(ArtifactType artifactType) { | ||
| if (ArtifactType.APPLICATION.equals(artifactType)) { | ||
| return applicationGitFileUtils; | ||
|
|
@@ -359,7 +361,7 @@ public Mono<Integer> getMetadataServerSchemaMigrationVersion( | |
| workspaceId, defaultArtifactId, repoName, branchName, isResetToLastCommitRequired, artifactType) | ||
| .map(metadataMap -> { | ||
| return metadataMap.getOrDefault( | ||
| CommonConstants.SERVER_SCHEMA_VERSION, JsonSchemaVersions.serverVersion); | ||
| CommonConstants.SERVER_SCHEMA_VERSION, jsonSchemaVersions.getServerVersion()); | ||
|
Contributor
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. The methods - return jsonSchemaVersions.getServerVersion();
+ if (metadataJsonObject == null || !metadataJsonObject.has(SERVER_SCHEMA_VERSION)) {
+ return jsonSchemaVersions.getServerVersion();
+ }
+ return metadataJsonObject.get(SERVER_SCHEMA_VERSION).getAsInt();Also applies to: 427-427 |
||
| }); | ||
|
|
||
| return Mono.create( | ||
|
|
@@ -422,7 +424,7 @@ public Mono<JSONObject> getPageDslVersionNumber( | |
|
|
||
| private Integer getServerSchemaVersion(JsonObject metadataJsonObject) { | ||
| if (metadataJsonObject == null) { | ||
| return JsonSchemaVersions.serverVersion; | ||
| return jsonSchemaVersions.getServerVersion(); | ||
| } | ||
|
|
||
| JsonElement serverSchemaVersion = metadataJsonObject.get(SERVER_SCHEMA_VERSION); | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Tip
Codebase Verification
The search results show multiple references to
JsonSchemaVersions, but none indicate its initialization within theCommonGitFileUtilsCEclass. This suggests thatJsonSchemaVersionsmay not be properly initialized, which could lead to null pointer exceptions.app/server/appsmith-server/src/main/java/com/appsmith/server/helpers/ce/CommonGitFileUtilsCE.java: The file contains a declaration ofJsonSchemaVersionsbut no evidence of its initialization.Please review the constructor of
CommonGitFileUtilsCEand ensure thatJsonSchemaVersionsis properly instantiated or injected.Analysis chain
Proper initialization of
JsonSchemaVersionsis crucial. Ensure it is being injected or instantiated correctly to avoid null pointer exceptions.Scripts executed
The following scripts were executed for the analysis:
Script:
Length of output: 666
Script:
Length of output: 82
Script:
Length of output: 61
Script:
Length of output: 135
Script:
Length of output: 8911