Skip to content

chore: adding ce files - #41136

Merged
brayn003 merged 7 commits into
releasefrom
chore/git-cy-cleanup-1
Jul 31, 2025
Merged

chore: adding ce files#41136
brayn003 merged 7 commits into
releasefrom
chore/git-cy-cleanup-1

Conversation

@brayn003

@brayn003 brayn003 commented Jul 28, 2025

Copy link
Copy Markdown
Contributor

Description

Git Cy test cleanup
Doc https://www.notion.so/appsmith/Cypress-Git-Tests-Full-Migration-Plan-Technical-Migration-Document-21cfe271b0e2808e9bbfc52ff3f271d1?source=copy_link

Fixes #41116

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


Wed, 30 Jul 2025 00:46:28 UTC

Communication

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

  • Yes
  • No

Summary by CodeRabbit

  • Chores
    • Updated test intercepts and network request patterns to use new Git API endpoint structures.
    • Adjusted feature flag logic to enable a new Git API contracts flag for relevant tests.
    • Increased wait time for Git import operations to improve test reliability.
    • Refined and simplified test logic for Git discard, merge, and branch operations.
    • Added a new locator for pull count in Git sync UI tests.
    • Removed deprecated or redundant assertions and UI checks in Git-related tests.
    • Skipped import tests for older app versions due to backend compatibility issues.

@brayn003
brayn003 requested a review from ApekshaBhosale as a code owner July 28, 2025 03:04
@coderabbitai

coderabbitai Bot commented Jul 28, 2025

Copy link
Copy Markdown
Contributor

Walkthrough

This change updates Cypress end-to-end tests and supporting utilities to align with new Git API endpoint contracts. It refactors all relevant network intercepts, feature flag logic, and related assertions to use the updated /api/v1/git/applications/* endpoint structure, removes obsolete checks, and introduces a new feature flag for the updated contracts.

Changes

Cohort / File(s) Change Summary
Git API Endpoint Intercepts (Cypress E2E Tests)
app/client/cypress/e2e/Regression/ClientSide/Git/GitAutocommit_spec.ts
app/client/cypress/e2e/Regression/ClientSide/Git/GitDiscardChange/DiscardChanges_spec.js
app/client/cypress/e2e/Regression/ClientSide/Git/GitSync/DisconnectGit_spec.js
app/client/cypress/e2e/Regression/ClientSide/Git/GitSync/GitBranchProtect_spec.ts
app/client/cypress/e2e/Regression/ClientSide/Git/GitSync/GitStatusLite_spec.ts
Updated all API intercept URLs to use the new /api/v1/git/applications/* endpoint structure for autocommit, discard, disconnect, branch protection, and status; removed or modified related assertions and waits where necessary.
Git Import and Branch Switching Tests
app/client/cypress/e2e/Regression/ClientSide/Git/GitImport/ImportEmptyRepo_spec.js
app/client/cypress/e2e/Regression/ClientSide/Git/GitSync/GitConnectV2_spec.ts
app/client/cypress/e2e/Regression/ClientSide/Git/GitSync/MergeViaRemote_spec.ts
Marked import tests for older apps as skipped due to backend issues; increased import wait timeout; added UI wait for branch button after import; removed forced upgrade confirmation clicks in merge tests.
Feature Flag Support
app/client/cypress/support/Objects/FeatureFlags.ts
Added new feature flag release_git_api_contracts_enabled (default: true).
GitSync Page Object
app/client/cypress/support/Pages/GitSync.ts
Added locator quickActionsPullCount; removed useNewAPI parameter from CreateNConnectToGit; unified all API intercepts to new endpoint patterns; updated import key intercept to regex; changed branch checkout intercept to POST; commented out spinner check; removed assertion for network status in discard changes.
Cypress Command Route Intercepts and Feature Flags
app/client/cypress/support/commands.js
Updated all Git-related API route intercepts to new endpoint patterns; adjusted feature flag logic to enable release_git_api_contracts_enabled for Git-related tests.
GitSync Cypress Commands
app/client/cypress/support/gitSync.js
Updated merge command intercepts to use regex for new status and refs endpoints; removed assertion on merge status and fixed wait; removed assertion on merge branch status.
Existing Apps Import Test
app/client/cypress/e2e/Regression/ClientSide/Git/ExistingApps/v1.9.24/DSCrudAndBindings_Spec.ts
Skipped the test suite for importing older apps due to backend errors, with comments explaining the reason and instructions for manual testing.

Sequence Diagram(s)

sequenceDiagram
    participant CypressTest
    participant GitAPI
    participant UI

    CypressTest->>GitAPI: Intercept /api/v1/git/applications/* (various endpoints)
    CypressTest->>UI: Perform UI actions (e.g., click, wait for elements)
    GitAPI-->>CypressTest: API responses (autocommit, discard, disconnect, etc.)
    CypressTest->>UI: Assert UI state / response
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~18 minutes

Assessment against linked issues

Objective Addressed Explanation
Fix API intercepts (#41116)
Enable feature flag release_git_api_contracts_enabled (#41116)

Assessment against linked issues: Out-of-scope changes

No out-of-scope changes detected.

Poem

🚦 The endpoints shift, the tests align,
With contracts new, our specs refine.
Flags are set, and waits extended,
Old wildcards now are upended.
Through regex paths our coverage grows—
Onward, Cypress, as the pipeline flows!
🦾

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.


📜 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 77108f6 and c44fe06.

📒 Files selected for processing (2)
  • app/client/cypress/e2e/Regression/ClientSide/Git/GitDiscardChange/DiscardChanges_spec.js (1 hunks)
  • app/client/cypress/support/Pages/GitSync.ts (4 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • app/client/cypress/e2e/Regression/ClientSide/Git/GitDiscardChange/DiscardChanges_spec.js
  • app/client/cypress/support/Pages/GitSync.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (7)
  • GitHub Check: perform-test / rts-build / build
  • GitHub Check: perform-test / server-build / server-unit-tests
  • GitHub Check: perform-test / client-build / client-build
  • GitHub Check: client-unit-tests / client-unit-tests
  • GitHub Check: client-prettier / prettier-check
  • GitHub Check: client-lint / client-lint
  • GitHub Check: client-build / client-build
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore/git-cy-cleanup-1

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ 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.
    • Explain this complex logic.
    • 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 explain this code block.
    • @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 explain its main purpose.
    • @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.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

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.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this 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 Task A simple Todo skip-changelog Adding this label to a PR prevents it from being listed in the changelog labels Jul 28, 2025
@brayn003 brayn003 self-assigned this Jul 28, 2025
@brayn003 brayn003 added the ok-to-test Required label for CI label Jul 28, 2025
@brayn003
brayn003 requested review from ashit-rath and removed request for ApekshaBhosale July 28, 2025 09:37

@ashit-rath ashit-rath left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor callouts but rest looks good

Comment on lines -221 to -228
agHelper.AssertContains(
Cypress.env("MESSAGES").DISCARDING_AND_PULLING_CHANGES(),
);
cy.contains(Cypress.env("MESSAGES").DISCARDING_AND_PULLING_CHANGES());
agHelper.Sleep(2000);

agHelper.AssertElementVisibility(".ads-v2-callout__children");
agHelper.AssertElementVisibility(gitSync.locators.opsDiscardBtn);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't we need these checks?

Comment on lines +363 to +368
// cy.get(
// `div${this.locators.branchItem} ${this.commonLocators._btnSpinner}`,
// {
// timeout: 500,
// },
// ).should("exist");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's remove the comments?

@brayn003
brayn003 merged commit 4702fb1 into release Jul 31, 2025
43 checks passed
@brayn003
brayn003 deleted the chore/git-cy-cleanup-1 branch July 31, 2025 08:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ok-to-test Required label for CI skip-changelog Adding this label to a PR prevents it from being listed in the changelog Task A simple Todo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Task]: Fix git cypress tests for new API contracts

2 participants