diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/helpers/ce/autocommit/AutoCommitTriggerDTO.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/dtos/AutoCommitTriggerDTO.java similarity index 86% rename from app/server/appsmith-server/src/main/java/com/appsmith/server/helpers/ce/autocommit/AutoCommitTriggerDTO.java rename to app/server/appsmith-server/src/main/java/com/appsmith/server/dtos/AutoCommitTriggerDTO.java index 76bdc6fdf3a5..225a57d49de1 100644 --- a/app/server/appsmith-server/src/main/java/com/appsmith/server/helpers/ce/autocommit/AutoCommitTriggerDTO.java +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/dtos/AutoCommitTriggerDTO.java @@ -1,4 +1,4 @@ -package com.appsmith.server.helpers.ce.autocommit; +package com.appsmith.server.dtos; import lombok.AllArgsConstructor; import lombok.Data; diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/git/AutoCommitEventHandler.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/git/AutoCommitEventHandler.java new file mode 100644 index 000000000000..88e294a214ca --- /dev/null +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/git/AutoCommitEventHandler.java @@ -0,0 +1,3 @@ +package com.appsmith.server.git; + +public interface AutoCommitEventHandler extends AutoCommitEventHandlerCE {} diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/solutions/ce/AutoCommitEventHandlerCE.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/git/AutoCommitEventHandlerCE.java similarity index 90% rename from app/server/appsmith-server/src/main/java/com/appsmith/server/solutions/ce/AutoCommitEventHandlerCE.java rename to app/server/appsmith-server/src/main/java/com/appsmith/server/git/AutoCommitEventHandlerCE.java index 07da53f8bcb3..177233f5711a 100644 --- a/app/server/appsmith-server/src/main/java/com/appsmith/server/solutions/ce/AutoCommitEventHandlerCE.java +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/git/AutoCommitEventHandlerCE.java @@ -1,4 +1,4 @@ -package com.appsmith.server.solutions.ce; +package com.appsmith.server.git; import com.appsmith.server.events.AutoCommitEvent; import reactor.core.publisher.Mono; diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/solutions/ce/AutoCommitEventHandlerCEImpl.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/git/AutoCommitEventHandlerCEImpl.java similarity index 99% rename from app/server/appsmith-server/src/main/java/com/appsmith/server/solutions/ce/AutoCommitEventHandlerCEImpl.java rename to app/server/appsmith-server/src/main/java/com/appsmith/server/git/AutoCommitEventHandlerCEImpl.java index 764fcbfa6de8..2bb52698ac40 100644 --- a/app/server/appsmith-server/src/main/java/com/appsmith/server/solutions/ce/AutoCommitEventHandlerCEImpl.java +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/git/AutoCommitEventHandlerCEImpl.java @@ -1,4 +1,4 @@ -package com.appsmith.server.solutions.ce; +package com.appsmith.server.git; import com.appsmith.external.constants.AnalyticsEvents; import com.appsmith.external.dtos.ModifiedResources; diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/solutions/AutoCommitEventHandlerImpl.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/git/AutoCommitEventHandlerImpl.java similarity index 92% rename from app/server/appsmith-server/src/main/java/com/appsmith/server/solutions/AutoCommitEventHandlerImpl.java rename to app/server/appsmith-server/src/main/java/com/appsmith/server/git/AutoCommitEventHandlerImpl.java index 006e15a60609..b15d9f8dfc3c 100644 --- a/app/server/appsmith-server/src/main/java/com/appsmith/server/solutions/AutoCommitEventHandlerImpl.java +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/git/AutoCommitEventHandlerImpl.java @@ -1,4 +1,4 @@ -package com.appsmith.server.solutions; +package com.appsmith.server.git; import com.appsmith.external.git.GitExecutor; import com.appsmith.server.configurations.ProjectProperties; @@ -7,7 +7,6 @@ import com.appsmith.server.helpers.GitFileUtils; import com.appsmith.server.helpers.RedisUtils; import com.appsmith.server.services.AnalyticsService; -import com.appsmith.server.solutions.ce.AutoCommitEventHandlerCEImpl; import org.springframework.context.ApplicationEventPublisher; import org.springframework.stereotype.Component; diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/git/GitRedisUtils.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/git/GitRedisUtils.java index 7bd9ce122426..b218de16996f 100644 --- a/app/server/appsmith-server/src/main/java/com/appsmith/server/git/GitRedisUtils.java +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/git/GitRedisUtils.java @@ -17,17 +17,19 @@ public class GitRedisUtils { private final RedisUtils redisUtils; - public Mono addFileLock(String defaultApplicationId) { + public Mono addFileLock(String defaultApplicationId, Boolean isRetryAllowed) { + long numberOfRetries = Boolean.TRUE.equals(isRetryAllowed) ? MAX_RETRIES : 0L; + return redisUtils .addFileLock(defaultApplicationId) - .retryWhen(Retry.fixedDelay(MAX_RETRIES, RETRY_DELAY) + .retryWhen(Retry.fixedDelay(numberOfRetries, RETRY_DELAY) .onRetryExhaustedThrow((retryBackoffSpec, retrySignal) -> { throw new AppsmithException(AppsmithError.GIT_FILE_IN_USE); })); } - public Mono addFileLockWithoutRetry(String defaultApplicationId) { - return redisUtils.addFileLock(defaultApplicationId); + public Mono addFileLock(String defaultApplicationId) { + return addFileLock(defaultApplicationId, Boolean.TRUE); } public Mono releaseFileLock(String defaultApplicationId) { diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/helpers/ce/autocommit/AutoCommitEligibilityHelper.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/git/autocommit/helpers/AutoCommitEligibilityHelper.java similarity index 82% rename from app/server/appsmith-server/src/main/java/com/appsmith/server/helpers/ce/autocommit/AutoCommitEligibilityHelper.java rename to app/server/appsmith-server/src/main/java/com/appsmith/server/git/autocommit/helpers/AutoCommitEligibilityHelper.java index 4e538fe1b279..0174ba43b972 100644 --- a/app/server/appsmith-server/src/main/java/com/appsmith/server/helpers/ce/autocommit/AutoCommitEligibilityHelper.java +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/git/autocommit/helpers/AutoCommitEligibilityHelper.java @@ -1,6 +1,7 @@ -package com.appsmith.server.helpers.ce.autocommit; +package com.appsmith.server.git.autocommit.helpers; import com.appsmith.server.domains.GitArtifactMetadata; +import com.appsmith.server.dtos.AutoCommitTriggerDTO; import com.appsmith.server.dtos.PageDTO; import reactor.core.publisher.Mono; diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/helpers/ce/autocommit/AutoCommitEligibilityHelperFallbackImpl.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/git/autocommit/helpers/AutoCommitEligibilityHelperFallbackImpl.java similarity index 89% rename from app/server/appsmith-server/src/main/java/com/appsmith/server/helpers/ce/autocommit/AutoCommitEligibilityHelperFallbackImpl.java rename to app/server/appsmith-server/src/main/java/com/appsmith/server/git/autocommit/helpers/AutoCommitEligibilityHelperFallbackImpl.java index 9f408609d921..aa065319c28a 100644 --- a/app/server/appsmith-server/src/main/java/com/appsmith/server/helpers/ce/autocommit/AutoCommitEligibilityHelperFallbackImpl.java +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/git/autocommit/helpers/AutoCommitEligibilityHelperFallbackImpl.java @@ -1,6 +1,7 @@ -package com.appsmith.server.helpers.ce.autocommit; +package com.appsmith.server.git.autocommit.helpers; import com.appsmith.server.domains.GitArtifactMetadata; +import com.appsmith.server.dtos.AutoCommitTriggerDTO; import com.appsmith.server.dtos.PageDTO; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Component; diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/helpers/ce/autocommit/AutoCommitEligibilityHelperImpl.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/git/autocommit/helpers/AutoCommitEligibilityHelperImpl.java similarity index 96% rename from app/server/appsmith-server/src/main/java/com/appsmith/server/helpers/ce/autocommit/AutoCommitEligibilityHelperImpl.java rename to app/server/appsmith-server/src/main/java/com/appsmith/server/git/autocommit/helpers/AutoCommitEligibilityHelperImpl.java index f75d25ef5ba2..ec805da90cd8 100644 --- a/app/server/appsmith-server/src/main/java/com/appsmith/server/helpers/ce/autocommit/AutoCommitEligibilityHelperImpl.java +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/git/autocommit/helpers/AutoCommitEligibilityHelperImpl.java @@ -1,10 +1,11 @@ -package com.appsmith.server.helpers.ce.autocommit; +package com.appsmith.server.git.autocommit.helpers; import com.appsmith.external.annotations.FeatureFlagged; import com.appsmith.external.enums.FeatureFlagEnum; import com.appsmith.server.constants.ArtifactType; import com.appsmith.server.domains.GitArtifactMetadata; import com.appsmith.server.domains.Layout; +import com.appsmith.server.dtos.AutoCommitTriggerDTO; import com.appsmith.server.dtos.PageDTO; import com.appsmith.server.git.GitRedisUtils; import com.appsmith.server.helpers.CommonGitFileUtils; @@ -54,7 +55,7 @@ public Mono isServerAutoCommitRequired(String workspaceId, GitArtifactM .defaultIfEmpty(FALSE) .cache(); - return Mono.defer(() -> gitRedisUtils.addFileLockWithoutRetry(defaultApplicationId)) + return Mono.defer(() -> gitRedisUtils.addFileLock(defaultApplicationId, FALSE)) .then(Mono.defer(() -> isServerMigrationRequiredMonoCached)) .then(Mono.defer(() -> gitRedisUtils.releaseFileLock(defaultApplicationId))) .then(Mono.defer(() -> isServerMigrationRequiredMonoCached)) diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/helpers/ce/autocommit/GitAutoCommitHelper.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/git/autocommit/helpers/GitAutoCommitHelper.java similarity index 83% rename from app/server/appsmith-server/src/main/java/com/appsmith/server/helpers/ce/autocommit/GitAutoCommitHelper.java rename to app/server/appsmith-server/src/main/java/com/appsmith/server/git/autocommit/helpers/GitAutoCommitHelper.java index 85097b30a896..be02072ba49e 100644 --- a/app/server/appsmith-server/src/main/java/com/appsmith/server/helpers/ce/autocommit/GitAutoCommitHelper.java +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/git/autocommit/helpers/GitAutoCommitHelper.java @@ -1,6 +1,7 @@ -package com.appsmith.server.helpers.ce.autocommit; +package com.appsmith.server.git.autocommit.helpers; import com.appsmith.server.dtos.AutoCommitProgressDTO; +import com.appsmith.server.dtos.AutoCommitTriggerDTO; import reactor.core.publisher.Mono; public interface GitAutoCommitHelper { diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/helpers/ce/autocommit/GitAutoCommitHelperFallbackImpl.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/git/autocommit/helpers/GitAutoCommitHelperFallbackImpl.java similarity index 89% rename from app/server/appsmith-server/src/main/java/com/appsmith/server/helpers/ce/autocommit/GitAutoCommitHelperFallbackImpl.java rename to app/server/appsmith-server/src/main/java/com/appsmith/server/git/autocommit/helpers/GitAutoCommitHelperFallbackImpl.java index 4d3a91b3e1b6..6ab392811896 100644 --- a/app/server/appsmith-server/src/main/java/com/appsmith/server/helpers/ce/autocommit/GitAutoCommitHelperFallbackImpl.java +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/git/autocommit/helpers/GitAutoCommitHelperFallbackImpl.java @@ -1,6 +1,7 @@ -package com.appsmith.server.helpers.ce.autocommit; +package com.appsmith.server.git.autocommit.helpers; import com.appsmith.server.dtos.AutoCommitProgressDTO; +import com.appsmith.server.dtos.AutoCommitTriggerDTO; import org.springframework.stereotype.Component; import reactor.core.publisher.Mono; diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/helpers/ce/autocommit/GitAutoCommitHelperImpl.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/git/autocommit/helpers/GitAutoCommitHelperImpl.java similarity index 98% rename from app/server/appsmith-server/src/main/java/com/appsmith/server/helpers/ce/autocommit/GitAutoCommitHelperImpl.java rename to app/server/appsmith-server/src/main/java/com/appsmith/server/git/autocommit/helpers/GitAutoCommitHelperImpl.java index aded5bcc1553..ecedb20d287e 100644 --- a/app/server/appsmith-server/src/main/java/com/appsmith/server/helpers/ce/autocommit/GitAutoCommitHelperImpl.java +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/git/autocommit/helpers/GitAutoCommitHelperImpl.java @@ -1,4 +1,4 @@ -package com.appsmith.server.helpers.ce.autocommit; +package com.appsmith.server.git.autocommit.helpers; import com.appsmith.external.annotations.FeatureFlagged; import com.appsmith.external.enums.FeatureFlagEnum; @@ -7,14 +7,15 @@ import com.appsmith.server.domains.GitArtifactMetadata; import com.appsmith.server.domains.GitProfile; import com.appsmith.server.dtos.AutoCommitProgressDTO; +import com.appsmith.server.dtos.AutoCommitTriggerDTO; import com.appsmith.server.events.AutoCommitEvent; +import com.appsmith.server.git.AutoCommitEventHandler; import com.appsmith.server.helpers.GitPrivateRepoHelper; import com.appsmith.server.helpers.GitUtils; import com.appsmith.server.helpers.RedisUtils; import com.appsmith.server.services.CommonGitService; import com.appsmith.server.services.UserDataService; import com.appsmith.server.solutions.ApplicationPermission; -import com.appsmith.server.solutions.AutoCommitEventHandler; import lombok.extern.slf4j.Slf4j; import org.springframework.context.annotation.Lazy; import org.springframework.context.annotation.Primary; diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/services/ApplicationPageServiceImpl.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/services/ApplicationPageServiceImpl.java index 4454c7bfd001..8233830d0c42 100644 --- a/app/server/appsmith-server/src/main/java/com/appsmith/server/services/ApplicationPageServiceImpl.java +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/services/ApplicationPageServiceImpl.java @@ -6,11 +6,11 @@ import com.appsmith.server.clonepage.ClonePageService; import com.appsmith.server.domains.ActionCollection; import com.appsmith.server.domains.NewAction; +import com.appsmith.server.git.autocommit.helpers.AutoCommitEligibilityHelper; +import com.appsmith.server.git.autocommit.helpers.GitAutoCommitHelper; import com.appsmith.server.helpers.DSLMigrationUtils; import com.appsmith.server.helpers.GitFileUtils; import com.appsmith.server.helpers.ResponseUtils; -import com.appsmith.server.helpers.ce.autocommit.AutoCommitEligibilityHelper; -import com.appsmith.server.helpers.ce.autocommit.GitAutoCommitHelper; import com.appsmith.server.layouts.UpdateLayoutService; import com.appsmith.server.newactions.base.NewActionService; import com.appsmith.server.newpages.base.NewPageService; diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/services/CommonGitServiceImpl.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/services/CommonGitServiceImpl.java index 447fcdb56091..479a2b3e3c1c 100644 --- a/app/server/appsmith-server/src/main/java/com/appsmith/server/services/CommonGitServiceImpl.java +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/services/CommonGitServiceImpl.java @@ -5,10 +5,10 @@ import com.appsmith.server.configurations.EmailConfig; import com.appsmith.server.domains.Application; import com.appsmith.server.exports.internal.ExportService; +import com.appsmith.server.git.autocommit.helpers.GitAutoCommitHelper; import com.appsmith.server.helpers.CommonGitFileUtils; import com.appsmith.server.helpers.GitPrivateRepoHelper; import com.appsmith.server.helpers.RedisUtils; -import com.appsmith.server.helpers.ce.autocommit.GitAutoCommitHelper; import com.appsmith.server.imports.internal.ImportService; import com.appsmith.server.repositories.GitDeployKeysRepository; import com.appsmith.server.services.ce_compatible.CommonGitServiceCECompatibleImpl; diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/services/GitServiceImpl.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/services/GitServiceImpl.java index bb758f934198..4670f4f11f27 100644 --- a/app/server/appsmith-server/src/main/java/com/appsmith/server/services/GitServiceImpl.java +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/services/GitServiceImpl.java @@ -7,11 +7,11 @@ import com.appsmith.server.configurations.EmailConfig; import com.appsmith.server.datasources.base.DatasourceService; import com.appsmith.server.exports.internal.ExportService; +import com.appsmith.server.git.autocommit.helpers.GitAutoCommitHelper; import com.appsmith.server.helpers.GitFileUtils; import com.appsmith.server.helpers.GitPrivateRepoHelper; import com.appsmith.server.helpers.RedisUtils; import com.appsmith.server.helpers.ResponseUtils; -import com.appsmith.server.helpers.ce.autocommit.GitAutoCommitHelper; import com.appsmith.server.imports.internal.ImportService; import com.appsmith.server.newactions.base.NewActionService; import com.appsmith.server.newpages.base.NewPageService; diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/ApplicationPageServiceCEImpl.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/ApplicationPageServiceCEImpl.java index 00b804a90765..0d53f9c8e564 100644 --- a/app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/ApplicationPageServiceCEImpl.java +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/ApplicationPageServiceCEImpl.java @@ -34,14 +34,14 @@ import com.appsmith.server.dtos.PluginTypeAndCountDTO; import com.appsmith.server.exceptions.AppsmithError; import com.appsmith.server.exceptions.AppsmithException; +import com.appsmith.server.git.autocommit.helpers.AutoCommitEligibilityHelper; +import com.appsmith.server.git.autocommit.helpers.GitAutoCommitHelper; import com.appsmith.server.helpers.CollectionUtils; import com.appsmith.server.helpers.DSLMigrationUtils; import com.appsmith.server.helpers.GitFileUtils; import com.appsmith.server.helpers.GitUtils; import com.appsmith.server.helpers.ResponseUtils; import com.appsmith.server.helpers.UserPermissionUtils; -import com.appsmith.server.helpers.ce.autocommit.AutoCommitEligibilityHelper; -import com.appsmith.server.helpers.ce.autocommit.GitAutoCommitHelper; import com.appsmith.server.layouts.UpdateLayoutService; import com.appsmith.server.migrations.ApplicationVersion; import com.appsmith.server.newactions.base.NewActionService; diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/CommonGitServiceCEImpl.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/CommonGitServiceCEImpl.java index 11add1027d34..c45b7566c59e 100644 --- a/app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/CommonGitServiceCEImpl.java +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/CommonGitServiceCEImpl.java @@ -35,13 +35,13 @@ import com.appsmith.server.exceptions.AppsmithError; import com.appsmith.server.exceptions.AppsmithException; import com.appsmith.server.exports.internal.ExportService; +import com.appsmith.server.git.autocommit.helpers.GitAutoCommitHelper; import com.appsmith.server.helpers.CollectionUtils; import com.appsmith.server.helpers.CommonGitFileUtils; import com.appsmith.server.helpers.GitDeployKeyGenerator; import com.appsmith.server.helpers.GitPrivateRepoHelper; import com.appsmith.server.helpers.GitUtils; import com.appsmith.server.helpers.RedisUtils; -import com.appsmith.server.helpers.ce.autocommit.GitAutoCommitHelper; import com.appsmith.server.imports.internal.ImportService; import com.appsmith.server.repositories.GitDeployKeysRepository; import com.appsmith.server.services.AnalyticsService; diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/GitServiceCEImpl.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/GitServiceCEImpl.java index c9ac82a704d8..e18fa5108ddf 100644 --- a/app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/GitServiceCEImpl.java +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/GitServiceCEImpl.java @@ -43,6 +43,7 @@ import com.appsmith.server.exceptions.AppsmithError; import com.appsmith.server.exceptions.AppsmithException; import com.appsmith.server.exports.internal.ExportService; +import com.appsmith.server.git.autocommit.helpers.GitAutoCommitHelper; import com.appsmith.server.helpers.CollectionUtils; import com.appsmith.server.helpers.GitDeployKeyGenerator; import com.appsmith.server.helpers.GitFileUtils; @@ -50,7 +51,6 @@ import com.appsmith.server.helpers.GitUtils; import com.appsmith.server.helpers.RedisUtils; import com.appsmith.server.helpers.ResponseUtils; -import com.appsmith.server.helpers.ce.autocommit.GitAutoCommitHelper; import com.appsmith.server.imports.internal.ImportService; import com.appsmith.server.migrations.JsonSchemaVersions; import com.appsmith.server.newactions.base.NewActionService; diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce_compatible/CommonGitServiceCECompatibleImpl.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce_compatible/CommonGitServiceCECompatibleImpl.java index bc073db5922a..9a55760d6405 100644 --- a/app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce_compatible/CommonGitServiceCECompatibleImpl.java +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce_compatible/CommonGitServiceCECompatibleImpl.java @@ -4,10 +4,10 @@ import com.appsmith.server.configurations.EmailConfig; import com.appsmith.server.domains.Application; import com.appsmith.server.exports.internal.ExportService; +import com.appsmith.server.git.autocommit.helpers.GitAutoCommitHelper; import com.appsmith.server.helpers.CommonGitFileUtils; import com.appsmith.server.helpers.GitPrivateRepoHelper; import com.appsmith.server.helpers.RedisUtils; -import com.appsmith.server.helpers.ce.autocommit.GitAutoCommitHelper; import com.appsmith.server.imports.internal.ImportService; import com.appsmith.server.repositories.GitDeployKeysRepository; import com.appsmith.server.services.AnalyticsService; diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce_compatible/GitServiceCECompatibleImpl.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce_compatible/GitServiceCECompatibleImpl.java index 10bd0e19aea7..cf4240ab11ce 100644 --- a/app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce_compatible/GitServiceCECompatibleImpl.java +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce_compatible/GitServiceCECompatibleImpl.java @@ -6,11 +6,11 @@ import com.appsmith.server.configurations.EmailConfig; import com.appsmith.server.datasources.base.DatasourceService; import com.appsmith.server.exports.internal.ExportService; +import com.appsmith.server.git.autocommit.helpers.GitAutoCommitHelper; import com.appsmith.server.helpers.GitFileUtils; import com.appsmith.server.helpers.GitPrivateRepoHelper; import com.appsmith.server.helpers.RedisUtils; import com.appsmith.server.helpers.ResponseUtils; -import com.appsmith.server.helpers.ce.autocommit.GitAutoCommitHelper; import com.appsmith.server.imports.internal.ImportService; import com.appsmith.server.newactions.base.NewActionService; import com.appsmith.server.newpages.base.NewPageService; diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/solutions/AutoCommitEventHandler.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/solutions/AutoCommitEventHandler.java deleted file mode 100644 index 2f8d4e0e3086..000000000000 --- a/app/server/appsmith-server/src/main/java/com/appsmith/server/solutions/AutoCommitEventHandler.java +++ /dev/null @@ -1,5 +0,0 @@ -package com.appsmith.server.solutions; - -import com.appsmith.server.solutions.ce.AutoCommitEventHandlerCE; - -public interface AutoCommitEventHandler extends AutoCommitEventHandlerCE {} diff --git a/app/server/appsmith-server/src/test/java/com/appsmith/server/git/autocommit/ApplicationPageServiceAutoCommitTest.java b/app/server/appsmith-server/src/test/java/com/appsmith/server/git/autocommit/ApplicationPageServiceAutoCommitTest.java index 316a041f1422..88652ece3d0e 100644 --- a/app/server/appsmith-server/src/test/java/com/appsmith/server/git/autocommit/ApplicationPageServiceAutoCommitTest.java +++ b/app/server/appsmith-server/src/test/java/com/appsmith/server/git/autocommit/ApplicationPageServiceAutoCommitTest.java @@ -15,11 +15,11 @@ import com.appsmith.server.domains.Layout; import com.appsmith.server.domains.NewPage; import com.appsmith.server.dtos.ApplicationJson; +import com.appsmith.server.dtos.AutoCommitTriggerDTO; import com.appsmith.server.dtos.PageDTO; +import com.appsmith.server.git.autocommit.helpers.AutoCommitEligibilityHelper; import com.appsmith.server.helpers.DSLMigrationUtils; import com.appsmith.server.helpers.GitPrivateRepoHelper; -import com.appsmith.server.helpers.ce.autocommit.AutoCommitEligibilityHelper; -import com.appsmith.server.helpers.ce.autocommit.AutoCommitTriggerDTO; import com.appsmith.server.migrations.JsonSchemaMigration; import com.appsmith.server.migrations.JsonSchemaVersions; import com.appsmith.server.newpages.base.NewPageService; @@ -55,7 +55,7 @@ import java.util.Set; import java.util.stream.Collectors; -import static com.appsmith.server.solutions.ce.AutoCommitEventHandlerCEImpl.AUTO_COMMIT_MSG_FORMAT; +import static com.appsmith.server.git.AutoCommitEventHandlerCEImpl.AUTO_COMMIT_MSG_FORMAT; import static java.lang.Boolean.FALSE; import static java.lang.Boolean.TRUE; import static org.assertj.core.api.Assertions.assertThat; diff --git a/app/server/appsmith-server/src/test/java/com/appsmith/server/git/autocommit/AutoCommitEventHandlerImplTest.java b/app/server/appsmith-server/src/test/java/com/appsmith/server/git/autocommit/AutoCommitEventHandlerImplTest.java index 7deb719df24b..2e8851d7c891 100644 --- a/app/server/appsmith-server/src/test/java/com/appsmith/server/git/autocommit/AutoCommitEventHandlerImplTest.java +++ b/app/server/appsmith-server/src/test/java/com/appsmith/server/git/autocommit/AutoCommitEventHandlerImplTest.java @@ -14,6 +14,8 @@ import com.appsmith.server.dtos.PageDTO; import com.appsmith.server.events.AutoCommitEvent; import com.appsmith.server.featureflags.CachedFeatures; +import com.appsmith.server.git.AutoCommitEventHandler; +import com.appsmith.server.git.AutoCommitEventHandlerImpl; import com.appsmith.server.helpers.CommonGitFileUtils; import com.appsmith.server.helpers.DSLMigrationUtils; import com.appsmith.server.helpers.GitFileUtils; @@ -22,8 +24,6 @@ import com.appsmith.server.migrations.JsonSchemaVersions; import com.appsmith.server.services.AnalyticsService; import com.appsmith.server.services.FeatureFlagService; -import com.appsmith.server.solutions.AutoCommitEventHandler; -import com.appsmith.server.solutions.AutoCommitEventHandlerImpl; import com.appsmith.server.testhelpers.git.GitFileSystemTestHelper; import lombok.extern.slf4j.Slf4j; import net.minidev.json.JSONObject; @@ -54,7 +54,7 @@ import java.util.UUID; import java.util.stream.Collectors; -import static com.appsmith.server.solutions.ce.AutoCommitEventHandlerCEImpl.AUTO_COMMIT_MSG_FORMAT; +import static com.appsmith.server.git.AutoCommitEventHandlerCEImpl.AUTO_COMMIT_MSG_FORMAT; import static java.lang.Boolean.FALSE; import static java.lang.Boolean.TRUE; import static org.assertj.core.api.Assertions.assertThat; diff --git a/app/server/appsmith-server/src/test/java/com/appsmith/server/helpers/ce/autocommit/AutoCommitEligibilityHelperTest.java b/app/server/appsmith-server/src/test/java/com/appsmith/server/git/autocommit/helpers/AutoCommitEligibilityHelperTest.java similarity index 99% rename from app/server/appsmith-server/src/test/java/com/appsmith/server/helpers/ce/autocommit/AutoCommitEligibilityHelperTest.java rename to app/server/appsmith-server/src/test/java/com/appsmith/server/git/autocommit/helpers/AutoCommitEligibilityHelperTest.java index 8947c28d4221..d3692eb44e2d 100644 --- a/app/server/appsmith-server/src/test/java/com/appsmith/server/helpers/ce/autocommit/AutoCommitEligibilityHelperTest.java +++ b/app/server/appsmith-server/src/test/java/com/appsmith/server/git/autocommit/helpers/AutoCommitEligibilityHelperTest.java @@ -1,4 +1,4 @@ -package com.appsmith.server.helpers.ce.autocommit; +package com.appsmith.server.git.autocommit.helpers; import com.appsmith.external.dtos.ModifiedResources; import com.appsmith.external.enums.FeatureFlagEnum; @@ -8,6 +8,7 @@ import com.appsmith.server.domains.Layout; import com.appsmith.server.domains.Theme; import com.appsmith.server.dtos.ApplicationJson; +import com.appsmith.server.dtos.AutoCommitTriggerDTO; import com.appsmith.server.dtos.PageDTO; import com.appsmith.server.helpers.CommonGitFileUtils; import com.appsmith.server.helpers.DSLMigrationUtils; diff --git a/app/server/appsmith-server/src/test/java/com/appsmith/server/helpers/ce/autocommit/GitAutoCommitHelperImplTest.java b/app/server/appsmith-server/src/test/java/com/appsmith/server/git/autocommit/helpers/GitAutoCommitHelperImplTest.java similarity index 99% rename from app/server/appsmith-server/src/test/java/com/appsmith/server/helpers/ce/autocommit/GitAutoCommitHelperImplTest.java rename to app/server/appsmith-server/src/test/java/com/appsmith/server/git/autocommit/helpers/GitAutoCommitHelperImplTest.java index 3f006627f5e3..f8aa5b6595ca 100644 --- a/app/server/appsmith-server/src/test/java/com/appsmith/server/helpers/ce/autocommit/GitAutoCommitHelperImplTest.java +++ b/app/server/appsmith-server/src/test/java/com/appsmith/server/git/autocommit/helpers/GitAutoCommitHelperImplTest.java @@ -1,4 +1,4 @@ -package com.appsmith.server.helpers.ce.autocommit; +package com.appsmith.server.git.autocommit.helpers; import com.appsmith.external.enums.FeatureFlagEnum; import com.appsmith.server.acl.AclPermission; @@ -10,13 +10,13 @@ import com.appsmith.server.domains.GitProfile; import com.appsmith.server.dtos.AutoCommitProgressDTO; import com.appsmith.server.events.AutoCommitEvent; +import com.appsmith.server.git.AutoCommitEventHandler; import com.appsmith.server.helpers.GitPrivateRepoHelper; import com.appsmith.server.helpers.RedisUtils; import com.appsmith.server.services.CommonGitService; import com.appsmith.server.services.FeatureFlagService; import com.appsmith.server.services.UserDataService; import com.appsmith.server.solutions.ApplicationPermission; -import com.appsmith.server.solutions.AutoCommitEventHandler; import lombok.extern.slf4j.Slf4j; import org.eclipse.jgit.lib.BranchTrackingStatus; import org.junit.jupiter.api.AfterEach;