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

feat: adding branch persistence #36622

Merged
merged 12 commits into from
Oct 14, 2024
Merged

feat: adding branch persistence #36622

merged 12 commits into from
Oct 14, 2024

Conversation

brayn003
Copy link
Contributor

@brayn003 brayn003 commented Oct 1, 2024

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

Tip

🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/11325191494
Commit: 570c6fb
Cypress dashboard.
Tags: @tag.Git
Spec:


Mon, 14 Oct 2024 10:27:07 UTC

Communication

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

  • Yes
  • No

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.

Copy link
Contributor

coderabbitai bot commented Oct 1, 2024

Walkthrough

The recent changes introduce enhancements to Git branch management within the application. The ApplicationCard component now tracks the latest Git branch and adjusts its state accordingly. New utility functions for storing and retrieving the latest Git branch from local storage have been added. Additionally, several sagas related to Git operations have been updated to improve error handling and state management. These modifications collectively enhance the robustness of the Git synchronization functionality in the application.

Changes

Files Change Summary
app/client/src/pages/Applications/ApplicationCard.tsx Modified to manage Git branch functionality, including state tracking for editorParams and baseApplicationId. Added logic for URL construction and Git badge display.
app/client/src/sagas/GitSyncSagas.ts Enhanced Git operations with new utility functions and improved error handling in sagas like commitToGitRepoSaga and connectToGitSaga.
app/client/src/sagas/InitSagas.ts Updated initialization logic, including error handling improvements and state resets in resetEditorSaga. Removed branch parameter from getInitResponses.
app/client/src/utils/storage.ts Introduced new functions setLatestGitBranchInLocal and getLatestGitBranchFromLocal for managing Git branch storage. Added new storage key LATEST_GIT_BRANCH.
app/client/src/entities/Engine/AppEditorEngine.ts Updated to integrate Git branch management by calling setLatestGitBranchInLocal and using getCurrentGitBranch for URL updates.
app/client/src/ce/entities/FeatureFlag.ts Added a new feature flag release_git_persist_branch_enabled to manage Git branch persistence.
app/client/cypress/e2e/Regression/ClientSide/Git/GitPersistBranch_spec.ts Introduced a Cypress test suite to verify Git branch persistence after switching branches.
app/client/cypress/e2e/Regression/ClientSide/Git/GitSync/GitConnectV2_spec.ts Streamlined the test by removing unnecessary imports and clarifying the test flow.
app/client/cypress/support/Pages/GitSync.ts Added methods for asserting branch visibility in the UI and URL within the GitSync class.

Assessment against linked issues

Objective Addressed Explanation
Open editor with last active branch (Scenario 1)
Open editor with default branch if no previous active branch (Scenario 2)
Open editor with default branch if no previous session (Scenario 3)

Possibly related PRs

  • feat: telemetry added for current linter #36400: The changes in the main PR involve the introduction of a new utility function getLatestGitBranchFromLocal, which is related to Git operations, similar to the setLatestGitBranchInLocal function added in this PR.
  • fix: fixed autocommit spec for airgap #36579: The main PR's focus on Git branch management aligns with the updates made to the autocommit tests in this PR, which also involve Git operations and repository management.
  • fix: New query button does not show up issue fixed #36766: The changes in the main PR regarding Git branch management and the new utility function relate to the updates made in this PR, which addresses issues with the visibility of the "New query" button, potentially linked to Git operations.
  • fix: Focus retention on inputs #36770: The focus on input fields and their behavior in the main PR can be related to the changes made in this PR, which also addresses focus retention issues in the application, indicating a broader context of user interaction improvements.

Suggested labels

Query & JS Pod, Integrations Product, Integrations Pod General, Needs Triaging

Suggested reviewers

  • ApekshaBhosale
  • sagar-qa007

Poem

In the land of code where branches sway,
New functions emerge to brighten the day.
With Git in our grasp, we manage with glee,
Tracking each change, as smooth as can be.
Errors now tamed, our states reset right,
Cheers to the updates, our future is bright! 🌟


📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 411eb88 and 0e3c25f.

📒 Files selected for processing (2)
  • app/client/cypress/e2e/Regression/ClientSide/Git/GitPersistBranch_spec.ts (1 hunks)
  • app/client/cypress/limited-tests.txt (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • app/client/cypress/e2e/Regression/ClientSide/Git/GitPersistBranch_spec.ts
🧰 Additional context used
📓 Path-based instructions (1)
app/client/cypress/limited-tests.txt (1)

Pattern app/client/cypress/**/**.*: Review the following e2e test code written using the Cypress test library. Ensure that:

  • Follow best practices for Cypress code and e2e automation.
  • Avoid using cy.wait in code.
  • Avoid using cy.pause in code.
  • Avoid using agHelper.sleep().
  • Use locator variables for locators and do not use plain strings.
  • Use data-* attributes for selectors.
  • Avoid Xpaths, Attributes and CSS path.
  • Avoid selectors like .btn.submit or button[type=submit].
  • Perform logins via API with LoginFromAPI.
  • Perform logout via API with LogOutviaAPI.
  • Perform signup via API with SignupFromAPI.
  • Avoid using it.only.
  • Avoid using after and aftereach in test cases.
  • Use multiple assertions for expect statements.
  • Avoid using strings for assertions.
  • Do not use duplicate filenames even with different paths.
  • Avoid using agHelper.Sleep, this.Sleep in any file in code.
🔇 Additional comments (1)
app/client/cypress/limited-tests.txt (1)

2-2: Class, let's examine this change carefully.

Now, students, we've observed a significant alteration in our test suite. The previous test file for "Fork_Template" has been replaced with a new one for "GitPersistBranch". This change appears to be in line with our lesson plan on implementing branch persistence.

However, before we move on, let's make sure we've done our homework:

  1. Does this new test file, GitPersistBranch_spec.ts, exist in the specified directory?
  2. Have we ensured that this change aligns with our PR objectives of enhancing branch persistence?
  3. Are we certain that removing the "Fork_Template" test won't affect our overall test coverage?

Remember, class, in the world of software development, every change matters. Let's make sure we've crossed our t's and dotted our i's!

To confirm the existence of our new test file, let's run a quick check:

Class, once we've run this verification, we'll know if our file management is in order. Remember, good organization is key to successful development!

✅ Verification successful

Great job on updating the test suite!

The new test file GitPersistBranch_spec.ts has been successfully added, and the old Fork_Template_spec.js has been removed as intended. This transition to TypeScript enhances our test reliability and aligns perfectly with our PR objectives.

Keep up the excellent work in maintaining a robust and up-to-date testing environment!

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Verify the existence of the new test file
if [ -f "app/client/cypress/e2e/Regression/ClientSide/Git/GitPersistBranch_spec.ts" ]; then
    echo "The new test file exists."
else
    echo "Warning: The new test file does not exist!"
fi

# Check if the old test file still exists (it shouldn't if it was intentionally removed)
if [ -f "app/client/cypress/e2e/Regression/ClientSide/Templates/Fork_Template_spec.js" ]; then
    echo "Warning: The old test file still exists!"
else
    echo "The old test file has been successfully removed."
fi

Length of output: 344


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 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.

@github-actions github-actions bot added the Enhancement New feature or request label Oct 1, 2024
@brayn003
Copy link
Contributor Author

brayn003 commented Oct 1, 2024

/build-deploy-preview

@github-actions github-actions bot added Git Platform Issues related to the git & the app platform Git Product Issues related to version control product Task A simple Todo labels Oct 1, 2024
@brayn003 brayn003 added the ok-to-test Required label for CI label Oct 1, 2024
Copy link

github-actions bot commented Oct 1, 2024

Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/11118618128.
Workflow: On demand build Docker image and deploy preview.
skip-tests: . env: .
PR: 36622.
recreate: .

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: 2

🧹 Outside diff range and nitpick comments (1)
app/client/src/pages/Applications/ApplicationCard.tsx (1)

295-299: Let's clean up by removing obsolete commented-out code.

Keeping old code commented out can clutter your files and make it harder to maintain. Since you've implemented a new approach, you can safely remove the old commented code to enhance readability.

Apply this diff to remove the commented code:

- // const params: any = {};

- // if (showGitBadge) {
- //   params.branch = showGitBadge;
- }
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between bb11bf5 and 8626c26.

📒 Files selected for processing (4)
  • app/client/src/pages/Applications/ApplicationCard.tsx (3 hunks)
  • app/client/src/sagas/GitSyncSagas.ts (3 hunks)
  • app/client/src/sagas/InitSagas.ts (0 hunks)
  • app/client/src/utils/storage.ts (2 hunks)
💤 Files with no reviewable changes (1)
  • app/client/src/sagas/InitSagas.ts
🔇 Additional comments (7)
app/client/src/utils/storage.ts (2)

46-46: Very good addition of a new storage key, class!

The new storage key LATEST_GIT_BRANCH has been added to the STORAGE_KEYS object. This is a crucial step in maintaining consistency across our local storage operations. Well done!


1116-1132: 🛠️ Refactor suggestion

Well done on implementing the getLatestGitBranchFromLocal function!

This function complements the setLatestGitBranchInLocal function we just reviewed. Let's analyze its implementation:

  1. It takes a single parameter: baseApplicationId.
  2. It retrieves the stored branches using the LATEST_GIT_BRANCH key.
  3. It returns the branch associated with the given baseApplicationId, or undefined if not found.
  4. Proper error handling is implemented with logging.

The implementation is correct and follows good practices. However, there's a small improvement we can make:

Instead of returning null in the catch block, consider returning undefined. This will make the function's return type more consistent. Here's the suggested change:

  } catch (error) {
    log.error("An error occurred while fetching LATEST_GIT_BRANCH");
    log.error(error);

-   return null;
+   return undefined;
  }

This change will ensure that the function always returns either a string (the branch name) or undefined, making it easier for the calling code to handle the return value.

Let's make sure these new functions are used correctly throughout the codebase:

This will help us ensure that these new functions are being used appropriately in the codebase.

✅ Verification successful

Excellent observation!
The suggestion to return undefined instead of null in the getLatestGitBranchFromLocal function enhances type consistency. Additionally, the shell script confirms that both setLatestGitBranchInLocal and getLatestGitBranchFromLocal are correctly utilized across the codebase, ensuring that this change won't introduce any issues.

  • Next Steps:
    • Proceed with the refactor to return undefined.
    • Consider adding TypeScript type annotations to enforce consistent return types.
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for usage of new Git branch storage functions

echo "Checking usage of setLatestGitBranchInLocal:"
rg "setLatestGitBranchInLocal" --type ts

echo "\nChecking usage of getLatestGitBranchFromLocal:"
rg "getLatestGitBranchFromLocal" --type ts

Length of output: 888

app/client/src/pages/Applications/ApplicationCard.tsx (2)

56-56: Good job importing the necessary utility function.

By importing getLatestGitBranchFromLocal, you're enabling the component to access the latest Git branch from local storage. Well done!


120-122: Excellent initialization of state variables.

Setting up baseApplicationId, showGitBadge, and initializing params properly prepares your component's state for the new Git branch functionality. Keep up the good work!

app/client/src/sagas/GitSyncSagas.ts (3)

138-138: Correctly Importing setLatestGitBranchInLocal

The import statement adds setLatestGitBranchInLocal from "utils/storage", which is appropriate for enhancing branch persistence.


381-381: Retrieving baseApplicationId for Branch Persistence

Introducing baseApplicationId by selecting it from the state ensures that the application ID is available for subsequent operations related to branch persistence.


409-409: Persisting the Latest Git Branch Locally

By invoking setLatestGitBranchInLocal(baseApplicationId, trimmedBranch), the code correctly stores the latest Git branch in local storage, which aligns with the objective of enhancing branch persistence.

app/client/src/utils/storage.ts Outdated Show resolved Hide resolved
app/client/src/pages/Applications/ApplicationCard.tsx Outdated Show resolved Hide resolved
Copy link

github-actions bot commented Oct 1, 2024

Deploy-Preview-URL: https://ce-36622.dp.appsmith.com

This comment was marked as outdated.

1 similar comment

This comment was marked as outdated.

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: 2

🧹 Outside diff range and nitpick comments (1)
app/client/src/utils/storage.ts (1)

1122-1139: Excellent work on this function! It's almost perfect, but let's add a small improvement.

The getLatestGitBranchFromLocal function is well-implemented, with proper error handling and efficient use of optional chaining. However, we can make it even better!

Here's a small suggestion to improve code readability:

- const branch = userBranches?.[baseApplicationId] ?? null;
+ const branch = userBranches?.[baseApplicationId] || null;

Using the logical OR operator (||) instead of the nullish coalescing operator (??) in this case is more appropriate, as it will return null for both undefined and empty string values, which are both falsy in JavaScript.

Keep up the excellent work, and remember, small improvements can make a big difference!

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 8626c26 and 0473bab.

📒 Files selected for processing (3)
  • app/client/src/entities/Engine/AppEditorEngine.ts (3 hunks)
  • app/client/src/pages/Applications/ApplicationCard.tsx (5 hunks)
  • app/client/src/utils/storage.ts (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • app/client/src/pages/Applications/ApplicationCard.tsx
🧰 Additional context used
📓 Learnings (1)
app/client/src/utils/storage.ts (1)
Learnt from: brayn003
PR: appsmithorg/appsmith#36622
File: app/client/src/utils/storage.ts:1091-1114
Timestamp: 2024-10-01T07:58:44.643Z
Learning: In the `setLatestGitBranchInLocal` function, the nullish coalescing operator (`??`) is already correctly used to handle `null` and `undefined` values in `storedBranches`.
🔇 Additional comments (2)
app/client/src/utils/storage.ts (2)

1092-1120: Well done, class! This function is a shining example of good coding practices.

The setLatestGitBranchInLocal function is implemented correctly and efficiently. It properly handles nested objects, preserves existing data, and includes error logging. Keep up the good work!


1091-1139: Class, let's review what we've learned from these excellent additions!

These new functions, setLatestGitBranchInLocal and getLatestGitBranchFromLocal, are valuable additions to our storage utility. They allow us to efficiently manage Git branch information for different users and applications. Here's why they deserve a gold star:

  1. They follow consistent error handling and logging practices.
  2. They use modern JavaScript features like optional chaining and nullish coalescing.
  3. They're designed to work with nested data structures, preserving existing data.

These functions will greatly improve our ability to manage Git branch information in local storage. Well done on implementing these features!

app/client/src/entities/Engine/AppEditorEngine.ts Outdated Show resolved Hide resolved
app/client/src/entities/Engine/AppEditorEngine.ts Outdated Show resolved Hide resolved

This comment was marked as duplicate.

Copy link

github-actions bot commented Oct 2, 2024

⚠️ Cyclic Dependency Check:

This PR has increased the number of cyclic dependencies by 1, when compared with the release branch.

Refer this document to identify the cyclic dependencies introduced by this PR.

@brayn003
Copy link
Contributor Author

brayn003 commented Oct 2, 2024

/build-deploy-preview

Copy link

github-actions bot commented Oct 2, 2024

Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/11141797574.
Workflow: On demand build Docker image and deploy preview.
skip-tests: . env: .
PR: 36622.
recreate: .

Copy link

github-actions bot commented Oct 2, 2024

Deploy-Preview-URL: https://ce-36622.dp.appsmith.com

Copy link

github-actions bot commented Oct 9, 2024

This PR has not seen activitiy for a while. It will be closed in 7 days unless further activity is detected.

@github-actions github-actions bot added the Stale label Oct 9, 2024
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

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 0473bab and 79cf9ba.

📒 Files selected for processing (1)
  • app/client/src/entities/Engine/AppEditorEngine.ts (3 hunks)
🧰 Additional context used
🔇 Additional comments (4)
app/client/src/entities/Engine/AppEditorEngine.ts (4)

53-53: Excellent inclusion of necessary imports

Well done importing getAIPromptTriggered and setLatestGitBranchInLocal from "utils/storage". This ensures you have access to the functions needed for tracking AI prompts and setting the latest Git branch locally.


71-73: Correct imports for user selection and logging

Good job importing getCurrentUser and the User type. Including log from "loglevel" is appropriate for handling logging within your application. These imports are essential for managing user data and logging errors effectively.


275-277: Proper retrieval of current user and branch information

You're correctly using yield select to retrieve currentUser and currentBranch from the Redux store. This is a good practice to access the current state within your saga functions.


278-284: Appropriate null checks before setting the latest Git branch

It's commendable that you've added checks for currentUser?.email, currentApplication?.baseId, and currentBranch before invoking setLatestGitBranchInLocal. This helps prevent potential runtime errors by ensuring all necessary data is available.

app/client/src/entities/Engine/AppEditorEngine.ts Outdated Show resolved Hide resolved

This comment was marked as outdated.

This comment was marked as outdated.

Copy link

⚠️ Cyclic Dependency Check:

This PR has increased the number of cyclic dependencies by 1, when compared with the release branch.

Refer this document to identify the cyclic dependencies introduced by this PR.

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

🧹 Outside diff range and nitpick comments (3)
app/client/cypress/e2e/Regression/ClientSide/Git/GitPersistBranch_spec.ts (1)

18-40: A well-structured test case, but let's make it even better!

Your test case is logically structured and covers the main functionality of branch persistence. You've done a great job using feature flag interception, generating unique identifiers, and making thorough assertions.

However, I have a small suggestion to improve your work:

Consider replacing cy.get("@guid") with cy.get<string>("@guid") to explicitly type the alias. This will make your code more type-safe and easier to understand. Here's how you can do it:

cy.get<string>("@guid").then((uid) => {
  // ... rest of your code
});

Keep up the excellent work, and remember, attention to detail is key in software testing!

app/client/cypress/support/Pages/GitSync.ts (2)

457-460: Well done on implementing the AssertBranchName method!

Class, let's take a moment to appreciate this well-structured method. It correctly asserts both the visibility of the branch button and its content. However, to make it even better, we could consider adding a more specific assertion message.

Consider modifying the AssertContains call to include a custom error message:

-    this.agHelper.AssertContains(branch);
+    this.agHelper.AssertContains(branch, `Branch name should be "${branch}"`);

This will make it clearer what exactly is being asserted if the test fails.


462-467: Excellent work on the AssertBranchNameInUrl method!

Class, this method is a great example of how to check URL parameters in Cypress. It's concise and focused on its task. However, to maintain consistency with our agHelper usage throughout the class, we could refactor this slightly.

Consider refactoring the method to use agHelper for consistency:

  public AssertBranchNameInUrl(branch: string) {
-   cy.location("search")
-     .then((searchParams) => new URLSearchParams(searchParams))
-     .invoke("get", "branch")
-     .should("equal", branch);
+   this.agHelper.GetCurrentURL().then((url) => {
+     const searchParams = new URLSearchParams(new URL(url).search);
+     const urlBranch = searchParams.get("branch");
+     this.agHelper.AssertEqual(urlBranch, branch, `URL branch parameter should be "${branch}"`);
+   });
  }

This refactoring maintains the same functionality while aligning with the class's use of agHelper for assertions.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between a602c54 and 76a4d19.

📒 Files selected for processing (3)
  • app/client/cypress/e2e/Regression/ClientSide/Git/GitPersistBranch_spec.ts (1 hunks)
  • app/client/cypress/e2e/Regression/ClientSide/Git/GitSync/GitConnectV2_spec.ts (0 hunks)
  • app/client/cypress/support/Pages/GitSync.ts (1 hunks)
💤 Files with no reviewable changes (1)
  • app/client/cypress/e2e/Regression/ClientSide/Git/GitSync/GitConnectV2_spec.ts
🧰 Additional context used
📓 Path-based instructions (2)
app/client/cypress/e2e/Regression/ClientSide/Git/GitPersistBranch_spec.ts (1)

Pattern app/client/cypress/**/**.*: Review the following e2e test code written using the Cypress test library. Ensure that:

  • Follow best practices for Cypress code and e2e automation.
  • Avoid using cy.wait in code.
  • Avoid using cy.pause in code.
  • Avoid using agHelper.sleep().
  • Use locator variables for locators and do not use plain strings.
  • Use data-* attributes for selectors.
  • Avoid Xpaths, Attributes and CSS path.
  • Avoid selectors like .btn.submit or button[type=submit].
  • Perform logins via API with LoginFromAPI.
  • Perform logout via API with LogOutviaAPI.
  • Perform signup via API with SignupFromAPI.
  • Avoid using it.only.
  • Avoid using after and aftereach in test cases.
  • Use multiple assertions for expect statements.
  • Avoid using strings for assertions.
  • Do not use duplicate filenames even with different paths.
  • Avoid using agHelper.Sleep, this.Sleep in any file in code.
app/client/cypress/support/Pages/GitSync.ts (1)

Pattern app/client/cypress/**/**.*: Review the following e2e test code written using the Cypress test library. Ensure that:

  • Follow best practices for Cypress code and e2e automation.
  • Avoid using cy.wait in code.
  • Avoid using cy.pause in code.
  • Avoid using agHelper.sleep().
  • Use locator variables for locators and do not use plain strings.
  • Use data-* attributes for selectors.
  • Avoid Xpaths, Attributes and CSS path.
  • Avoid selectors like .btn.submit or button[type=submit].
  • Perform logins via API with LoginFromAPI.
  • Perform logout via API with LogOutviaAPI.
  • Perform signup via API with SignupFromAPI.
  • Avoid using it.only.
  • Avoid using after and aftereach in test cases.
  • Use multiple assertions for expect statements.
  • Avoid using strings for assertions.
  • Do not use duplicate filenames even with different paths.
  • Avoid using agHelper.Sleep, this.Sleep in any file in code.
🔇 Additional comments (2)
app/client/cypress/e2e/Regression/ClientSide/Git/GitPersistBranch_spec.ts (2)

1-10: Well done on your imports and variable declarations, class!

Your imports are neatly organized, and you've declared your variables clearly at the top of the file. This is good practice for maintaining readable and organized code. Keep up the good work!


12-17: Excellent use of tags and description, students!

Your test suite is well-organized with a clear description and appropriate tags. This will make it easier for your classmates to understand the purpose of the test and categorize it correctly. Good job!

Copy link

⚠️ Cyclic Dependency Check:

This PR has increased the number of cyclic dependencies by 1, when compared with the release branch.

Refer this document to identify the cyclic dependencies introduced by this PR.

@brayn003 brayn003 added ok-to-test Required label for CI and removed ok-to-test Required label for CI labels Oct 11, 2024
@ApekshaBhosale
Copy link
Contributor

ApekshaBhosale commented Oct 14, 2024

@brayn003 Cypress changes LGTM

Let's run this multiple times on EE as well

@brayn003
Copy link
Contributor Author

ankitakinger
ankitakinger previously approved these changes Oct 14, 2024
@brayn003
Copy link
Contributor Author

/ci-test-limit-count run_count=5

Copy link

Copy link

⚠️ Cyclic Dependency Check:

This PR has increased the number of cyclic dependencies by 1, when compared with the release branch.

Refer this document to identify the cyclic dependencies introduced by this PR.

Copy link

Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/11324183245.
Cypress dashboard: Click here!
The following are new failures, please fix them before merging the PR:
To know the list of identified flaky tests - Refer here

***** Repeat Run Summary ***** Total Tests with repeat: 5 Total Passed: 5 Total Failed: 0 Total Skipped: 0 *****************************

Copy link

⚠️ Cyclic Dependency Check:

This PR has increased the number of cyclic dependencies by 1, when compared with the release branch.

Refer this document to identify the cyclic dependencies introduced by this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or request Git Platform Issues related to the git & the app platform Git Product Issues related to version control product ok-to-test Required label for CI Stale Task A simple Todo
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Launch the editor with the last active branch instead of the default branch
3 participants