Skip to content

Commit

Permalink
fix: update client version in JsonSchemaVersionsFallback (#38390) (#3…
Browse files Browse the repository at this point in the history
…8391)

## Description
Updated the client version from 1 to 2 in the JsonSchemaVersionsFallback
class to align with the latest schema changes.
With introduction fo HTML column type in appsmith table, we don't want,
apps exported from a newer version to be importable in the older
version.

Fixes #38311 
_or_  
Fixes `Issue URL`
> [!WARNING]  
> _If no issue exists, please create an issue first, and check with the
maintainers if the issue is valid._

## Automation

/ok-to-test tags="@tag.Sanity"

### 🔍 Cypress test results
<!-- This is an auto-generated comment: Cypress test results  -->
> [!TIP]
> 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
> Workflow run:
<https://github.com/appsmithorg/appsmith/actions/runs/12581380732>
> Commit: 51523c9
> <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=12581380732&attempt=1"
target="_blank">Cypress dashboard</a>.
> Tags: `@tag.Sanity`
> Spec:
> <hr>Thu, 02 Jan 2025 11:33:56 UTC
<!-- end of auto-generated comment: Cypress test results  -->


## Communication
Should the DevRel and Marketing teams inform users about this change?
- [ ] Yes
- [x] No


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **New Features**
	- Updated client version to reflect changes in the application.
	- Incremented client schema version to align with application updates.

- **Bug Fixes**
- Corrected the static client version to ensure accurate version
reporting.

- **Tests**
- Enhanced test setup to initialize the application with the current
client schema version.
- Updated expected values in tests to reflect the new client schema
version.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
  • Loading branch information
rahulbarwal authored Jan 3, 2025
1 parent c43f84d commit 1405aa6
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
@Component
public class JsonSchemaVersionsFallback {
private static final Integer serverVersion = 11;
public static final Integer clientVersion = 1;
public static final Integer clientVersion = 2;

public Integer getServerVersion() {
return serverVersion;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,7 @@ public void setup() {
testApplication.setLastDeployedAt(Instant.now());
testApplication.setModifiedBy("some-user");
testApplication.setGitApplicationMetadata(new GitArtifactMetadata());
testApplication.setClientSchemaVersion(jsonSchemaVersions.getClientVersion());

Application.ThemeSetting themeSettings = getThemeSetting();
testApplication.setUnpublishedApplicationDetail(new ApplicationDetail());
Expand Down Expand Up @@ -2733,7 +2734,7 @@ public void applySchemaMigration_jsonFileWithFirstVersion_migratedToLatestVersio
ApplicationJson latestApplicationJson = tuple.getT2();

assertThat(v1ApplicationJson.getServerSchemaVersion()).isEqualTo(1);
assertThat(v1ApplicationJson.getClientSchemaVersion()).isEqualTo(1);
assertThat(v1ApplicationJson.getClientSchemaVersion()).isEqualTo(2);

assertThat(latestApplicationJson.getServerSchemaVersion())
.isEqualTo(jsonSchemaVersions.getServerVersion());
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"artifactJsonType": "APPLICATION",
"clientSchemaVersion": 1.0,
"clientSchemaVersion": 2.0,
"serverSchemaVersion": 7.0,
"exportedApplication": {
"name": "json-schema-migration",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"serverSchemaVersion": 1,
"clientSchemaVersion": 1
"clientSchemaVersion": 2
}

0 comments on commit 1405aa6

Please sign in to comment.