-
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: making autocommit GA #36347
chore: making autocommit GA #36347
Conversation
WalkthroughThis pull request encompasses significant refactoring and removal of various classes and methods related to file operations and auto-commit functionality within a Git context. Key changes include the deletion of the Changes
Possibly related PRs
Suggested labels
Poem
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
|
@@ -290,51 +279,6 @@ private void removeCustomJsLibsEntries(JsonObject applicationObjectNode) { | |||
} | |||
} | |||
|
|||
@Test | |||
public void savedFile_reSavedWithDifferentSerialisationLogic_diffOccurs() |
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.
Should we instead change these tests for positives on auto-commits?
@Autowired | ||
JsonSchemaVersions jsonSchemaVersions; | ||
|
||
@Autowired | ||
JsonSchemaVersionsFallback jsonSchemaVersionsFallback; | ||
|
||
@Disabled |
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.
Deletion instead here?
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
Outside diff range and nitpick comments (1)
app/server/appsmith-server/src/test/java/com/appsmith/server/migrations/JsonSchemaVersionsTest.java (1)
Line range hint
29-33
: Let's give this test method a more accurate name!I noticed that you've updated the
getServerVersion_whenFeatureFlagIsOn_returnsIncremented
test method to directly compare the versions fromjsonSchemaVersions
andjsonSchemaVersionsFallback
, without any feature flag checks. That's like saying, "Let's skip the flag and get straight to the point!"However, the current test method name doesn't quite match the updated behavior. Consider renaming it to something like
getServerVersion_returnsExpectedValue
orgetServerVersion_matchesFallbackValue
to better reflect what the test is actually asserting.
Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files selected for processing (16)
- app/server/appsmith-git/src/main/java/com/appsmith/git/files/operations/FileOperationsCEImpl.java (0 hunks)
- app/server/appsmith-git/src/main/java/com/appsmith/git/files/operations/FileOperationsCEv2Impl.java (3 hunks)
- app/server/appsmith-git/src/main/java/com/appsmith/git/files/operations/FileOperationsImpl.java (1 hunks)
- app/server/appsmith-git/src/test/java/com/appsmith/git/helpers/FileUtilsImplTest.java (1 hunks)
- app/server/appsmith-interfaces/src/main/java/com/appsmith/external/git/operations/FileOperationsCE.java (0 hunks)
- app/server/appsmith-server/src/main/java/com/appsmith/server/git/autocommit/helpers/AutoCommitEligibilityHelperFallbackImpl.java (0 hunks)
- app/server/appsmith-server/src/main/java/com/appsmith/server/git/autocommit/helpers/AutoCommitEligibilityHelperImpl.java (1 hunks)
- app/server/appsmith-server/src/main/java/com/appsmith/server/git/autocommit/helpers/GitAutoCommitHelperFallbackImpl.java (0 hunks)
- app/server/appsmith-server/src/main/java/com/appsmith/server/git/autocommit/helpers/GitAutoCommitHelperImpl.java (1 hunks)
- app/server/appsmith-server/src/test/java/com/appsmith/server/git/ServerSchemaMigrationEnforcerTest.java (0 hunks)
- app/server/appsmith-server/src/test/java/com/appsmith/server/git/autocommit/AutoCommitEventHandlerImplTest.java (0 hunks)
- app/server/appsmith-server/src/test/java/com/appsmith/server/git/autocommit/AutoCommitServiceTest.java (0 hunks)
- app/server/appsmith-server/src/test/java/com/appsmith/server/git/autocommit/helpers/AutoCommitEligibilityHelperTest.java (0 hunks)
- app/server/appsmith-server/src/test/java/com/appsmith/server/git/autocommit/helpers/GitAutoCommitHelperImplTest.java (0 hunks)
- app/server/appsmith-server/src/test/java/com/appsmith/server/migrations/JsonSchemaMigrationTest.java (0 hunks)
- app/server/appsmith-server/src/test/java/com/appsmith/server/migrations/JsonSchemaVersionsTest.java (1 hunks)
Files not reviewed due to no reviewable changes (10)
- app/server/appsmith-git/src/main/java/com/appsmith/git/files/operations/FileOperationsCEImpl.java
- app/server/appsmith-interfaces/src/main/java/com/appsmith/external/git/operations/FileOperationsCE.java
- app/server/appsmith-server/src/main/java/com/appsmith/server/git/autocommit/helpers/AutoCommitEligibilityHelperFallbackImpl.java
- app/server/appsmith-server/src/main/java/com/appsmith/server/git/autocommit/helpers/GitAutoCommitHelperFallbackImpl.java
- app/server/appsmith-server/src/test/java/com/appsmith/server/git/ServerSchemaMigrationEnforcerTest.java
- app/server/appsmith-server/src/test/java/com/appsmith/server/git/autocommit/AutoCommitEventHandlerImplTest.java
- app/server/appsmith-server/src/test/java/com/appsmith/server/git/autocommit/AutoCommitServiceTest.java
- app/server/appsmith-server/src/test/java/com/appsmith/server/git/autocommit/helpers/AutoCommitEligibilityHelperTest.java
- app/server/appsmith-server/src/test/java/com/appsmith/server/git/autocommit/helpers/GitAutoCommitHelperImplTest.java
- app/server/appsmith-server/src/test/java/com/appsmith/server/migrations/JsonSchemaMigrationTest.java
Additional comments not posted (15)
app/server/appsmith-server/src/test/java/com/appsmith/server/migrations/JsonSchemaVersionsTest.java (2)
4-4
: Good job importing the@Disabled
annotation!The
@Disabled
annotation is a handy tool for temporarily disabling test methods or classes. It's like telling the test runner, "Hey, skip this one for now!" Keep up the great work!
21-21
: Let's double-check why we're disabling this test method.I see that you've used the
@Disabled
annotation to skip thegetServerVersion_whenFeatureFlagIsOff_returnsFallbackValue
test method. It's like telling the test, "Take a break, buddy!"However, it's important to understand the reason behind disabling tests. Can you please verify if this test method is no longer needed due to the removal of feature flag-related logic? If so, consider removing the test method altogether instead of leaving it disabled.
app/server/appsmith-server/src/main/java/com/appsmith/server/git/autocommit/helpers/AutoCommitEligibilityHelperImpl.java (1)
28-28
: Excellent work on refactoring the class to remove the fallback implementation! 🎉By directly implementing the
AutoCommitEligibilityHelper
interface without extendingAutoCommitEligibilityHelperFallbackImpl
, you've taken a step towards a more focused and maintainable implementation. This change suggests a shift in how the class handles its responsibilities, potentially leading to a more streamlined approach.However, it's important to consider the following:
- Ensure that the class no longer relies on any inherited methods or properties from the removed superclass.
- Reevaluate the class's functionality and interactions with other components to maintain proper behavior.
- Conduct thorough testing to verify that the class still functions as expected without the fallback implementation.
Keep up the great work in simplifying the codebase and improving maintainability! 👨🏫👩🏫
app/server/appsmith-git/src/test/java/com/appsmith/git/helpers/FileUtilsImplTest.java (1)
44-44
: Verify the impact of the constructor changes on the test behavior.Class, the constructor of
FileOperationsImpl
has been modified to remove parameters related togitServiceConfig
,gitExecutor
, andGsonBuilder
. Instead, it now acceptsnull
andObservationHelper.NOOP
as arguments.While this simplification might improve the readability and maintainability of the test code, it's crucial to ensure that the removed parameters were not critical for the test setup. Passing
null
andObservationHelper.NOOP
could potentially affect the behavior of the tests if those parameters were previously utilized.Please run the following script to verify the impact of the changes on the test behavior:
If the tests pass without any issues, the changes can be considered safe. However, if the tests fail or exhibit unexpected behavior, it might be necessary to revisit the constructor changes and ensure that the required dependencies are properly handled.
To improve the code further, consider adding comments explaining the rationale behind passing
null
andObservationHelper.NOOP
to the constructor. This will help future maintainers understand the purpose of these arguments and the impact of the changes.Verification successful
Class, it appears we've encountered a small hiccup in our verification process. The sandbox environment doesn't have Maven installed, so we'll need to take a different approach. Let's examine the codebase more closely using some static analysis techniques. Pay attention now, as we're going to run a few commands to gather more information:
These commands will help us understand how the
FileOperationsImpl
is being used in our tests and if there are any other similar changes. Let's see what we can learn from this, shall we?
Alright, class, let's review what we've learned from our code investigation! It appears that our changes to the
FileOperationsImpl
constructor are consistent throughout the codebase. This is excellent news!The constructor changes are verified and align with the codebase.
Let's break it down:
The
FileOperationsImpl
class in the main code now has a simplified constructor that takes two parameters:PrettyPrinter
andObservationHelper
. This is a good simplification, removing unnecessary dependencies.Our test file,
FileUtilsImplTest.java
, correctly uses this new constructor by passingnull
forPrettyPrinter
andObservationHelper.NOOP
forObservationHelper
.The removal of
gitServiceConfig
,gitExecutor
, andGsonBuilder
from the constructor is consistent and doesn't appear to cause any issues in the codebase.However, class, I have a small suggestion to improve our code:
- In the test file, we're passing
null
for thePrettyPrinter
. While this works, it might be beneficial to add a comment explaining why we're usingnull
here. This will help future students... I mean, developers, understand the reasoning behind this choice.Overall, great job on simplifying the code! The changes appear to be safe and improve the maintainability of our project. Keep up the good work!
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the impact of the constructor changes on the test behavior. # Test: Run the tests and check for any failures or errors. mvn test -Dtest=FileUtilsImplTestLength of output: 106
Script:
#!/bin/bash # Search for usage of FileOperationsImpl in test files echo "Searching for FileOperationsImpl usage in test files:" rg "new FileOperationsImpl\(" --type java --glob "*Test.java" -C 2 echo "\nChecking for similar constructor changes in FileOperationsImpl:" rg "FileOperationsImpl\([^)]*\)" --type java -C 2 echo "\nExamining the FileOperationsImpl class:" fd FileOperationsImpl.java --exec cat {}Length of output: 3570
app/server/appsmith-server/src/main/java/com/appsmith/server/git/autocommit/helpers/GitAutoCommitHelperImpl.java (1)
29-29
: Excellent work removing the@Primary
annotation!Removing this annotation aligns perfectly with the goal of making the autocommit feature generally available. It's clear you've put thought into streamlining the codebase. Keep up the great work!
app/server/appsmith-git/src/main/java/com/appsmith/git/files/operations/FileOperationsCEv2Impl.java (10)
Line range hint
64-72
: Excellent work simplifying the constructor!The refactored constructor streamlines the initialization process by removing unnecessary dependencies. The usage of
SerializationUtils.getBasicObjectMapper(prettyPrinter)
to initialize theobjectMapper
is a cleaner approach. Well done!
196-206
: Great job implementing thesaveResource
method!The method nicely encapsulates the logic for saving a resource to a file. It takes care of creating the necessary directories and handles any exceptions that may occur during the write operation. The boolean return value provides a clear indication of the operation's success. Keep up the good work!
215-229
: Excellent implementation of thescanAndDeleteFileForDeletedResources
method!The method efficiently scans the resource directory and deletes files that no longer have a corresponding valid resource. The use of
Files.walk
to stream the paths and the filtering logic to identify files to be deleted is well-structured. The error handling and logging ensure that any issues during the directory scan are properly captured. Great work!
238-252
: Great job implementing thescanAndDeleteDirectoryForDeletedResources
method!The method effectively scans the resource directory and deletes directories that no longer have a corresponding valid resource. The use of
Files.walk
with a depth of 1 ensures that only the immediate subdirectories are considered. The filtering logic correctly identifies the directories to be deleted, excluding the resource directory itself. The error handling and logging provide visibility into any issues that may occur during the directory scan. Well done!
259-268
: Excellent implementation of thedeleteDirectory
method!The method provides a convenient way to delete a directory and its contents. The check for the directory's existence before attempting to delete it is a good practice. The use of
FileUtils.deleteDirectory
from the Apache Commons IO library simplifies the deletion process and handles the recursive deletion of subdirectories and files. The error handling and logging ensure that any issues during the deletion are properly captured. Great work!
275-284
: Great job implementing thedeleteFile
method!The method provides a straightforward way to delete a file. The use of
Files.deleteIfExists
is a good choice as it avoids throwing an exception if the file doesn't exist. The error handling forDirectoryNotEmptyException
andIOException
ensures that any issues during the file deletion are properly logged. The specific error messages provide clarity on the nature of the problem. Well done!
292-305
: Excellent implementation of thereadFileAsString
method!The method provides a convenient way to read the content of a file as a plain text string. The use of
FileUtils.readFileToString
from the Apache Commons IO library simplifies the file reading process. The inclusion of observability usingobservationHelper.createSpan
is a good practice for monitoring and tracing. The error handling and logging ensure that any issues during the file read are properly captured. Returning an empty string in case of an error is a safe fallback. Great work!
307-328
: Great job implementing thedeleteIndexLockFile
method!The method provides a useful functionality to delete the index lock file if it's stale. The logic to check the creation time of the lock file against the specified valid time is well-implemented. Appending ".lock" to the file path before deletion ensures that the correct file is targeted. Returning a
Mono
with the time difference or 0 provides flexibility for reactive programming. The error handling and logging forIOException
ensure that any issues during the attribute reading are properly captured. Well done!
Line range hint
75-80
: Excellent refactoring of thesaveMetadataResource
method!The removal of the
@FeatureFlagged
annotation indicates that the feature is now always enabled, simplifying the code. Converting the metadata to anObjectNode
and adding theFILE_FORMAT_VERSION
ensures consistency. Calling thesaveResource
method to save the metadata resource promotes code reuse and maintainability. Great work!
Line range hint
83-98
: Good job updating thesaveWidgets
method!The removal of the
@FeatureFlagged
annotation indicates that the feature is now always enabled, simplifying the code. The rest of the method implementation remains unchanged, which is fine since it already handles the saving of widgets correctly. Keep up the good work!
public FileOperationsImpl(PrettyPrinter prettyPrinter, ObservationHelper observationHelper) { | ||
super(prettyPrinter, observationHelper); |
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
Alright, class! 📚 Let's review what we've learned from our code investigation. 🧑🏫
Pop quiz: Unnecessary import alert! 🚨
Our detective work has revealed that while we've successfully simplified our constructor, we've left behind a small clue that needs our attention. Can anyone spot it? That's right! The GitServiceConfig
import and @Import
annotation are still lingering in our FileOperationsImpl
class, even though they're no longer needed.
Let's clean up our code to make it sparkle! ✨ Here's your homework assignment:
- Remove the unnecessary import statement for
GitServiceConfig
. - Erase the
@Import({GitServiceConfig.class})
annotation from the class.
Remember, class, keeping our code clean and tidy is just as important as making it work! 🧹🧼
Now, for some good news! 🎉 The removal of GitExecutor
and GsonBuilder
from the constructor appears to have been a success. We couldn't find any traces of them in the parent class or other parts of the codebase. Great job on simplifying our dependencies!
However, we must always be thorough in our work. So, here's an extra credit assignment:
- Conduct comprehensive tests on the
FileOperationsImpl
class to ensure we haven't accidentally removed any important functionality.
Keep up the excellent work, students! You're all on your way to becoming top-notch code detectives! 🕵️♀️🕵️♂️
Analysis chain
Excellent work on refactoring the constructor to reduce dependencies! 👏
The changes to the constructor signature indicate a conscious effort to minimize the coupling between the FileOperationsImpl
class and other components. This is a step in the right direction towards improving the maintainability and testability of the codebase. 🎉
However, it's crucial to ensure that the removal of the GitServiceConfig
, GitExecutor
, and GsonBuilder
dependencies does not adversely impact the functionality of the class or introduce runtime exceptions. 🔍
To verify the impact of the dependency removal, please run the following script:
Please share the results of the verification script so that we can assess the impact of the changes and ensure that the class continues to function as expected. 📊
Keep up the great work! 🌟
Class, let's continue our investigation! 🧑🏫📚 We've made some interesting discoveries, but we need to dig a little deeper to fully understand the impact of our changes. Let's run another set of tests to gather more information.
Now, students, let's see what these new tests reveal about our code changes! 🔍🧐
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Verify the impact of the dependency removal on the class functionality and the codebase.
# Test 1: Search for the usage of the removed dependencies in the class. Expect: No occurrences.
rg --type java -A 5 $'GitServiceConfig|GitExecutor|GsonBuilder' app/server/appsmith-git/src/main/java/com/appsmith/git/files/operations/FileOperationsImpl.java
# Test 2: Search for the usage of the `FileOperationsImpl` constructor in the codebase. Expect: All occurrences to match the new signature.
rg --type java -A 5 $'new FileOperationsImpl' app/server/appsmith-git/
Length of output: 1551
Script:
#!/bin/bash
# Description: Further investigate the usage of GitServiceConfig and the impact of removed dependencies
# Test 1: Check for methods using GitServiceConfig in FileOperationsImpl
ast-grep --lang java --pattern 'class FileOperationsImpl {
$$$
$_(GitServiceConfig $_) {
$$$
}
$$$
}' app/server/appsmith-git/src/main/java/com/appsmith/git/files/operations/FileOperationsImpl.java
# Test 2: Search for GitExecutor and GsonBuilder usage in the parent class
rg --type java -A 5 'GitExecutor|GsonBuilder' app/server/appsmith-git/src/main/java/com/appsmith/git/files/operations/FileOperationsCEv2Impl.java
# Test 3: Check for other classes that might be affected by the changes
rg --type java -A 5 'extends FileOperationsCEv2Impl|implements FileOperations' app/server/appsmith-git/
Length of output: 2003
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.
Thanks for the extra clean up you've done wherever required. Could you please associate those tests to auto-commit where applicable instead of straight up removing them? We can templatize them at a later point and refactor, but we shouldn't get rid of the behaviour check entirely, especially in the abence of server enforcer.
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.
@sondermanish there's changes required on this PR, removing the review request for now.
There is an issue here. Autocommit is not coming up to be enabled by default |
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: 0
Outside diff range and nitpick comments (7)
app/server/appsmith-git/src/main/java/com/appsmith/git/files/operations/FileOperationsCEv2Impl.java (7)
193-203
: Great job implementing thesaveResource
method!The method has a clear purpose and is well-structured. It creates parent directories if they don't exist and calls
writeToFile
to write the object. The IOException is handled appropriately.Consider extracting the error logging logic to a separate method for better reusability. For example:
private void logError(String message, Path path, Exception e) { log.error(message, path, e.getMessage()); log.debug(e.getMessage()); }Then, you can call this method in the catch block:
} catch (IOException e) { logError("Error while writing resource to file {} with {}", path, e); }This way, you can reuse the error logging logic in other methods as well.
212-226
: Nicely done implementing thescanAndDeleteFileForDeletedResources
method!The method effectively scans the directory and deletes unwanted files using the
deleteFile
method. The IOException is handled appropriately.To avoid potential NullPointerException, consider adding a null check for the
validResources
set at the beginning of the method:public void scanAndDeleteFileForDeletedResources(Set<String> validResources, Path resourceDirectory) { if (validResources == null) { throw new IllegalArgumentException("validResources cannot be null"); } // rest of the method }This way, you can ensure that the
validResources
set is not null before using it in the filter condition.
235-249
: Well done implementing thescanAndDeleteDirectoryForDeletedResources
method!The method effectively scans the directory and deletes unwanted subdirectories using the
deleteDirectory
method. The IOException is handled appropriately.Similar to the previous suggestion, consider adding a null check for the
validResources
set at the beginning of the method:public void scanAndDeleteDirectoryForDeletedResources(Set<String> validResources, Path resourceDirectory) { if (validResources == null) { throw new IllegalArgumentException("validResources cannot be null"); } // rest of the method }This way, you can ensure that the
validResources
set is not null before using it in the filter condition.
256-265
: Good job implementing thedeleteDirectory
method!The method effectively deletes the directory and its contents using the
FileUtils.deleteDirectory
method from Apache Commons IO library. The IOException is handled appropriately.To avoid potential NullPointerException, consider adding a null check for the
directory
parameter at the beginning of the method:public void deleteDirectory(Path directory) { if (directory == null) { throw new IllegalArgumentException("directory cannot be null"); } // rest of the method }This way, you can ensure that the
directory
parameter is not null before using it.
272-281
: Nice implementation of thedeleteFile
method!The method effectively deletes the file using the
Files.deleteIfExists
method. It handles theDirectoryNotEmptyException
andIOException
appropriately and logs error messages.To avoid potential NullPointerException, consider adding a null check for the
filePath
parameter at the beginning of the method:public void deleteFile(Path filePath) { if (filePath == null) { throw new IllegalArgumentException("filePath cannot be null"); } // rest of the method }This way, you can ensure that the
filePath
parameter is not null before using it.
289-302
: Great work implementing thereadFileAsString
method!The method effectively reads the file content as a string using the
FileUtils.readFileToString
method from Apache Commons IO library. It handles the IOException appropriately and logs an error message.To avoid potential NullPointerException, consider adding a null check for the
filePath
parameter at the beginning of the method:public String readFileAsString(Path filePath) { if (filePath == null) { throw new IllegalArgumentException("filePath cannot be null"); } // rest of the method }This way, you can ensure that the
filePath
parameter is not null before using it.
304-325
: Excellent implementation of thedeleteIndexLockFile
method!The method effectively checks the file creation time and deletes the file if it's older than the specified time using the
deleteFile
method. It returns a Mono of the time difference in seconds if the file is deleted, or a Mono of 0 otherwise. The IOException is handled appropriately and an error message is logged.To improve readability, consider extracting the file path concatenation logic to a separate method. For example:
private Path getIndexLockFilePath(Path path) { return Paths.get(path + ".lock"); }Then, you can use this method in the
deleteIndexLockFile
method:Path lockFilePath = getIndexLockFilePath(path); deleteFile(lockFilePath);This way, the file path concatenation logic is encapsulated in a separate method, making the code more readable.
Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files selected for processing (4)
- app/server/appsmith-git/src/main/java/com/appsmith/git/files/operations/FileOperationsCEv2Impl.java (3 hunks)
- app/server/appsmith-git/src/main/java/com/appsmith/git/files/operations/FileOperationsImpl.java (1 hunks)
- app/server/appsmith-server/src/test/java/com/appsmith/server/git/ServerSchemaMigrationEnforcerTest.java (5 hunks)
- app/server/appsmith-server/src/test/java/com/appsmith/server/migrations/JsonSchemaVersionsTest.java (0 hunks)
Files not reviewed due to no reviewable changes (1)
- app/server/appsmith-server/src/test/java/com/appsmith/server/migrations/JsonSchemaVersionsTest.java
Files skipped from review as they are similar to previous changes (1)
- app/server/appsmith-git/src/main/java/com/appsmith/git/files/operations/FileOperationsImpl.java
Additional comments not posted (10)
app/server/appsmith-git/src/main/java/com/appsmith/git/files/operations/FileOperationsCEv2Impl.java (5)
Line range hint
61-69
: Excellent work simplifying the constructor!The removal of unused dependencies like
GitServiceConfig
,GitExecutor
, andGsonBuilder
streamlines the initialization process. The remaining dependenciesPrettyPrinter
andObservationHelper
are being utilized effectively.
Line range hint
72-77
: Nice refactoring of thesaveMetadataResource
method!The removal of the
@FeatureFlagged
annotation suggests that the feature is now always enabled, which simplifies the code.Calling the
saveResource
method is a good refactoring as it reuses the common functionality of saving a resource to a file.
Line range hint
80-97
: Good removal of the@FeatureFlagged
annotation from thesaveWidgets
method!The removal of the
@FeatureFlagged
annotation suggests that the feature is now always enabled, which simplifies the code.The rest of the method implementation remains the same, so no further changes are needed.
Line range hint
100-115
: Nice removal of the@FeatureFlagged
annotation from thewriteToFile
method!The removal of the
@FeatureFlagged
annotation suggests that the feature is now always enabled, which simplifies the code.The rest of the method implementation remains the same, so no further changes are needed.
Line range hint
124-141
: Good job removing the@FeatureFlagged
annotation from thereadFile
method!The removal of the
@FeatureFlagged
annotation suggests that the feature is now always enabled, which simplifies the code.The rest of the method implementation remains the same, so no further changes are needed.
app/server/appsmith-server/src/test/java/com/appsmith/server/git/ServerSchemaMigrationEnforcerTest.java (5)
43-43
: Good work! The import statement looks correct.The
ApplicationEventPublisher
import is necessary for the new test case.
123-125
: Excellent! The dependency injections are set up correctly.The new mocked and spied dependencies are properly annotated and will be useful for the new test case. Keep up the good work!
Also applies to: 128-133, 137-138, 141-144
Line range hint
294-294
: Past review comment resolved: The test case has been removed as suggested.The removal of the
savedFile_reSavedWithDifferentSerialisationLogic_diffOccurs
test case is appropriate since it is no longer relevant. The past review comment has been addressed satisfactorily.
399-452
: Fantastic work on adding the new test case!The
autocommitMigration_WhenServerVersionIsBehindDiffOccursAnd_CommitSuccess
test case is a valuable addition to the test suite. It thoroughly verifies the auto-commit functionality during server migration and ensures that commits are successful when the server version is behind.The test case is well-structured, properly sets up the test environment, mocks necessary dependencies, and makes clear assertions on the expected behavior. This enhances the overall test coverage and helps maintain the reliability of the auto-commit feature.
Great job on this test case! Keep up the excellent work in ensuring the robustness of our codebase.
454-467
: Nice work on adding thecreateEvent
helper method!The
createEvent
method is a great addition to the test class. It encapsulates the creation logic for theAutoCommitEvent
object and provides default values for the test case.By extracting this logic into a separate method, you have improved the code readability and maintainability. The method is properly scoped as private and returns the expected
AutoCommitEvent
object, making it easy to use in the test case.This is a good practice to follow when creating test data. Keep up the great work in writing clean and maintainable test code!
/build-deploy-preview skip-tests=true |
Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/10939532673. |
Deploy-Preview-URL: https://ce-36347.dp.appsmith.com |
## Description - Removal of release_git_autocommit_feature_enabled flag - Removal of fallback implementation to classes which was autocommit flag annotated - Removal of irrelevant test cases post removal of fallback implementation. 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" ### 🔍 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/10994151881> > Commit: 42b43f1 > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=10994151881&attempt=1" target="_blank">Cypress dashboard</a>. > Tags: `@tag.Git` > Spec: > <hr>Mon, 23 Sep 2024 12:53:01 UTC <!-- end of auto-generated comment: Cypress test results --> ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [ ] No <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Enhanced file operations for resource management in Git, including methods for saving, deleting, and reading resources. - Streamlined handling of auto-commit functionalities, making certain features universally accessible. - **Bug Fixes** - Removed outdated fallback implementations for auto-commit eligibility and Git auto-commit helpers. - **Refactor** - Simplified constructors and dependencies in file operation classes, improving maintainability. - Eliminated feature flag dependencies from various components, including tests, focusing on core functionality. - **Tests** - Removed tests related to feature flags, streamlining the testing process for auto-commit and migration functionalities. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: brayn003 <rudra@appsmith.com>
Description
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"
🔍 Cypress test results
Tip
🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/10994151881
Commit: 42b43f1
Cypress dashboard.
Tags:
@tag.Git
Spec:
Mon, 23 Sep 2024 12:53:01 UTC
Communication
Should the DevRel and Marketing teams inform users about this change?
Summary by CodeRabbit
New Features
Bug Fixes
Refactor
Tests