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

chore: fixes mergeviaremote_spec flakiness #38635

Merged
merged 7 commits into from
Jan 14, 2025
Merged

Conversation

brayn003
Copy link
Contributor

@brayn003 brayn003 commented Jan 13, 2025

Description

Fixes flakiness for merge via remote spec

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/12765495211
Commit: 7f83e90
Cypress dashboard.
Tags: @tag.Git
Spec:


Tue, 14 Jan 2025 11:18:09 UTC

Communication

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

  • Yes
  • No

Summary by CodeRabbit

  • Tests
    • Updated Git synchronization test suite for merging changes
    • Modified test file to streamline page creation and merging process
    • Added new test path for Anvil Widgets tests
    • Removed commented test file path and related comment

Copy link
Contributor

coderabbitai bot commented Jan 13, 2025

Walkthrough

This pull request focuses on refactoring a Git synchronization test suite in Cypress, specifically the MergeViaRemote_spec.ts file. The changes involve simplifying variable declarations, streamlining test logic, and updating method calls for Git operations. Additionally, the limited-tests.txt file was modified to include new test paths and remove a comment about test limitations.

Changes

File Change Summary
app/client/cypress/e2e/Regression/ClientSide/Git/GitSync/MergeViaRemote_spec.ts - Removed multiple temporary branch variables
- Added newPageName variable
- Updated test logic for page creation and Git operations
- Improved method calls and error handling
app/client/cypress/limited-tests.txt - Added new test path: cypress/e2e/Regression/ClientSide/Anvil/Widgets/*
- Commented out existing test file path
- Removed test limitation comment

Possibly related PRs

Suggested Labels

Bug, Test

Suggested Reviewers

  • ApekshaBhosale
  • NandanAnantharamu
  • sagar-qa007

Poem

🌿 Git branches dance and sway,
Code commits find their way,
Cypress tests, sharp and bright,
Refactoring takes flight! 🚀
Simplicity wins the day!


📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 92a9a9b and 1c9e8e0.

📒 Files selected for processing (1)
  • app/client/cypress/limited-tests.txt (0 hunks)
💤 Files with no reviewable changes (1)
  • app/client/cypress/limited-tests.txt
⏰ Context from checks skipped due to timeout of 90000ms (7)
  • GitHub Check: perform-test / client-build / client-build
  • GitHub Check: perform-test / server-build / server-unit-tests
  • GitHub Check: perform-test / rts-build / build
  • GitHub Check: client-prettier / prettier-check
  • GitHub Check: client-lint / client-lint
  • GitHub Check: client-unit-tests / client-unit-tests
  • GitHub Check: client-build / client-build

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 generate docstrings to generate docstrings for this PR. (Beta)
  • @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 skip-changelog Adding this label to a PR prevents it from being listed in the changelog label Jan 13, 2025
@brayn003
Copy link
Contributor Author

/ci-test-limit-count run_count=5

Copy link

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

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b6f7164 and cb623b9.

📒 Files selected for processing (2)
  • app/client/cypress/e2e/Regression/ClientSide/Git/GitSync/MergeViaRemote_spec.ts (5 hunks)
  • app/client/cypress/limited-tests.txt (1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
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.
app/client/cypress/e2e/Regression/ClientSide/Git/GitSync/MergeViaRemote_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.
🪛 Biome (1.9.4)
app/client/cypress/e2e/Regression/ClientSide/Git/GitSync/MergeViaRemote_spec.ts

[error] 82-82: Unsafe usage of optional chaining.

If it short-circuits with 'undefined' the evaluation will throw TypeError here:

(lint/correctness/noUnsafeOptionalChaining)

⏰ Context from checks skipped due to timeout of 90000ms (4)
  • GitHub Check: client-unit-tests / client-unit-tests
  • GitHub Check: client-prettier / prettier-check
  • GitHub Check: client-build / client-build
  • GitHub Check: client-lint / client-lint
🔇 Additional comments (2)
app/client/cypress/e2e/Regression/ClientSide/Git/GitSync/MergeViaRemote_spec.ts (1)

8-13: LGTM! Clean variable declarations with proper typing.

app/client/cypress/limited-tests.txt (1)

2-6: LGTM! Test configuration aligns with PR objectives.

The changes correctly focus the test suite on Git sync functionality.

@brayn003 brayn003 self-assigned this Jan 13, 2025
@brayn003 brayn003 added ok-to-test Required label for CI Git Product Issues related to version control product labels Jan 13, 2025
Copy link

Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/12750203169.
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: 15 Total Passed: 15 Total Failed: 0 Total Skipped: 0 *****************************

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

🧹 Nitpick comments (2)
app/client/cypress/limited-tests.txt (2)

7-7: Fix grammatical issue in the comment

The comment is missing an article.

-#ci-test-limit uses this file to run minimum of specs. Do not run entire suite with this command.
+#ci-test-limit uses this file to run the minimum of specs. Do not run the entire suite with this command.
🧰 Tools
🪛 LanguageTool

[uncategorized] ~7-~7: You might be missing the article “the” here.
Context: ...ile to run minimum of specs. Do not run entire suite with this command.

(AI_EN_LECTOR_MISSING_DETERMINER_THE)


Line range hint 1-7: Consider adding a comment explaining the purpose of Widget tests

To improve clarity, consider documenting why Widget tests are included in this limited test set.

# To run only limited tests - give the spec names in below format:
#cypress/e2e/Regression/ClientSide/VisualTests/JSEditorIndent_spec.js
# For running all specs - uncomment below:
#cypress/e2e/**/**/*
+# Running Widget tests to ensure core functionality
cypress/e2e/Regression/ClientSide/Anvil/Widgets/*
🧰 Tools
🪛 LanguageTool

[uncategorized] ~7-~7: You might be missing the article “the” here.
Context: ...ile to run minimum of specs. Do not run entire suite with this command.

(AI_EN_LECTOR_MISSING_DETERMINER_THE)

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between cb623b9 and 0c29721.

📒 Files selected for processing (1)
  • app/client/cypress/limited-tests.txt (1 hunks)
🧰 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.
📓 Learnings (1)
📓 Common learnings
Learnt from: brayn003
PR: appsmithorg/appsmith#38635
File: app/client/cypress/e2e/Regression/ClientSide/Git/GitSync/MergeViaRemote_spec.ts:102-102
Timestamp: 2025-01-13T15:14:12.806Z
Learning: In Cypress Git sync tests, explicit assertions after _.gitSync.SwitchGitBranch() are not required as the helper method likely handles the verification internally.
Learnt from: brayn003
PR: appsmithorg/appsmith#38635
File: app/client/cypress/e2e/Regression/ClientSide/Git/GitSync/MergeViaRemote_spec.ts:52-58
Timestamp: 2025-01-13T15:15:05.763Z
Learning: The Git sync helper functions (_.gitSync.CommitAndPush, _.gitSync.MergeToMaster) in Cypress tests already include built-in assertions, so additional explicit assertions after these calls are not needed.
🪛 LanguageTool
app/client/cypress/limited-tests.txt

[uncategorized] ~7-~7: You might be missing the article “the” here.
Context: ...ile to run minimum of specs. Do not run entire suite with this command.

(AI_EN_LECTOR_MISSING_DETERMINER_THE)

🔇 Additional comments (1)
app/client/cypress/limited-tests.txt (1)

Line range hint 1-5: Verify alignment with PR objectives

The changes enable Widget tests while the PR's objective is to fix flakiness in MergeViaRemote_spec. Consider adding the specific test file path:

#cypress/e2e/Regression/ClientSide/VisualTests/JSEditorIndent_spec.js
# For running all specs - uncomment below:
#cypress/e2e/**/**/*
+cypress/e2e/Regression/ClientSide/Git/GitSync/MergeViaRemote_spec.ts
cypress/e2e/Regression/ClientSide/Anvil/Widgets/*
✅ Verification successful

Focus on MergeViaRemote test instead of Widget tests

Since the PR aims to fix flakiness in MergeViaRemote_spec, replace the Widget tests path with the specific test file:

-cypress/e2e/Regression/ClientSide/Anvil/Widgets/*
+cypress/e2e/Regression/ClientSide/Git/GitSync/MergeViaRemote_spec.ts
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Verify if MergeViaRemote_spec exists
fd "MergeViaRemote_spec.ts" "app/client/cypress"

Length of output: 126


Script:

#!/bin/bash
# Check for any references to MergeViaRemote in Widget test files
rg -l "MergeViaRemote" "app/client/cypress/e2e/Regression/ClientSide/Anvil/Widgets/"

# Check for any shared test utilities or setup files
rg -l "beforeEach|before\(" "app/client/cypress/e2e/Regression/ClientSide/Git/GitSync/MergeViaRemote_spec.ts"

Length of output: 272

🧰 Tools
🪛 LanguageTool

[uncategorized] ~7-~7: You might be missing the article “the” here.
Context: ...ile to run minimum of specs. Do not run entire suite with this command.

(AI_EN_LECTOR_MISSING_DETERMINER_THE)

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

🧹 Nitpick comments (1)
app/client/src/selectors/gitModSelectors.ts (1)

Line range hint 1-1: Plan removal of temporary file.

The comment indicates this is a temporary file. Consider creating a tracking issue for its removal once Git modularization is fully rolled out.

Would you like me to create a GitHub issue to track the removal of this file after the Git modularization rollout?

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0c29721 and 92a9a9b.

📒 Files selected for processing (1)
  • app/client/src/selectors/gitModSelectors.ts (1 hunks)
🧰 Additional context used
📓 Learnings (1)
📓 Common learnings
Learnt from: brayn003
PR: appsmithorg/appsmith#38635
File: app/client/cypress/e2e/Regression/ClientSide/Git/GitSync/MergeViaRemote_spec.ts:102-102
Timestamp: 2025-01-13T15:14:12.806Z
Learning: In Cypress Git sync tests, explicit assertions after _.gitSync.SwitchGitBranch() are not required as the helper method likely handles the verification internally.
Learnt from: brayn003
PR: appsmithorg/appsmith#38635
File: app/client/cypress/e2e/Regression/ClientSide/Git/GitSync/MergeViaRemote_spec.ts:52-58
Timestamp: 2025-01-13T15:15:05.763Z
Learning: The Git sync helper functions (_.gitSync.CommitAndPush, _.gitSync.MergeToMaster) in Cypress tests already include built-in assertions, so additional explicit assertions after these calls are not needed.
⏰ Context from checks skipped due to timeout of 90000ms (4)
  • GitHub Check: perform-test / client-build / client-build
  • GitHub Check: client-unit-tests / client-unit-tests
  • GitHub Check: client-lint / client-lint
  • GitHub Check: client-build / client-build
🔇 Additional comments (1)
app/client/src/selectors/gitModSelectors.ts (1)

24-25: Verify the impact of removing feature flag.

The change to always return true forces all Git operations to use the new modularized implementation. While this aligns with fixing test flakiness, ensure all consumers are ready for this change.

✅ Verification successful

Feature flag removal is safe to proceed

The feature flag has already been effectively removed from active code, and no other conditional checks were found. The imported Git selectors are unrelated to the modularization feature.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for any remaining feature flag checks
rg -A 2 "release_git_modularisation_enabled" 

# Search for any imports of the old selectors that might be affected
rg "import.*gitSyncSelectors" 

Length of output: 2315

@brayn003 brayn003 merged commit d7e30e7 into release Jan 14, 2025
43 checks passed
@brayn003 brayn003 deleted the chore/git-flaky-tests branch January 14, 2025 12:56
@coderabbitai coderabbitai bot mentioned this pull request Jan 16, 2025
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Git Product Issues related to version control product ok-to-test Required label for CI skip-changelog Adding this label to a PR prevents it from being listed in the changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants