-
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
fix: update client version in JsonSchemaVersionsFallback (#38390) #38391
fix: update client version in JsonSchemaVersionsFallback (#38390) #38391
Conversation
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.
WalkthroughThe pull request involves a minor version update in the Changes
Assessment against linked issues
Possibly Related PRs
Suggested Labels
Suggested Reviewers
Poem
📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
🔇 Additional comments (1)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
Failed server tests
|
1 similar comment
Failed server tests
|
…o rahulbarwal/increase-clientSchemaVersion-to-prevent-HTML-column-based-apps-import-to-old-versions
Failed server tests
|
Updated the clientSchemaVersion in application.json from 1.0 to 2.0 to ensure that applications exported from newer versions cannot be imported into older versions, addressing potential compatibility issues with the introduction of HTML column types.
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.
Actionable comments posted: 1
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
app/server/appsmith-server/src/test/resources/com/appsmith/server/migrations/application.json
(1 hunks)
@@ -1,6 +1,6 @@ | |||
{ | |||
"artifactJsonType": "APPLICATION", | |||
"clientSchemaVersion": 1.0, | |||
"clientSchemaVersion": 2.0, |
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
Test resources need to be updated to match new client schema version
The clientSchemaVersion update to 2.0 in migrations/application.json is correct and matches JsonSchemaVersionsFallback.clientVersion = 2, but other test resources are still using version 1.0/1 which needs to be updated:
test_assets/ImportExportServiceTest/*.json
files need clientSchemaVersion: 2git/*.json
files need clientSchemaVersion: 2imports/internal/faulty-dsl.json
needs clientSchemaVersion: 2
These test files are used in import/export and migration tests that verify version compatibility. Having inconsistent versions across test resources could lead to false test failures.
🔗 Analysis chain
LGTM! Version update aligns with PR objectives.
The clientSchemaVersion update from 1.0 to 2.0 correctly implements the intended breaking change for HTML column type support.
Let's verify consistency across other test resources:
Inconsistent schema versions found in test resources - update needed
All test resources except migrations/application.json
are using clientSchemaVersion 1.0/1, which conflicts with the schema version upgrade to 2.0. These test files need to be updated to maintain consistency:
test_assets/ImportExportServiceTest/*.json
files (7 files)git/*.json
files (4 files)imports/internal/faulty-dsl.json
Let's verify if these files are used in migration/import tests that specifically need the older version:
Let's check the test files to understand if they specifically test version compatibility:
Let's try a different approach to find version-related test cases:
Let's check the JsonSchemaVersions class to understand the version management:
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Find and check clientSchemaVersion in other test resources
rg -l "clientSchemaVersion" app/server/appsmith-server/src/test/resources/ | while read -r file; do
echo "=== $file ==="
# Show the line containing clientSchemaVersion and its context
rg -C 2 "clientSchemaVersion" "$file"
done
Length of output: 6498
Script:
#!/bin/bash
# Search for test files that use these json resources
rg -l "ImportExportServiceTest|faulty-dsl.json|ce-automation-test.json|autocommit.json" app/server/appsmith-server/src/test/java/
Length of output: 1148
Script:
#!/bin/bash
# Check test files for version-related tests
echo "=== Checking ServerSchemaMigrationEnforcerTest ==="
rg -C 5 "clientSchemaVersion|schemaVersion" app/server/appsmith-server/src/test/java/com/appsmith/server/git/ServerSchemaMigrationEnforcerTest.java
echo -e "\n=== Checking ImportServiceTests ==="
rg -C 5 "clientSchemaVersion|schemaVersion" app/server/appsmith-server/src/test/java/com/appsmith/server/imports/internal/ImportServiceTests.java
echo -e "\n=== Checking ImportApplicationTransactionServiceTest ==="
rg -C 5 "clientSchemaVersion|schemaVersion" app/server/appsmith-server/src/test/java/com/appsmith/server/transactions/ImportApplicationTransactionServiceTest.java
Length of output: 789
Script:
#!/bin/bash
# Search for JsonSchemaVersions or version-related imports/constants
echo "=== Checking for JsonSchemaVersions usage ==="
rg -C 5 "JsonSchemaVersions" app/server/appsmith-server/src/test/java/
echo -e "\n=== Checking for version-related test methods ==="
rg -C 5 "test.*[Vv]ersion|[Vv]ersion.*test" app/server/appsmith-server/src/test/java/
echo -e "\n=== Checking for version assertions ==="
rg -C 5 "assert.*[Vv]ersion|[Vv]ersion.*assert" app/server/appsmith-server/src/test/java/
Length of output: 69826
Script:
#!/bin/bash
# Check JsonSchemaVersions implementation
echo "=== Checking JsonSchemaVersions class ==="
rg -C 5 "class JsonSchemaVersions" app/server/appsmith-server/src/main/java/
echo -e "\n=== Checking JsonSchemaVersionsFallback class ==="
rg -C 5 "class JsonSchemaVersionsFallback" app/server/appsmith-server/src/main/java/
Length of output: 4895
Failed server tests
|
Failed server tests
|
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.All"
🔍 Cypress test results
Tip
🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/12592789691
Commit: 51523c9
Cypress dashboard.
Tags:
@tag.All
Spec:
Fri, 03 Jan 2025 06:03:39 UTC
Communication
Should the DevRel and Marketing teams inform users about this change?
Summary by CodeRabbit
New Features
Bug Fixes
Tests