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

fix: [Git] Avoid 404 when checking out a branch #21894

Merged
merged 6 commits into from
Apr 4, 2023

Conversation

hetunandu
Copy link
Member

@hetunandu hetunandu commented Mar 30, 2023

Description

After checkout, we will now check if the resource the user was accessing is available in the incoming branch. Instead of calling the apis to check this, we will listen to the success action and then handle check if the current resource is still available in the branch. If not, we will navigate the user to the home page of the app so that they do not see a 404 error

Don't show a 404 error when a resource is not available in the checked out branch, instead take them to the home page of the app

Fixes #17234
Fixes #20883

Media

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

  • Manual

    • Have a git connected app
    • Create a new branch
    • Create a new API/Query/Page on the new branch
    • Switch back to the original branch
    • Test: The app should not show 404 error but be navigated to the home page of the app
  • Cypress
    Updated the existing cypress tests that avoided the error to make sure they test the fix instead

Test Plan

Add Testsmith test cases links that relate to this PR

Issues raised during DP testing

Link issues raised during DP testing for better visiblity and tracking (copy link from comments dropped on this PR)

Checklist:

Dev activity

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • PR is being merged under a feature flag

QA activity:

  • Test plan has been approved by relevant developers
  • Test plan has been peer reviewed by QA
  • Cypress test cases have been added and approved by either SDET or manual QA
  • Organized project review call with relevant stakeholders after Round 1/2 of QA
  • Added Test Plan Approved label after reveiwing all Cypress test

@hetunandu
Copy link
Member Author

/ok-to-test

@hetunandu
Copy link
Member Author

/build-deploy-preview env=release

@github-actions github-actions bot added the Bug Something isn't working label Mar 30, 2023
@github-actions
Copy link

Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/4561697286.
Workflow: Appsmith External Integration Test Workflow.
Commit: ``.
PR: 21894.
Perf tests will be available at https://app.appsmith.com/app/performance-infra-dashboard/pr-details-638dd7cd2913ba43778b915e?pr=21894&runId=4561697286_1

@github-actions
Copy link

Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/4561699126.
Workflow: On demand build Docker image and deploy preview.
skip-tests: ``.
env: release.
PR: 21894.

@github-actions
Copy link

Deploy-Preview-URL: https://appsmith-37bjl7crx-get-appsmith.vercel.app

@github-actions
Copy link

The following are new failures, please fix them before merging the PR:

  1. cypress/integration/Regression_TestSuite/ClientSideTests/ExplorerTests/Entity_Explorer_Query_Datasource_spec.js

  2. cypress/integration/Regression_TestSuite/ClientSideTests/Git/GitSync/SwitchBranches_spec.js
  3. cypress/integration/Regression_TestSuite/ServerSideTests/ApiTests/API_ContextMenu_spec.js
  4. cypress/integration/Regression_TestSuite/ServerSideTests/Params/PassingParams_Spec.ts
  5. cypress/integration/Regression_TestSuite/ServerSideTests/QueryPane/S3_1_spec.js

@hetunandu
Copy link
Member Author

/ok-to-test

@github-actions
Copy link

Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/4564964391.
Workflow: Appsmith External Integration Test Workflow.
Commit: ``.
PR: 21894.
Perf tests will be available at https://app.appsmith.com/app/performance-infra-dashboard/pr-details-638dd7cd2913ba43778b915e?pr=21894&runId=4564964391_1

@github-actions
Copy link

The following are new failures, please fix them before merging the PR:

  1. cypress/integration/Regression_TestSuite/Application/CommunityIssues_Spec.ts

  2. cypress/integration/Regression_TestSuite/ClientSideTests/Binding/Promises_Spec.ts
  3. cypress/integration/Regression_TestSuite/ClientSideTests/ExplorerTests/Entity_Explorer_Query_Datasource_spec.js
  4. cypress/integration/Regression_TestSuite/ClientSideTests/FormLogin/EnableFormLogin_spec.js
  5. cypress/integration/Regression_TestSuite/ClientSideTests/Git/GitSync/SwitchBranches_spec.js
  6. cypress/integration/Regression_TestSuite/ClientSideTests/IDE/Canvas_Context_Property_Pane_spec.js
  7. cypress/integration/Regression_TestSuite/ClientSideTests/Widgets/Form/Form_With_CheckBox_spec.js
  8. cypress/integration/Regression_TestSuite/ClientSideTests/Widgets/TableV2/Inline_editing_spec.js
  9. cypress/integration/Regression_TestSuite/ClientSideTests/Workspace/LeaveWorkspaceTest_spec.js
  10. cypress/integration/Regression_TestSuite/ServerSideTests/ApiTests/API_ContextMenu_spec.js
  11. cypress/integration/Regression_TestSuite/ServerSideTests/Params/PassingParams_Spec.ts
  12. cypress/integration/Regression_TestSuite/ServerSideTests/Postgres_DataTypes/Array_Spec.ts
  13. cypress/integration/Regression_TestSuite/ServerSideTests/Postgres_DataTypes/BooleanEnum_Spec.ts

@hetunandu
Copy link
Member Author

/ok-to-test

@github-actions
Copy link

Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/4574501771.
Workflow: Appsmith External Integration Test Workflow.
Commit: ``.
PR: 21894.
Perf tests will be available at https://app.appsmith.com/app/performance-infra-dashboard/pr-details-638dd7cd2913ba43778b915e?pr=21894&runId=4574501771_1

@github-actions github-actions bot added Git Platform Issues related to the git & the app platform Git Product Issues related to version control product Medium Issues that frustrate users due to poor UX Needs Triaging Needs attention from maintainers to triage labels Mar 31, 2023
@github-actions
Copy link

The following are new failures, please fix them before merging the PR:

  1. cypress/integration/Regression_TestSuite/ClientSideTests/Git/GitSync/SwitchBranches_spec.js

  2. cypress/integration/Regression_TestSuite/ClientSideTests/Git/GitWithJSLibrary/GitwithCustomJSLibrary_spec.js
  3. cypress/integration/Regression_TestSuite/ClientSideTests/Linting/BasicLint_spec.ts
  4. cypress/integration/Regression_TestSuite/ClientSideTests/Widgets/ListV2/Listv2_defaultSelectedItem_spec.js

@hetunandu
Copy link
Member Author

/ok-to-test

@github-actions
Copy link

Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/4575836992.
Workflow: Appsmith External Integration Test Workflow.
Commit: ``.
PR: 21894.
Perf tests will be available at https://app.appsmith.com/app/performance-infra-dashboard/pr-details-638dd7cd2913ba43778b915e?pr=21894&runId=4575836992_1

@github-actions
Copy link

The following are new failures, please fix them before merging the PR:

  1. cypress/integration/Regression_TestSuite/ClientSideTests/ActionExecution/PostWindowMessage_spec.ts

  2. cypress/integration/Regression_TestSuite/ClientSideTests/ExplorerTests/Entity_Explorer_Pin_spec.js
  3. cypress/integration/Regression_TestSuite/ClientSideTests/Git/GitWithJSLibrary/GitwithCustomJSLibrary_spec.js
  4. cypress/integration/Regression_TestSuite/ClientSideTests/Widgets/JSONForm/JSONForm_HiddenFields_spec.js
  5. cypress/integration/Regression_TestSuite/ClientSideTests/Widgets/ListV2/Listv2_defaultSelectedItem_spec.js
  6. cypress/integration/Regression_TestSuite/ServerSideTests/Postgres_DataTypes/BooleanEnum_Spec.ts
  7. cypress/integration/Regression_TestSuite/ServerSideTests/QueryPane/S3_1_spec.js
Identified Flaky tests

@github-actions
Copy link

The following are new failures, please fix them before merging the PR:

  1. cypress/integration/Regression_TestSuite/ClientSideTests/ExplorerTests/Entity_Explorer_Pin_spec.js

Identified Flaky tests

@hetunandu hetunandu requested a review from akash-codemonk April 3, 2023 08:24
@hetunandu
Copy link
Member Author

/ok-to-test

@github-actions
Copy link

github-actions bot commented Apr 3, 2023

Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/4594531270.
Workflow: Appsmith External Integration Test Workflow.
Commit: ``.
PR: 21894.
Perf tests will be available at https://app.appsmith.com/app/performance-infra-dashboard/pr-details-638dd7cd2913ba43778b915e?pr=21894&runId=4594531270_1

@github-actions
Copy link

github-actions bot commented Apr 3, 2023

The following are new failures, please fix them before merging the PR:

  1. cypress/integration/Regression_TestSuite/ClientSideTests/Git/GitWithJSLibrary/GitwithCustomJSLibrary_spec.js

  2. cypress/integration/Regression_TestSuite/ClientSideTests/Linting/BasicLint_spec.ts
  3. cypress/integration/Regression_TestSuite/ServerSideTests/Params/PassingParams_Spec.ts
  4. cypress/integration/Regression_TestSuite/UpgradeAppsmith/UpgradeAppsimth_spec.js
Identified Flaky tests

@github-actions
Copy link

github-actions bot commented Apr 3, 2023

The following are new failures, please fix them before merging the PR:

  1. cypress/integration/Regression_TestSuite/UpgradeAppsmith/UpgradeAppsimth_spec.js

Identified Flaky tests

@Parthvi12 Parthvi12 added the Test Plan Approved Manual/Cypress tests covers changes made on the PR. Else, add skip-testPlan label if not applicable label Apr 3, 2023
@hetunandu hetunandu merged commit 0094aab into release Apr 4, 2023
@hetunandu hetunandu deleted the fix/git-checkout-404 branch April 4, 2023 04:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Git Platform Issues related to the git & the app platform Git Product Issues related to version control product Medium Issues that frustrate users due to poor UX Needs Triaging Needs attention from maintainers to triage Test Plan Approved Manual/Cypress tests covers changes made on the PR. Else, add skip-testPlan label if not applicable
Projects
None yet
3 participants