fix: reverted git executor layer#39949
Conversation
WalkthroughThe changes update the Changes
Sequence Diagram(s)sequenceDiagram
participant Caller
participant GitExecutor
participant GitService
Caller->>GitExecutor: Request Git operation (e.g., pullApplication/getStatus)
GitExecutor->>GitService: Execute Git command
alt Operation successful
GitService-->>GitExecutor: Return success
GitExecutor-->>Caller: Return result
else Operation encounters error
GitExecutor->>GitService: Call resetToLastCommit to revert uncommitted changes
GitService-->>GitExecutor: Confirm reset (or log failure)
GitExecutor-->>Caller: Propagate error after reset attempt
end
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
Documentation and Community
|
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (2)
app/server/appsmith-git/src/main/java/com/appsmith/git/service/ce/GitExecutorCEImpl.java (2)
502-502: Consider logging reset failures separately.
Currently, ifresetToLastCommit(git)fails here, the original error context may be overshadowed. Capturing both errors separately can streamline debugging.
856-862: Log or rethrow the original error.
Only the error message is returned, risking loss of the original stack trace. Consider logging or wrapping the original error to preserve debug details.
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
app/server/appsmith-git/src/main/java/com/appsmith/git/service/ce/GitExecutorCEImpl.java(6 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (6)
- GitHub Check: build
- GitHub Check: perform-test / client-build / client-build
- GitHub Check: perform-test / rts-build / build
- GitHub Check: perform-test / server-build / server-unit-tests
- GitHub Check: server-unit-tests / server-unit-tests
- GitHub Check: server-spotless / spotless-check
🔇 Additional comments (4)
app/server/appsmith-git/src/main/java/com/appsmith/git/service/ce/GitExecutorCEImpl.java (4)
1031-1043: Verify need to discard uncommitted changes.
Before returning the merge status, this block discards uncommitted changes viaresetToLastCommit(...). Please confirm this is intentional.
1124-1124: Ensure callers handle newly thrown exceptions.
The signature now declaresthrows GitAPIException, IOException. Verify that all call sites accommodate these checked exceptions properly.
1129-1129: Avoid consecutive resets without intervening changes.
You reset once before checkout and again immediately after. Confirm if double-reset logic is intended or if it can be streamlined.
1159-1159: Rebase flow LGTM!
The rebase approach is straightforward.
| // will be possible | ||
| if (!status.isClean()) { | ||
| return resetToLastCommit(git).map(ref -> { | ||
| processStopwatch.stopAndLogTimeInMillis(); | ||
| jgitStatusSpan.end(); | ||
| return response; | ||
| }); | ||
| } |
There was a problem hiding this comment.
Potential data loss in a read-only operation.
Calling resetToLastCommit(git) in getStatus forcibly discards uncommitted changes. Confirm if this destructive behavior is truly desired in a status-check method.
## Description > > _Please also include relevant motivation and context. List any dependencies that are required for this change. Add links to Notion, Figma or any other documents that might be relevant to the PR._ Fixes #39934 _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" ### 🔍 Cypress test results <!-- This is an auto-generated comment: Cypress test results --> > [!TIP] > 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉 > Workflow run: <https://github.com/appsmithorg/appsmith/actions/runs/14103475195> > Commit: 288e4cf > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=14103475195&attempt=1" target="_blank">Cypress dashboard</a>. > Tags: `@tag.Git` > Spec: > <hr>Thu, 27 Mar 2025 10:37:32 UTC <!-- end of auto-generated comment: Cypress test results --> ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [ ] No <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Bug Fixes** - Enhanced error recovery in update operations, ensuring that any pending changes are safely reverted when issues occur. - Improved conflict resolution during updates to maintain a stable and reliable system state for end-users. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
## Description - Git executor CE Impl revert PR #39949 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" ### 🔍 Cypress test results <!-- This is an auto-generated comment: Cypress test results --> > [!CAUTION] > 🔴 🔴 🔴 Some tests have failed. > Workflow run: <https://github.com/appsmithorg/appsmith/actions/runs/14106311517> > Commit: cef9ab7 > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=14106311517&attempt=2&selectiontype=test&testsstatus=failed&specsstatus=fail" target="_blank">Cypress dashboard</a>. > Tags: @tag.Git > Spec: > The following are new failures, please fix them before merging the PR: <ol> > <li>cypress/e2e/Regression/Apps/ImportExportForkApplication_spec.js > <li>cypress/e2e/Regression/ClientSide/BugTests/CatchBlock_Spec.ts > <li>cypress/e2e/Regression/ClientSide/BugTests/DS_Bug28985_spec.ts > <li>cypress/e2e/Regression/ClientSide/BugTests/GraphQL_Binding_Bug16702_Spec.ts > <li>cypress/e2e/Regression/ClientSide/Git/GitAutocommit_spec.ts > <li>cypress/e2e/Regression/ClientSide/Git/GitDiscardChange/DiscardChanges_spec.js > <li>cypress/e2e/Regression/ClientSide/Git/GitImport/GitImport_spec.js > <li>cypress/e2e/Regression/ClientSide/Git/GitSync/GitSyncGitBugs_spec.js > <li>cypress/e2e/Regression/ClientSide/Templates/ForkTemplateToGitConnectedApp.js > <li>cypress/e2e/Regression/ClientSide/Widgets/Migration_Spec.js > <li>cypress/e2e/Regression/ServerSide/ApiTests/API_MultiPart_Spec.ts > <li>cypress/e2e/Regression/ServerSide/ApiTests/API_TestExecuteWithDynamicBindingInUrl_spec.ts > <li>cypress/e2e/Regression/ServerSide/OnLoadTests/JSOnLoad2_Spec.ts > <li>cypress/e2e/Regression/ServerSide/Params/PassingParams_Spec.ts</ol> > <a href="https://internal.appsmith.com/app/cypress-dashboard/identified-flaky-tests-65890b3c81d7400d08fa9ee3?branch=master" target="_blank">List of identified flaky tests</a>. > <hr>Thu, 27 Mar 2025 15:43:27 UTC <!-- end of auto-generated comment: Cypress test results --> ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [ ] No <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Bug Fixes** - Improved recovery for repository operations by automatically reverting to a stable state when errors occur, reducing conflict risks and ensuring a consistent environment. - **Refactor** - Optimized the overall error handling and state management logic to better maintain system stability during update and merge operations. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
## Description > > _Please also include relevant motivation and context. List any dependencies that are required for this change. Add links to Notion, Figma or any other documents that might be relevant to the PR._ Fixes appsmithorg#39934 _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" ### 🔍 Cypress test results <!-- This is an auto-generated comment: Cypress test results --> > [!TIP] > 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉 > Workflow run: <https://github.com/appsmithorg/appsmith/actions/runs/14103475195> > Commit: 288e4cf > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=14103475195&attempt=1" target="_blank">Cypress dashboard</a>. > Tags: `@tag.Git` > Spec: > <hr>Thu, 27 Mar 2025 10:37:32 UTC <!-- end of auto-generated comment: Cypress test results --> ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [ ] No <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Bug Fixes** - Enhanced error recovery in update operations, ensuring that any pending changes are safely reverted when issues occur. - Improved conflict resolution during updates to maintain a stable and reliable system state for end-users. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
Description
Fixes #39934
or
Fixes
Issue URLWarning
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"
🔍 Cypress test results
Tip
🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/14103475195
Commit: 288e4cf
Cypress dashboard.
Tags:
@tag.GitSpec:
Thu, 27 Mar 2025 10:37:32 UTC
Communication
Should the DevRel and Marketing teams inform users about this change?
Summary by CodeRabbit