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

chore: CE split for git constants and AGF #38464

Merged
merged 4 commits into from
Jan 6, 2025
Merged

Conversation

nidhi-nair
Copy link
Contributor

@nidhi-nair nidhi-nair commented Jan 3, 2025

Description

Tip

Add a TL;DR when the description is longer than 500 words or extremely technical (helps the content, marketing, and DevRel team).

Please also include relevant motivation and context. List any dependencies that are required for this change. Add links to Notion, Figma or any other documents that might be relevant to the PR.

Fixes #Issue Number
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.Git" it=true

🔍 Cypress test results

Warning

Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/12626330445
Commit: dd115a5
Cypress dashboard.
Tags: @tag.Git
Spec:
It seems like no tests ran 😔. We are not able to recognize it, please check workflow here.


Mon, 06 Jan 2025 04:09:50 UTC

Communication

Should the DevRel and Marketing teams inform users about this change?

  • Yes
  • No

Summary by CodeRabbit

  • Refactor

    • Consolidated and reorganized constants management across multiple classes.
    • Updated artifact handling to use ArtifactExchangeJson instead of ApplicationGitReference.
    • Simplified type parameters in Git-related utility classes and interfaces.
  • Chores

    • Updated import statements and type references in multiple server-side components.
    • Standardized constant definitions in a centralized location.

@nidhi-nair nidhi-nair requested a review from a team as a code owner January 3, 2025 10:11
Copy link
Contributor

coderabbitai bot commented Jan 3, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

This pull request involves a significant refactoring of constants and artifact handling in the Appsmith Git-related classes. The changes primarily focus on transitioning from ApplicationGitReference to ArtifactExchangeJson across multiple files, introducing a new CommonConstantsCE class, and modifying how constants are managed and inherited in the application's Git-related utilities.

Changes

File Change Summary
app/server/appsmith-git/src/main/java/com/appsmith/git/constants/CommonConstants.java Extends CommonConstantsCE, removing previous static fields.
app/server/appsmith-git/src/main/java/com/appsmith/git/constants/ce/CommonConstantsCE.java New class added with a comprehensive set of static constants.
app/server/appsmith-server/src/main/java/com/appsmith/server/applications/git/ApplicationGitFileUtilsCEImpl.java Updated generic type parameter from ApplicationGitReference to ApplicationJson.
app/server/appsmith-server/src/main/java/com/appsmith/server/applications/git/ApplicationGitFileUtilsImpl.java Updated generic type parameter from ApplicationGitReference to ApplicationJson.
app/server/appsmith-server/src/main/java/com/appsmith/server/helpers/ArtifactGitFileUtils.java Updated generic type parameter from ArtifactGitReference to ArtifactExchangeJson.
app/server/appsmith-server/src/main/java/com/appsmith/server/helpers/CommonGitFileUtils.java Updated constructor parameter type from ArtifactGitFileUtils<ApplicationGitReference> to ArtifactGitFileUtils<ApplicationJson>.
app/server/appsmith-server/src/main/java/com/appsmith/server/helpers/ce/ArtifactGitFileUtilsCE.java Updated generic type constraint from T extends ArtifactGitReference to T extends ArtifactExchangeJson.
app/server/appsmith-server/src/main/java/com/appsmith/server/helpers/ce/CommonGitFileUtilsCE.java Updated field and constructor parameter types from ArtifactGitFileUtils<ApplicationGitReference> to ArtifactGitFileUtils<ApplicationJson>.

Suggested labels

Git Product, Enhancement

Suggested reviewers

  • abhvsn
  • sharat87
  • AnaghHegde

Poem

🌟 Constants dance, a refactored delight,
Git's magic rewritten with type-safe might.
References shift, like leaves in the wind,
Code evolves, where new patterns begin! 🚀

Possibly related PRs

  • chore: CE split for git constants and AGF #38464: This PR involves significant modifications to the CommonConstants class, which now extends CommonConstantsCE, consolidating constants into a centralized location, directly related to the changes in the main PR regarding the CommonConstants class.
  • chore: Switching to ref types and names for git #38433: This PR introduces changes to the FSGitHandlerCEImpl class, specifically modifying how references are handled, which aligns with the changes in the main PR that also focus on the restructuring of constants and references.
  • chore: added git resource map consumption #38470: This PR adds a method for constructing a GitResourceMap from a Git repository, which relates to the overall enhancements in Git functionality that are a theme in the main PR's changes.
  • feat: added commit changes #37922: This PR focuses on switching the git commit and push method to a super service, which is relevant to the changes in the main PR that involve restructuring and enhancing Git-related functionalities.
  • chore: Set default reftype in git metadata #38455: This PR adds a method to set the default reference type in Git metadata, which is directly related to the changes in the main PR that involve handling references and constants in Git operations.

📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7c20bc2 and dd115a5.

📒 Files selected for processing (3)
  • app/server/appsmith-server/src/main/java/com/appsmith/server/applications/git/ApplicationGitFileUtilsCEImpl.java (1 hunks)
  • app/server/appsmith-server/src/main/java/com/appsmith/server/helpers/ce/ArtifactGitFileUtilsCE.java (1 hunks)
  • app/server/appsmith-server/src/main/java/com/appsmith/server/helpers/ce/CommonGitFileUtilsCE.java (3 hunks)

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?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@nidhi-nair nidhi-nair added the ok-to-test Required label for CI label Jan 3, 2025
@github-actions github-actions bot added the skip-changelog Adding this label to a PR prevents it from being listed in the changelog label Jan 3, 2025
Copy link
Contributor

@coderabbitai coderabbitai bot left a 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

🧹 Nitpick comments (1)
app/server/appsmith-git/src/main/java/com/appsmith/git/constants/ce/CommonConstantsCE.java (1)

1-38: Consider making fileFormatVersion a primitive and final.

If fileFormatVersion is not intended to change at runtime, marking it as public static final int rather than Integer improves clarity and prevents accidental reassignment.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1405aa6 and 44b63f9.

📒 Files selected for processing (8)
  • app/server/appsmith-git/src/main/java/com/appsmith/git/constants/CommonConstants.java (1 hunks)
  • app/server/appsmith-git/src/main/java/com/appsmith/git/constants/ce/CommonConstantsCE.java (1 hunks)
  • app/server/appsmith-server/src/main/java/com/appsmith/server/applications/git/ApplicationGitFileUtilsCEImpl.java (1 hunks)
  • app/server/appsmith-server/src/main/java/com/appsmith/server/applications/git/ApplicationGitFileUtilsImpl.java (2 hunks)
  • app/server/appsmith-server/src/main/java/com/appsmith/server/helpers/ArtifactGitFileUtils.java (1 hunks)
  • app/server/appsmith-server/src/main/java/com/appsmith/server/helpers/CommonGitFileUtils.java (2 hunks)
  • app/server/appsmith-server/src/main/java/com/appsmith/server/helpers/ce/ArtifactGitFileUtilsCE.java (1 hunks)
  • app/server/appsmith-server/src/main/java/com/appsmith/server/helpers/ce/CommonGitFileUtilsCE.java (2 hunks)
🔇 Additional comments (11)
app/server/appsmith-git/src/main/java/com/appsmith/git/constants/CommonConstants.java (1)

3-5: Inheritance approach looks fine.

Extending CommonConstantsCE centralizes all constants in one shared base class, which is consistent with the consolidation strategy.

app/server/appsmith-server/src/main/java/com/appsmith/server/helpers/ce/CommonGitFileUtilsCE.java (2)

87-87: Refactor to ArtifactExchangeJson
This protected field is now typed with ArtifactExchangeJson, aligning well with the broader refactoring effort. No immediate issues.


104-104: Constructor param type
The constructor now accepts ArtifactGitFileUtils<ArtifactExchangeJson> instead of ApplicationGitReference. Ensure all references and usage sites are updated.

✅ Verification successful

Constructor parameter change is correctly implemented

The change from ApplicationGitReference to ArtifactGitFileUtils<ArtifactExchangeJson> in the constructor is properly handled:

  • The constructor parameter is used correctly as a class field
  • The implementation class ApplicationGitFileUtilsCEImpl implements ArtifactGitFileUtilsCE<ArtifactExchangeJson> interface
  • All usages of the parameter are consistent with the new type
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check any references of 'CommonGitFileUtilsCE' constructor calls to confirm correct parameter usage
rg -A 3 "new\s+CommonGitFileUtilsCE\s*\("

Length of output: 43


Script:

#!/bin/bash
# Search for constructor calls using ast-grep for better accuracy
ast-grep --pattern 'new CommonGitFileUtilsCE($$$)'

# Also search for class definition and constructor to understand the parameters
ast-grep --pattern 'class CommonGitFileUtilsCE {
  $$$
  CommonGitFileUtilsCE($$$) {
    $$$
  }
  $$$
}'

# Search for any references to the class name
rg -l "CommonGitFileUtilsCE"

Length of output: 65962


Script:

#!/bin/bash
# Search for files containing CommonGitFileUtilsCE
rg -l "CommonGitFileUtilsCE"

# Search for constructor implementations with context
rg -A 5 "CommonGitFileUtilsCE\s*\([^)]*\)\s*\{" 

# Search for constructor calls with context
rg -A 5 "new\s+CommonGitFileUtilsCE\s*\("

Length of output: 426


Script:

#!/bin/bash
# Get the content of the files to understand the implementation and usage
cat app/server/appsmith-server/src/main/java/com/appsmith/server/helpers/ce/CommonGitFileUtilsCE.java

# Get the content of the implementation class
cat app/server/appsmith-server/src/main/java/com/appsmith/server/applications/git/ApplicationGitFileUtilsCEImpl.java

# Get the content of the non-CE class
cat app/server/appsmith-server/src/main/java/com/appsmith/server/helpers/CommonGitFileUtils.java

Length of output: 81046

app/server/appsmith-server/src/main/java/com/appsmith/server/helpers/ArtifactGitFileUtils.java (2)

3-3: New import for ArtifactExchangeJson
This import is part of the broader migration to ArtifactExchangeJson. No concerns.


6-6: Refactor to use ArtifactExchangeJson
Switching the generic type to ArtifactExchangeJson aligns with the new artifact model.

app/server/appsmith-server/src/main/java/com/appsmith/server/applications/git/ApplicationGitFileUtilsImpl.java (2)

5-5: Import for ArtifactExchangeJson
The import signals the transition to the new artifact structure.


15-15: Implements ArtifactGitFileUtils with the new type
Replacing ApplicationGitReference with ArtifactExchangeJson is consistent with the overall codebase changes.

app/server/appsmith-server/src/main/java/com/appsmith/server/helpers/ce/ArtifactGitFileUtilsCE.java (2)

12-12: Updated generic constraint
Switched from <T extends ArtifactGitReference> to <T extends ArtifactExchangeJson>, reflecting the new artifact approach.


14-14: Method return type mismatch
The method returns ArtifactGitReference although T extends ArtifactExchangeJson. Consider whether the return type should match ArtifactExchangeJson or remain ArtifactGitReference.

app/server/appsmith-server/src/main/java/com/appsmith/server/helpers/CommonGitFileUtils.java (2)

7-7: Import for ArtifactExchangeJson
This import is consistent with the refactoring to use ArtifactExchangeJson.


24-24: Constructor param signature
Aligning the constructor with ArtifactGitFileUtils<ArtifactExchangeJson> ensures consistency across the refactored code.

@@ -85,7 +85,7 @@
@Slf4j
@Component
@Import({FileUtilsImpl.class})
public class ApplicationGitFileUtilsCEImpl implements ArtifactGitFileUtilsCE<ApplicationGitReference> {
public class ApplicationGitFileUtilsCEImpl implements ArtifactGitFileUtilsCE<ArtifactExchangeJson> {
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Ensure method return types match the new generic parameter.

This class now implements ArtifactGitFileUtilsCE<ArtifactExchangeJson>, yet it still declares createArtifactReferenceObject() returning ApplicationGitReference. Revisit and align the return types/methods to prevent confusion or type mismatches.

@@ -12,7 +12,7 @@

@Component
public class ApplicationGitFileUtilsImpl extends ApplicationGitFileUtilsCEImpl
implements ArtifactGitFileUtils<ApplicationGitReference> {
implements ArtifactGitFileUtils<ArtifactExchangeJson> {
Copy link
Contributor

Choose a reason for hiding this comment

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

will have EE implications probably

@@ -102,7 +101,7 @@ public class CommonGitFileUtilsCE {
protected final ObjectMapper objectMapper;

public CommonGitFileUtilsCE(
ArtifactGitFileUtils<ApplicationGitReference> applicationGitFileUtils,
ArtifactGitFileUtils<ArtifactExchangeJson> applicationGitFileUtils,
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't this be applicationJson?

@@ -12,7 +12,7 @@

@Component
public class ApplicationGitFileUtilsImpl extends ApplicationGitFileUtilsCEImpl
implements ArtifactGitFileUtils<ApplicationGitReference> {
implements ArtifactGitFileUtils<ArtifactExchangeJson> {
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be ApplicationJson?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oops, yes

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (3)
app/server/appsmith-server/src/main/java/com/appsmith/server/helpers/ce/ArtifactGitFileUtilsCE.java (2)

16-18: Consider providing a more meaningful default implementation.

The default implementation returning null could lead to NPEs. Consider throwing UnsupportedOperationException or providing a more meaningful default.

-    default ArtifactGitReference createArtifactReferenceObject() {
-        return null;
-    }
+    default ArtifactGitReference createArtifactReferenceObject() {
+        throw new UnsupportedOperationException("Operation not supported by default");
+    }

29-30: Consider documenting the empty default implementation.

Empty default implementations should be documented to explain why no implementation is needed.

+    /**
+     * Default empty implementation for backward compatibility.
+     * Implementing classes can override if needed.
+     */
     default void addArtifactReferenceFromExportedJson(
         ArtifactExchangeJson artifactExchangeJson, ArtifactGitReference artifactGitReference) {}
app/server/appsmith-server/src/main/java/com/appsmith/server/helpers/ce/CommonGitFileUtilsCE.java (1)

124-124: Method visibility changed to protected.

The getArtifactBasedFileHelper method is now protected instead of private, allowing subclasses to override or access this method. This change suggests preparation for extensibility.

Consider documenting the intended use cases for subclasses that might need to override this method.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 44b63f9 and 17774f7.

📒 Files selected for processing (3)
  • app/server/appsmith-server/src/main/java/com/appsmith/server/helpers/CommonGitFileUtils.java (2 hunks)
  • app/server/appsmith-server/src/main/java/com/appsmith/server/helpers/ce/ArtifactGitFileUtilsCE.java (1 hunks)
  • app/server/appsmith-server/src/main/java/com/appsmith/server/helpers/ce/CommonGitFileUtilsCE.java (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • app/server/appsmith-server/src/main/java/com/appsmith/server/helpers/CommonGitFileUtils.java
🔇 Additional comments (5)
app/server/appsmith-server/src/main/java/com/appsmith/server/helpers/ce/ArtifactGitFileUtilsCE.java (3)

6-7: LGTM: Exception imports added for error handling.

The addition of AppsmithError and AppsmithException imports supports the new error handling in default methods.


24-27: LGTM: Appropriate error handling for unsupported operation.

The default implementation correctly throws an AppsmithException with UNSUPPORTED_OPERATION error.


14-14: Verify impact of generic type constraint change.

The interface's generic type constraint has been updated from ArtifactGitReference to ArtifactExchangeJson. This is a significant change that could affect implementing classes.

✅ Verification successful

Let me search for implementations and usages of these types to verify the impact of this change. The first command will help identify classes implementing the interface, while the second will show where these types are used in the codebase.


The generic type constraint change has been properly implemented across the codebase

The search results confirm that:

  1. The interface ArtifactGitFileUtilsCE has been updated to use ArtifactExchangeJson as its generic type constraint
  2. The only implementation ApplicationGitFileUtilsCEImpl correctly implements the interface with ArtifactExchangeJson
  3. All usages of the interface and implementation are consistent with this change

The change appears to be part of a larger refactoring to standardize on ArtifactExchangeJson as the base type for artifact exchange operations. No issues found.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Find all implementations of this interface to verify they've been updated
ast-grep --pattern 'class $_ implements $$$ArtifactGitFileUtilsCE<$_>$$$'

Length of output: 73130


Script:

#!/bin/bash
# Find all implementations of this interface
rg -l "implements.*ArtifactGitFileUtilsCE" 

# Find all references to ArtifactGitReference and ArtifactExchangeJson
rg "ArtifactGitReference|ArtifactExchangeJson"

Length of output: 69428

app/server/appsmith-server/src/main/java/com/appsmith/server/helpers/ce/CommonGitFileUtilsCE.java (2)

104-104: Constructor parameter type updated to match field type.

The constructor parameter type has been updated to maintain consistency with the field type change.


87-87: Verify the impact of type parameter change.

The field type has changed from ArtifactGitFileUtils<ApplicationGitReference> to ArtifactGitFileUtils<ApplicationJson>. This is a significant change that could affect Git operations.

✅ Verification successful

Let me verify the usage of ApplicationGitReference in the codebase to understand the impact of the type parameter change.


Type parameter change is safe to proceed

The change from ArtifactGitFileUtils<ApplicationGitReference> to ArtifactGitFileUtils<ApplicationJson> is consistent with the implementation. The ApplicationGitFileUtilsCEImpl and ApplicationGitFileUtilsImpl already use ArtifactExchangeJson as their type parameter, and ApplicationJson extends ArtifactExchangeJson. The change aligns the field type with its actual usage in the codebase.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check for any remaining references to ApplicationGitReference
rg "ApplicationGitReference" -A 3 -B 3

# Check for any classes extending or implementing ArtifactGitFileUtils
ast-grep --pattern 'class $_ implements ArtifactGitFileUtils<$_> {
  $$$
}'

Length of output: 63085


Script:

#!/bin/bash
# Check for any remaining references to ArtifactGitFileUtils
rg "ArtifactGitFileUtils" -A 3 -B 3

# Check for any classes implementing ArtifactGitReference
ast-grep --pattern 'class $_ implements ArtifactGitReference {
  $$$
}'

Length of output: 20048

sondermanish
sondermanish previously approved these changes Jan 3, 2025
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🔭 Outside diff range comments (1)
app/server/appsmith-server/src/main/java/com/appsmith/server/applications/git/ApplicationGitFileUtilsCEImpl.java (1)

Line range hint 132-140: Consider deprecating createArtifactReferenceObject()

Since the class now uses ApplicationJson as its type parameter, the createArtifactReferenceObject() method returning ApplicationGitReference seems out of place. Consider:

  1. Deprecating this method
  2. Updating callers to use createArtifactExchangeJsonObject()
  3. Planning for removal in a future release
🧹 Nitpick comments (2)
app/server/appsmith-server/src/main/java/com/appsmith/server/applications/git/ApplicationGitFileUtilsCEImpl.java (2)

Line range hint 142-236: Consider breaking down complex resource handling logic

The setArtifactDependentResources method is handling multiple concerns:

  • Application resource mapping
  • Metadata handling
  • Pages and widgets processing

Consider extracting these into separate private methods for better maintainability and testability.

Example structure:

 public void setArtifactDependentResources(...) {
     ApplicationJson applicationJson = (ApplicationJson) artifactExchangeJson;
     Map<GitResourceIdentity, Object> resourceMap = gitResourceMap.getGitResourceMap();
-    // application
-    Application application = applicationJson.getExportedApplication();
-    // ... current implementation
+    setApplicationResource(applicationJson, resourceMap);
+    setMetadataResource(applicationJson, resourceMap);
+    setPagesAndWidgetsResources(applicationJson, resourceMap);
 }

+private void setApplicationResource(ApplicationJson applicationJson, Map<GitResourceIdentity, Object> resourceMap) {
+    // Extract application handling logic
+}

Line range hint 676-684: Enhance error messages for JSON parsing failures

The error message for JSON parsing failures could be more descriptive to aid in debugging. Consider including more context such as the file path or specific parsing stage.

-                        page.getUnpublishedPage().getName(),
+                        String.format("Failed to parse DSL for page '%s'. Error: %s", 
+                            page.getUnpublishedPage().getName(),
+                            e.getMessage()),
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 17774f7 and 7c20bc2.

📒 Files selected for processing (2)
  • app/server/appsmith-server/src/main/java/com/appsmith/server/applications/git/ApplicationGitFileUtilsCEImpl.java (1 hunks)
  • app/server/appsmith-server/src/main/java/com/appsmith/server/applications/git/ApplicationGitFileUtilsImpl.java (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • app/server/appsmith-server/src/main/java/com/appsmith/server/applications/git/ApplicationGitFileUtilsImpl.java
🔇 Additional comments (1)
app/server/appsmith-server/src/main/java/com/appsmith/server/applications/git/ApplicationGitFileUtilsCEImpl.java (1)

88-88: Verify type parameter change impact across the codebase

The change from ApplicationGitReference to ApplicationJson as the type parameter is significant. While the implementation looks correct, we should verify all usages of this class to ensure they handle the new type parameter correctly.

✅ Verification successful

Let me check for any usage of this class as a dependency to ensure the type parameter change is handled correctly.


Let me check where this class is being used in the application context and verify the bean configuration.


Let me check one final aspect - the service layer implementations that might be using this utility.


Type parameter change is correctly implemented

The change from ApplicationGitReference to ApplicationJson is properly aligned with the interface hierarchy. The implementation correctly follows the contract where:

  • ArtifactGitFileUtilsCE<T extends ArtifactExchangeJson> is the base interface
  • ApplicationJson satisfies the bound ArtifactExchangeJson
  • Both ApplicationGitFileUtilsCEImpl and its subclass ApplicationGitFileUtilsImpl consistently use ApplicationJson
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for references to ApplicationGitFileUtilsCEImpl to verify type parameter usage
rg "ApplicationGitFileUtilsCEImpl" -A 2

Length of output: 1425


Script:

#!/bin/bash
# Search for bean definitions and dependency injections
rg -l "ApplicationGitFileUtils|@Autowired.*ApplicationGitFileUtils"

# Search for the interface definition to understand the contract
ast-grep --pattern 'interface ArtifactGitFileUtilsCE<$_> { $$$ }'

Length of output: 361


Script:

#!/bin/bash
# Search for configuration classes that might be setting up these beans
rg -l "@Configuration.*class" | xargs rg "ApplicationGitFileUtils" -A 3

# Check for any direct usage of this class in service layer
rg "ApplicationGitFileUtils.*applicationGitFileUtils" -A 2

Length of output: 2429


Script:

#!/bin/bash
# Search for service classes that might be using this utility
rg "@Service" -l | xargs rg "ApplicationGitFileUtils" -B 2 -A 2

# Check for the interface hierarchy
rg "interface.*ArtifactGitFileUtils" -A 2

Length of output: 752

@appsmithorg appsmithorg deleted a comment from github-actions bot Jan 3, 2025
Copy link

github-actions bot commented Jan 3, 2025

Failed server tests

  • com.appsmith.server.services.LayoutActionServiceTest#simpleOnPageLoadActionCreationTest

@nidhi-nair nidhi-nair merged commit 5b7bde7 into release Jan 6, 2025
5 of 7 checks passed
@nidhi-nair nidhi-nair deleted the chore/ce-split-agf branch January 6, 2025 04:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ok-to-test Required label for CI skip-changelog Adding this label to a PR prevents it from being listed in the changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants