From 3981590006014d9bc9368bc443f0567830dcf589 Mon Sep 17 00:00:00 2001 From: subratadeypappu Date: Thu, 10 Jul 2025 11:13:17 +0600 Subject: [PATCH] chore: Add changes for new API contracts in GitSync.ts (#41101) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Description EE Counterpart: https://github.com/appsmithorg/appsmith-ee/pull/7963 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 > [!TIP] > 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉 > Workflow run: > Commit: fddb1629889967638a5675cb6f005b08c113f770 > Cypress dashboard. > Tags: `@tag.Git` > Spec: >
Wed, 09 Jul 2025 19:50:34 UTC ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [x] No ## Summary by CodeRabbit * **New Features** * Added support for using updated API endpoints during Git connection setup in tests via an optional parameter. * **Tests** * Enhanced test setup flexibility by allowing selection between original and new API endpoints for Git-related operations. --- app/client/cypress/support/Pages/GitSync.ts | 33 +++++++++++++++------ 1 file changed, 24 insertions(+), 9 deletions(-) diff --git a/app/client/cypress/support/Pages/GitSync.ts b/app/client/cypress/support/Pages/GitSync.ts index 2d405a6396..f776630684 100644 --- a/app/client/cypress/support/Pages/GitSync.ts +++ b/app/client/cypress/support/Pages/GitSync.ts @@ -159,23 +159,38 @@ export class GitSync { repoName = "Repo", assertConnect = true, privateFlag = false, + useNewAPI = false, ) { this.agHelper.GenerateUUID(); cy.get("@guid").then((uid) => { repoName += uid; this.CreateTestGiteaRepo(repoName, privateFlag); - cy.intercept("POST", "/api/v1/applications/ssh-keypair/*").as( - `generateKey-${repoName}`, - ); + if (useNewAPI) { + cy.intercept("POST", "/api/v1/git/applications/*/ssh-keypair*").as( + `generateKey-${repoName}`, + ); - cy.intercept("GET", "/api/v1/git/branch/app/*/protected").as( - `protected-${repoName}`, - ); + cy.intercept("GET", "/api/v1/git/applications/*/protected-branches").as( + `protected-${repoName}`, + ); - cy.intercept("GET", "/api/v1/git/branch/app/*").as( - `branches-${repoName}`, - ); + cy.intercept("GET", "/api/v1/git/applications/*/refs").as( + `branches-${repoName}`, + ); + } else { + cy.intercept("POST", "/api/v1/applications/ssh-keypair/*").as( + `generateKey-${repoName}`, + ); + + cy.intercept("GET", "/api/v1/git/branch/app/*/protected").as( + `protected-${repoName}`, + ); + + cy.intercept("GET", "/api/v1/git/branch/app/*").as( + `branches-${repoName}`, + ); + } this.OpenConnectModal();