From e29348d50638dd64686c90e6fbca9b52cdee1acf Mon Sep 17 00:00:00 2001 From: Manish Kumar <107841575+sondermanish@users.noreply.github.com> Date: Thu, 6 Jun 2024 14:56:52 +0530 Subject: [PATCH] fix: added fix for disabling the autocommit feature without feature flag (#34020) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Description - Added @featureFlagged annotation `(release_git_autocommit_enabled)` to the interface method `isAutoCommitRequired` for `AutocommitEligibilityHelper` to disable the autocommit as a feature 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" ### :mag: Cypress test results > [!IMPORTANT] > 🟣 🟣 🟣 Your tests are running. > Tests running at: > Commit: f25b9eff2b2e4b0a646120d3c29748e6d71b9f5b > Workflow: `PR Automation test suite` > Tags: `@tag.Git` ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [ ] No ## Summary by CodeRabbit - **New Features** - Introduced a feature flag for auto-commit functionality in the app. - **Tests** - Disabled specific auto-commit test methods. --- .../autocommit/helpers/AutoCommitEligibilityHelperImpl.java | 1 + .../git/autocommit/ApplicationPageServiceAutoCommitTest.java | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/git/autocommit/helpers/AutoCommitEligibilityHelperImpl.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/git/autocommit/helpers/AutoCommitEligibilityHelperImpl.java index d9d6d36462b..239e9c430c4 100644 --- a/app/server/appsmith-server/src/main/java/com/appsmith/server/git/autocommit/helpers/AutoCommitEligibilityHelperImpl.java +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/git/autocommit/helpers/AutoCommitEligibilityHelperImpl.java @@ -91,6 +91,7 @@ public Mono isClientMigrationRequired(PageDTO pageDTO) { } @Override + @FeatureFlagged(featureFlagName = FeatureFlagEnum.release_git_autocommit_feature_enabled) public Mono isAutoCommitRequired( String workspaceId, GitArtifactMetadata gitArtifactMetadata, PageDTO pageDTO) { 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 88652ece3d0..1cffde452b3 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 @@ -34,6 +34,7 @@ import org.eclipse.jgit.lib.BranchTrackingStatus; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mockito; @@ -229,6 +230,7 @@ public void afterTest() { } @Test + @Disabled public void testAutoCommit_whenOnlyServerIsEligibleForMigration_commitSuccess() throws URISyntaxException, IOException, GitAPIException { @@ -282,6 +284,7 @@ public void testAutoCommit_whenOnlyServerIsEligibleForMigration_commitSuccess() } @Test + @Disabled public void testAutoCommit_whenOnlyClientIsEligibleForMigration_commitSuccess() throws GitAPIException, IOException, URISyntaxException { ApplicationJson applicationJson = @@ -344,6 +347,7 @@ public void testAutoCommit_whenOnlyClientIsEligibleForMigration_commitSuccess() } @Test + @Disabled public void testAutoCommit_whenAutoCommitNotEligible_returnsFalse() throws URISyntaxException, IOException, GitAPIException {