-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: adding branch persistence (#36622)
## Description Persisting latest branch. Re-opening the branch opens it in the latest branch Fixes #30321 ## 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/11325191494> > Commit: 570c6fb > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=11325191494&attempt=1" target="_blank">Cypress dashboard</a>. > Tags: `@tag.Git` > Spec: > <hr>Mon, 14 Oct 2024 10:27:07 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 Git branch management functionality in the ApplicationCard component. - New utility functions for storing and retrieving the latest Git branch. - Improved error handling and response management for Git operations. - Added user-specific tracking for Git branches in the AppEditorEngine. - Introduced a new feature flag for Git branch persistence. - New Cypress test suite to verify Git branch persistence after switching branches. - Added methods for asserting branch visibility and URL consistency in the GitSync class. - **Bug Fixes** - Refined error handling for various sagas, ensuring accurate error dispatching and user feedback. - **Documentation** - Updated function signatures and error handling descriptions in the initialization and Git synchronization processes. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
- Loading branch information
Showing
9 changed files
with
188 additions
and
19 deletions.
There are no files selected for viewing
45 changes: 45 additions & 0 deletions
45
app/client/cypress/e2e/Regression/ClientSide/Git/GitPersistBranch_spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import { featureFlagIntercept } from "../../../../support/Objects/FeatureFlags"; | ||
import { | ||
agHelper, | ||
gitSync, | ||
homePage, | ||
} from "../../../../support/Objects/ObjectsCore"; | ||
|
||
let wsName: string; | ||
let appName: string; | ||
let repoName: string; | ||
|
||
describe( | ||
"Git Persist Branch", | ||
{ | ||
tags: ["@tag.Git", "@tag.GitPersistBranch"], | ||
}, | ||
function () { | ||
before(() => { | ||
agHelper.GenerateUUID(); | ||
cy.get("@guid").then((uid) => { | ||
wsName = "GitPB-" + uid; | ||
appName = "GitPB1-" + uid; | ||
homePage.CreateNewWorkspace(wsName, true); | ||
homePage.CreateAppInWorkspace(wsName, appName); | ||
gitSync.CreateNConnectToGit("test-git-perssit-branch", true, true); | ||
cy.get("@gitRepoName").then((resRepoName) => { | ||
repoName = resRepoName.toString(); | ||
homePage.NavigateToHome(); | ||
}); | ||
}); | ||
}); | ||
it("Check if branch persist after changing branch and exiting the app", function () { | ||
featureFlagIntercept({ release_git_persist_branch_enabled: true }, true); | ||
homePage.EditAppFromAppHover(appName); | ||
gitSync.CreateGitBranch("b1", false); | ||
cy.get("@gitbranchName").then((resBranchName) => { | ||
const branchName = resBranchName.toString(); | ||
homePage.NavigateToHome(); | ||
homePage.EditAppFromAppHover(appName); | ||
gitSync.AssertBranchName(branchName); | ||
gitSync.AssertBranchNameInUrl(branchName); | ||
}); | ||
}); | ||
}, | ||
); |
1 change: 0 additions & 1 deletion
1
app/client/cypress/e2e/Regression/ClientSide/Git/GitSync/GitConnectV2_spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters