Conversation
WalkthroughAdds Git deploy-key generation: new modal UI and hook, Redux state/actions/selectors, API request and saga to update generated SSH keys, invalid-deploy-key logging and warning UI, debugger Git entity/link/icon support, and related import/path and UI component adjustments. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant UI as DangerZone / Modal
participant Hook as useGenerateDeployKey
participant Store as Redux Store
participant Saga as updateGeneratedSSHKeySaga
participant API as Git API
User->>UI: Click "Generate Deploy Key"
UI->>Hook: toggleGenerateSSHKeyModal(true)
Hook->>Store: dispatch toggleGenerateSSHKeyModal(open=true)
Store-->>UI: isGenerateSSHKeyModalOpen = true
UI->>User: Show GenerateDeployKeyModal
User->>UI: Click "Finish"
UI->>Hook: onUpdateGeneratedSSHKey()
Hook->>Store: dispatch updateGeneratedSSHKeyInit(artifactDef)
Store->>Saga: run updateGeneratedSSHKeySaga
Saga->>API: POST /git/update-generated-ssh-key
API-->>Saga: response
alt success
Saga->>Store: dispatch updateGeneratedSSHKeySuccess
Saga->>Store: dispatch initGitForEditor(with response)
Saga->>Store: dispatch toggleGenerateSSHKeyModal(false)
Store-->>UI: close modal
else error
Saga->>Store: dispatch updateGeneratedSSHKeyError
Store-->>UI: show error
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes
Poem
Pre-merge checks and finishing touches✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 4
🧹 Nitpick comments (1)
app/client/src/git/components/GenerateDeployKeyModal/index.tsx (1)
83-88:setFormDatadependency is unnecessary.React's
setStatefunctions are stable and don't need to be included inuseCallbackdependency arrays. While this doesn't cause bugs, it's redundant.Apply this diff:
const handleChange = useCallback( (partialFormData: Partial<ConnectFormDataState>) => { setFormData((prev) => ({ ...prev, ...partialFormData })); }, - [setFormData], + [], );
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (32)
app/client/src/ce/components/editorComponents/Debugger/ErrorLogs/getLogIconForEntity.tsx(2 hunks)app/client/src/ce/components/editorComponents/Debugger/entityTypeLinkMap.tsx(1 hunks)app/client/src/ce/constants/messages.ts(1 hunks)app/client/src/ce/entities/AppsmithConsole/utils.ts(1 hunks)app/client/src/components/editorComponents/Debugger/GitEntityLink.tsx(1 hunks)app/client/src/entities/AppsmithConsole/logtype.ts(1 hunks)app/client/src/git/ce/components/GitModals/index.tsx(2 hunks)app/client/src/git/components/ConnectModal/ConnectInitialize/ChooseGitProvider.tsx(3 hunks)app/client/src/git/components/ConnectModal/ConnectInitialize/GenerateSSH.test.tsx(1 hunks)app/client/src/git/components/ConnectModal/ConnectInitialize/GenerateSSH.tsx(2 hunks)app/client/src/git/components/ConnectModal/ConnectInitialize/index.tsx(1 hunks)app/client/src/git/components/DangerZone/DangerZoneView.tsx(5 hunks)app/client/src/git/components/DangerZone/index.tsx(3 hunks)app/client/src/git/components/GenerateDeployKeyModal/GenerateDeployKeyModalView.tsx(1 hunks)app/client/src/git/components/GenerateDeployKeyModal/index.tsx(1 hunks)app/client/src/git/components/SettingsModal/TabGeneral/InvalidKeyWarning.tsx(1 hunks)app/client/src/git/components/SettingsModal/TabGeneral/index.tsx(2 hunks)app/client/src/git/components/common/AddDeployKey.tsx(1 hunks)app/client/src/git/components/common/GitUIComponents.tsx(2 hunks)app/client/src/git/hooks/useGenerateDeployKey.ts(1 hunks)app/client/src/git/requests/updateGeneratedSSHKeyRequest.ts(1 hunks)app/client/src/git/requests/updateGeneratedSSHKeyRequest.types.ts(1 hunks)app/client/src/git/sagas/fetchStatusSaga.ts(2 hunks)app/client/src/git/sagas/index.ts(2 hunks)app/client/src/git/sagas/updateGeneratedSSHKeySaga.ts(1 hunks)app/client/src/git/store/actions/uiActions.ts(1 hunks)app/client/src/git/store/actions/updateGeneratedSSHKeyActions.ts(1 hunks)app/client/src/git/store/gitGlobalSlice.ts(4 hunks)app/client/src/git/store/helpers/initialState.ts(1 hunks)app/client/src/git/store/selectors/gitGlobalSelectors.ts(1 hunks)app/client/src/git/store/types.ts(1 hunks)app/client/src/sagas/DebuggerSagas.ts(1 hunks)
🧰 Additional context used
🧠 Learnings (33)
📓 Common learnings
Learnt from: brayn003
Repo: appsmithorg/appsmith PR: 37984
File: app/client/src/git/requests/generateSSHKeyRequest.ts:9-18
Timestamp: 2024-12-05T11:06:06.127Z
Learning: In the TypeScript file `app/client/src/git/requests/generateSSHKeyRequest.ts`, the function `generateSSHKeyRequest` does not require error handling and input validation.
Learnt from: ashit-rath
Repo: appsmithorg/appsmith PR: 33809
File: app/client/src/workers/Evaluation/evaluate.ts:209-229
Timestamp: 2024-07-26T21:12:57.228Z
Learning: User ashit-rath prefers using `forEach` over `for...of` for iterating over objects and arrays in JavaScript.
Learnt from: ashit-rath
Repo: appsmithorg/appsmith PR: 33809
File: app/client/src/workers/Evaluation/evaluate.ts:209-229
Timestamp: 2024-10-08T15:32:34.115Z
Learning: User ashit-rath prefers using `forEach` over `for...of` for iterating over objects and arrays in JavaScript.
📚 Learning: 2024-12-16T19:45:00.807Z
Learnt from: brayn003
Repo: appsmithorg/appsmith PR: 38171
File: app/client/src/git/ce/components/GitModals/index.tsx:1-7
Timestamp: 2024-12-16T19:45:00.807Z
Learning: The imports in `GitModals` for `ConnectModal`, `DisableAutocommitModal`, `DisconnectModal`, and `SettingsModal` are correct and should not be flagged.
Applied to files:
app/client/src/git/ce/components/GitModals/index.tsxapp/client/src/git/components/ConnectModal/ConnectInitialize/GenerateSSH.tsxapp/client/src/git/store/types.tsapp/client/src/git/components/GenerateDeployKeyModal/index.tsxapp/client/src/git/components/DangerZone/index.tsxapp/client/src/git/store/gitGlobalSlice.tsapp/client/src/git/components/DangerZone/DangerZoneView.tsxapp/client/src/git/store/helpers/initialState.tsapp/client/src/git/components/SettingsModal/TabGeneral/InvalidKeyWarning.tsxapp/client/src/git/components/GenerateDeployKeyModal/GenerateDeployKeyModalView.tsxapp/client/src/git/components/ConnectModal/ConnectInitialize/ChooseGitProvider.tsxapp/client/src/git/store/actions/uiActions.tsapp/client/src/git/components/common/AddDeployKey.tsxapp/client/src/git/components/common/GitUIComponents.tsxapp/client/src/git/components/SettingsModal/TabGeneral/index.tsxapp/client/src/git/components/ConnectModal/ConnectInitialize/index.tsxapp/client/src/git/store/selectors/gitGlobalSelectors.tsapp/client/src/git/components/ConnectModal/ConnectInitialize/GenerateSSH.test.tsx
📚 Learning: 2024-07-26T21:12:57.228Z
Learnt from: KelvinOm
Repo: appsmithorg/appsmith PR: 29387
File: app/client/packages/design-system/widgets/src/components/TagGroup/src/Tag.tsx:9-9
Timestamp: 2024-07-26T21:12:57.228Z
Learning: The `CloseIcon` is being moved to a common directory for better reusability across components, following the suggestion to avoid importing it from the `Modal` component's directory.
Applied to files:
app/client/src/git/ce/components/GitModals/index.tsxapp/client/src/git/components/ConnectModal/ConnectInitialize/ChooseGitProvider.tsxapp/client/src/git/components/common/AddDeployKey.tsxapp/client/src/git/components/common/GitUIComponents.tsx
📚 Learning: 2024-12-05T11:06:06.127Z
Learnt from: brayn003
Repo: appsmithorg/appsmith PR: 37984
File: app/client/src/git/requests/generateSSHKeyRequest.ts:9-18
Timestamp: 2024-12-05T11:06:06.127Z
Learning: In the TypeScript file `app/client/src/git/requests/generateSSHKeyRequest.ts`, the function `generateSSHKeyRequest` does not require error handling and input validation.
Applied to files:
app/client/src/git/components/ConnectModal/ConnectInitialize/GenerateSSH.tsxapp/client/src/git/store/types.tsapp/client/src/git/requests/updateGeneratedSSHKeyRequest.tsapp/client/src/git/hooks/useGenerateDeployKey.tsapp/client/src/git/components/GenerateDeployKeyModal/index.tsxapp/client/src/git/components/DangerZone/index.tsxapp/client/src/git/sagas/updateGeneratedSSHKeySaga.tsapp/client/src/git/store/gitGlobalSlice.tsapp/client/src/git/components/DangerZone/DangerZoneView.tsxapp/client/src/git/store/helpers/initialState.tsapp/client/src/git/components/GenerateDeployKeyModal/GenerateDeployKeyModalView.tsxapp/client/src/git/store/actions/updateGeneratedSSHKeyActions.tsapp/client/src/git/store/actions/uiActions.tsapp/client/src/git/requests/updateGeneratedSSHKeyRequest.types.tsapp/client/src/git/store/selectors/gitGlobalSelectors.tsapp/client/src/git/sagas/index.tsapp/client/src/git/components/ConnectModal/ConnectInitialize/GenerateSSH.test.tsx
📚 Learning: 2024-12-03T10:13:43.282Z
Learnt from: ashit-rath
Repo: appsmithorg/appsmith PR: 37912
File: app/client/src/git/components/QuickActions/helpers.ts:22-25
Timestamp: 2024-12-03T10:13:43.282Z
Learning: In `app/client/src/git/components/QuickActions/helpers.ts`, the unnecessary `ts-ignore` comments will be removed in future PRs.
Applied to files:
app/client/src/git/components/ConnectModal/ConnectInitialize/GenerateSSH.tsxapp/client/src/git/store/types.tsapp/client/src/git/store/gitGlobalSlice.tsapp/client/src/git/components/DangerZone/DangerZoneView.tsxapp/client/src/git/components/ConnectModal/ConnectInitialize/ChooseGitProvider.tsxapp/client/src/git/store/actions/updateGeneratedSSHKeyActions.tsapp/client/src/git/store/actions/uiActions.tsapp/client/src/git/components/common/AddDeployKey.tsxapp/client/src/git/components/common/GitUIComponents.tsxapp/client/src/git/store/selectors/gitGlobalSelectors.tsapp/client/src/git/sagas/index.ts
📚 Learning: 2024-12-16T19:43:14.764Z
Learnt from: brayn003
Repo: appsmithorg/appsmith PR: 38171
File: app/client/src/git/components/GitContextProvider/index.tsx:60-70
Timestamp: 2024-12-16T19:43:14.764Z
Learning: Prefer not to throw errors when dispatching actions in the `setImportWorkspaceId` function in `app/client/src/git/components/GitContextProvider/index.tsx`.
Applied to files:
app/client/src/git/components/ConnectModal/ConnectInitialize/GenerateSSH.tsxapp/client/src/git/store/gitGlobalSlice.tsapp/client/src/git/components/ConnectModal/ConnectInitialize/ChooseGitProvider.tsxapp/client/src/git/sagas/fetchStatusSaga.tsapp/client/src/git/components/ConnectModal/ConnectInitialize/index.tsx
📚 Learning: 2025-01-16T14:25:46.177Z
Learnt from: brayn003
Repo: appsmithorg/appsmith PR: 38681
File: app/client/src/git/constants/enums.ts:2-4
Timestamp: 2025-01-16T14:25:46.177Z
Learning: The GitArtifactType enum in TypeScript uses lowercase plural values: "applications", "packages", and "workflows" for Application, Package, and Workflow respectively.
Applied to files:
app/client/src/ce/entities/AppsmithConsole/utils.tsapp/client/src/git/requests/updateGeneratedSSHKeyRequest.ts
📚 Learning: 2024-12-05T11:02:42.148Z
Learnt from: brayn003
Repo: appsmithorg/appsmith PR: 37984
File: app/client/src/git/requests/generateSSHKeyRequest.types.ts:6-11
Timestamp: 2024-12-05T11:02:42.148Z
Learning: In the `GenerateSSHKeyResponse` interface in `app/client/src/git/requests/generateSSHKeyRequest.types.ts`, both `isRegeneratedKey` and `regeneratedKey` are intentionally included and serve the same concept.
Applied to files:
app/client/src/git/store/types.tsapp/client/src/git/requests/updateGeneratedSSHKeyRequest.tsapp/client/src/git/hooks/useGenerateDeployKey.tsapp/client/src/git/components/GenerateDeployKeyModal/index.tsxapp/client/src/git/sagas/updateGeneratedSSHKeySaga.tsapp/client/src/git/store/helpers/initialState.tsapp/client/src/git/store/actions/uiActions.tsapp/client/src/git/requests/updateGeneratedSSHKeyRequest.types.tsapp/client/src/git/store/selectors/gitGlobalSelectors.ts
📚 Learning: 2025-01-09T15:17:04.536Z
Learnt from: brayn003
Repo: appsmithorg/appsmith PR: 38563
File: app/client/src/git/components/QuickActions/index.tsx:34-34
Timestamp: 2025-01-09T15:17:04.536Z
Learning: In Git-related components, `isStatusClean` with a default value of `true` is used to determine the initial loading state, rather than indicating the presence of uncommitted changes.
Applied to files:
app/client/src/git/store/types.tsapp/client/src/git/store/helpers/initialState.ts
📚 Learning: 2024-11-29T05:38:54.262Z
Learnt from: brayn003
Repo: appsmithorg/appsmith PR: 37830
File: app/client/packages/git/src/actions/checkoutBranchActions.ts:11-18
Timestamp: 2024-11-29T05:38:54.262Z
Learning: In the Git Redux actions (`app/client/packages/git/src/actions`), the `createSingleArtifactAction` function already handles loading state and error management, so additional checks in action creators are unnecessary.
Applied to files:
app/client/src/git/store/types.tsapp/client/src/git/hooks/useGenerateDeployKey.tsapp/client/src/git/sagas/updateGeneratedSSHKeySaga.tsapp/client/src/git/store/gitGlobalSlice.tsapp/client/src/git/store/helpers/initialState.tsapp/client/src/git/store/actions/updateGeneratedSSHKeyActions.tsapp/client/src/git/store/actions/uiActions.ts
📚 Learning: 2024-12-10T10:53:17.146Z
Learnt from: brayn003
Repo: appsmithorg/appsmith PR: 38060
File: app/client/src/git/components/GitQuickActions/helpers/getPullButtonStatus.ts:16-24
Timestamp: 2024-12-10T10:53:17.146Z
Learning: In the `getPullBtnStatus` function (`app/client/src/git/components/GitQuickActions/helpers/getPullButtonStatus.ts`), default parameter values should be explicitly mentioned to handle component state properly, even if all props are required.
Applied to files:
app/client/src/git/store/types.tsapp/client/src/git/store/helpers/initialState.tsapp/client/src/git/components/SettingsModal/TabGeneral/InvalidKeyWarning.tsx
📚 Learning: 2024-12-15T17:45:48.303Z
Learnt from: brayn003
Repo: appsmithorg/appsmith PR: 38171
File: app/client/src/git/components/DefaultBranch/DefaultBranchCE.tsx:1-14
Timestamp: 2024-12-15T17:45:48.303Z
Learning: In `app/client/src/git/components/DefaultBranch/DefaultBranchCE.tsx`, the feature flag check is performed at a higher level, so it's acceptable to have `isGitProtectedFeatureLicensed={false}` in this component.
Applied to files:
app/client/src/git/store/types.tsapp/client/src/components/editorComponents/Debugger/GitEntityLink.tsxapp/client/src/git/components/SettingsModal/TabGeneral/InvalidKeyWarning.tsxapp/client/src/git/components/SettingsModal/TabGeneral/index.tsxapp/client/src/git/components/ConnectModal/ConnectInitialize/index.tsx
📚 Learning: 2024-12-05T10:56:13.739Z
Learnt from: brayn003
Repo: appsmithorg/appsmith PR: 37984
File: app/client/src/git/requests/fetchSSHKeyRequest.ts:5-9
Timestamp: 2024-12-05T10:56:13.739Z
Learning: In `app/client/src/git/requests/fetchSSHKeyRequest.ts`, the `fetchSSHKeyRequest` function does not require explicit error handling for `baseApplicationId`; the function should throw an error naturally if `baseApplicationId` is missing or invalid.
Applied to files:
app/client/src/git/requests/updateGeneratedSSHKeyRequest.tsapp/client/src/git/components/SettingsModal/TabGeneral/InvalidKeyWarning.tsxapp/client/src/git/sagas/fetchStatusSaga.ts
📚 Learning: 2024-12-10T10:53:01.591Z
Learnt from: brayn003
Repo: appsmithorg/appsmith PR: 38060
File: app/client/src/git/requests/updateLocalProfileRequest.ts:9-14
Timestamp: 2024-12-10T10:53:01.591Z
Learning: In `app/client/src/git/requests/updateLocalProfileRequest.ts`, input validation for `baseApplicationId` is not required because TypeScript ensures type safety.
Applied to files:
app/client/src/git/requests/updateGeneratedSSHKeyRequest.tsapp/client/src/git/requests/updateGeneratedSSHKeyRequest.types.ts
📚 Learning: 2024-12-10T10:52:38.873Z
Learnt from: brayn003
Repo: appsmithorg/appsmith PR: 38060
File: app/client/src/git/sagas/fetchLocalProfileSaga.ts:8-13
Timestamp: 2024-12-10T10:52:38.873Z
Learning: In `app/client/src/git/sagas/fetchLocalProfileSaga.ts` and similar Git sagas, error handling for `baseArtifactId` is managed outside the scope, so validation checks for `baseArtifactId` within the saga functions are unnecessary.
Applied to files:
app/client/src/git/requests/updateGeneratedSSHKeyRequest.tsapp/client/src/git/sagas/updateGeneratedSSHKeySaga.tsapp/client/src/git/sagas/fetchStatusSaga.tsapp/client/src/sagas/DebuggerSagas.tsapp/client/src/git/sagas/index.ts
📚 Learning: 2024-12-10T10:52:51.127Z
Learnt from: brayn003
Repo: appsmithorg/appsmith PR: 38060
File: app/client/src/git/sagas/updateLocalProfileSaga.ts:35-40
Timestamp: 2024-12-10T10:52:51.127Z
Learning: In `app/client/src/git/sagas/updateLocalProfileSaga.ts`, it's acceptable to cast `error` to `string` when passing it to `gitArtifactActions.updateLocalProfileError`.
Applied to files:
app/client/src/git/requests/updateGeneratedSSHKeyRequest.tsapp/client/src/git/sagas/updateGeneratedSSHKeySaga.tsapp/client/src/git/sagas/fetchStatusSaga.tsapp/client/src/sagas/DebuggerSagas.tsapp/client/src/git/sagas/index.ts
📚 Learning: 2024-12-11T08:25:39.197Z
Learnt from: brayn003
Repo: appsmithorg/appsmith PR: 38088
File: app/client/src/git/components/GitContextProvider/hooks/useGitBranches.ts:40-43
Timestamp: 2024-12-11T08:25:39.197Z
Learning: In `app/client/src/git/components/GitContextProvider/hooks/useGitBranches.ts`, the `useMemo` hook includes dependencies `artifactType` and `baseArtifactId` in its dependency array.
Applied to files:
app/client/src/git/hooks/useGenerateDeployKey.tsapp/client/src/git/components/GenerateDeployKeyModal/index.tsxapp/client/src/git/components/DangerZone/index.tsxapp/client/src/git/components/ConnectModal/ConnectInitialize/ChooseGitProvider.tsxapp/client/src/git/components/common/AddDeployKey.tsxapp/client/src/git/components/ConnectModal/ConnectInitialize/index.tsxapp/client/src/git/components/ConnectModal/ConnectInitialize/GenerateSSH.test.tsx
📚 Learning: 2024-12-11T08:33:24.352Z
Learnt from: brayn003
Repo: appsmithorg/appsmith PR: 38088
File: app/client/src/git/components/GitQuickActions/BranchButton/index.tsx:72-74
Timestamp: 2024-12-11T08:33:24.352Z
Learning: In the 'BranchButton' component in 'app/client/src/git/components/GitQuickActions/BranchButton/index.tsx' (TypeScript, React), the `useEffect` hook that checks for label ellipsis does not need to include `currentBranch` in its dependency array.
Applied to files:
app/client/src/git/hooks/useGenerateDeployKey.tsapp/client/src/git/components/common/AddDeployKey.tsx
📚 Learning: 2024-12-13T22:08:46.336Z
Learnt from: brayn003
Repo: appsmithorg/appsmith PR: 38155
File: app/client/src/git/components/ProtectedBranches/index.tsx:18-27
Timestamp: 2024-12-13T22:08:46.336Z
Learning: The `ProtectedBranchesView` component in `app/client/src/git/components/ProtectedBranches/ProtectedBranchesView.tsx` already has a TypeScript interface for its props.
Applied to files:
app/client/src/git/components/DangerZone/index.tsx
📚 Learning: 2024-10-11T09:28:32.636Z
Learnt from: brayn003
Repo: appsmithorg/appsmith PR: 36622
File: app/client/src/entities/Engine/AppEditorEngine.ts:0-0
Timestamp: 2024-10-11T09:28:32.636Z
Learning: In the file `app/client/src/entities/Engine/AppEditorEngine.ts`, the IDs (`currentApplication.baseId`) and branches (`currentBranch`) are obfuscated, so it's acceptable to log them for debugging purposes.
Applied to files:
app/client/src/ce/components/editorComponents/Debugger/ErrorLogs/getLogIconForEntity.tsxapp/client/src/sagas/DebuggerSagas.ts
📚 Learning: 2024-07-26T21:12:57.228Z
Learnt from: ankitakinger
Repo: appsmithorg/appsmith PR: 29573
File: app/client/src/pages/Editor/Explorer/Entity/EntityProperties.tsx:240-0
Timestamp: 2024-07-26T21:12:57.228Z
Learning: The `ENTITY_TYPE.MODULE_INSTANCE` case in `EntityProperties.tsx` is intentionally a combination of the logic from both `ENTITY_TYPE.ACTION` and `ENTITY_TYPE.JSACTION`, which explains the presence of what might seem like duplicated code.
Applied to files:
app/client/src/ce/components/editorComponents/Debugger/ErrorLogs/getLogIconForEntity.tsx
📚 Learning: 2024-12-10T10:52:38.244Z
Learnt from: brayn003
Repo: appsmithorg/appsmith PR: 38060
File: app/client/src/git/sagas/fetchLocalProfileSaga.ts:28-34
Timestamp: 2024-12-10T10:52:38.244Z
Learning: In `app/client/src/git/sagas/fetchLocalProfileSaga.ts`, error handling is managed outside the scope, so casting errors directly to strings is acceptable.
Applied to files:
app/client/src/git/sagas/updateGeneratedSSHKeySaga.tsapp/client/src/git/sagas/fetchStatusSaga.tsapp/client/src/sagas/DebuggerSagas.tsapp/client/src/git/sagas/index.ts
📚 Learning: 2025-01-13T18:31:44.457Z
Learnt from: brayn003
Repo: appsmithorg/appsmith PR: 38634
File: app/client/src/git/sagas/initGitSaga.ts:38-39
Timestamp: 2025-01-13T18:31:44.457Z
Learning: In Git sagas where operations are primarily Redux `put` effects, error handling with try-catch blocks is unnecessary as these effects don't throw errors.
Applied to files:
app/client/src/git/sagas/updateGeneratedSSHKeySaga.tsapp/client/src/git/sagas/fetchStatusSaga.ts
📚 Learning: 2024-12-11T11:42:51.143Z
Learnt from: ashit-rath
Repo: appsmithorg/appsmith PR: 38098
File: app/client/src/git/components/GitQuickActions/index.test.tsx:18-19
Timestamp: 2024-12-11T11:42:51.143Z
Learning: In `app/client/src/git/components/GitQuickActions`, the `Statusbar` component is located in the parent directory, so it should be imported and mocked using `"../Statusbar"`.
Applied to files:
app/client/src/git/components/ConnectModal/ConnectInitialize/ChooseGitProvider.tsxapp/client/src/git/components/common/AddDeployKey.tsxapp/client/src/git/components/common/GitUIComponents.tsxapp/client/src/git/components/ConnectModal/ConnectInitialize/index.tsxapp/client/src/git/components/ConnectModal/ConnectInitialize/GenerateSSH.test.tsx
📚 Learning: 2024-12-10T10:52:57.789Z
Learnt from: brayn003
Repo: appsmithorg/appsmith PR: 38060
File: app/client/src/git/sagas/deleteBranchSaga.ts:38-45
Timestamp: 2024-12-10T10:52:57.789Z
Learning: In the TypeScript file `app/client/src/git/sagas/deleteBranchSaga.ts`, within the `deleteBranchSaga` function, error handling is managed outside the scope of the catch block. Therefore, casting `error` to `string` in this context is acceptable.
Applied to files:
app/client/src/git/sagas/fetchStatusSaga.tsapp/client/src/sagas/DebuggerSagas.ts
📚 Learning: 2024-12-05T11:00:39.952Z
Learnt from: brayn003
Repo: appsmithorg/appsmith PR: 37984
File: app/client/src/git/requests/fetchGitMetadataRequest.ts:6-10
Timestamp: 2024-12-05T11:00:39.952Z
Learning: The `fetchGitMetadataRequest` function in `app/client/src/git/requests/fetchGitMetadataRequest.ts` does not require additional error handling or timeout configuration.
Applied to files:
app/client/src/git/sagas/fetchStatusSaga.ts
📚 Learning: 2024-12-05T10:57:15.397Z
Learnt from: brayn003
Repo: appsmithorg/appsmith PR: 37984
File: app/client/src/git/requests/updateGlobalConfigRequest.ts:9-13
Timestamp: 2024-12-05T10:57:15.397Z
Learning: In the TypeScript files within `app/client/src/git/requests/`, functions should not include internal error handling or request timeouts; they should allow errors to be thrown directly.
Applied to files:
app/client/src/git/sagas/fetchStatusSaga.tsapp/client/src/git/requests/updateGeneratedSSHKeyRequest.types.ts
📚 Learning: 2024-12-05T11:00:45.430Z
Learnt from: brayn003
Repo: appsmithorg/appsmith PR: 37984
File: app/client/src/git/requests/mergeRequest.types.ts:7-8
Timestamp: 2024-12-05T11:00:45.430Z
Learning: In `app/client/src/git/requests/mergeRequest.types.ts`, the keys in the `MergeResponse` interface (`isMergAble`, `status`) are determined by the server and should not be changed, even if they contain typos.
Applied to files:
app/client/src/git/requests/updateGeneratedSSHKeyRequest.types.ts
📚 Learning: 2024-12-05T11:02:12.715Z
Learnt from: brayn003
Repo: appsmithorg/appsmith PR: 37984
File: app/client/src/git/requests/fetchAutocommitProgressRequest.types.ts:3-7
Timestamp: 2024-12-05T11:02:12.715Z
Learning: When reviewing TypeScript interfaces for API responses in `app/client/src/git/requests/`, note that even if interfaces appear identical, they may be intentionally kept separate because the API responses might change independently in the future.
Applied to files:
app/client/src/git/requests/updateGeneratedSSHKeyRequest.types.ts
📚 Learning: 2024-12-05T10:58:20.714Z
Learnt from: brayn003
Repo: appsmithorg/appsmith PR: 37984
File: app/client/src/git/requests/pullRequest.types.ts:1-6
Timestamp: 2024-12-05T10:58:20.714Z
Learning: In `app/client/src/git/requests/pullRequest.types.ts`, the key `isMergeAble` in the `mergeStatus` interface corresponds to the server response and cannot be renamed.
Applied to files:
app/client/src/git/requests/updateGeneratedSSHKeyRequest.types.ts
📚 Learning: 2024-12-16T19:47:33.107Z
Learnt from: brayn003
Repo: appsmithorg/appsmith PR: 38171
File: app/client/src/git/ce/sagas/index.ts:3-8
Timestamp: 2024-12-16T19:47:33.107Z
Learning: When adding actions to `blockingActionSagas` and `nonBlockingActionSagas`, using more specific generic types can lead to TypeScript errors. Therefore, it's acceptable to use `any` for the action payload types in these registries.
Applied to files:
app/client/src/sagas/DebuggerSagas.tsapp/client/src/git/sagas/index.ts
📚 Learning: 2024-10-22T04:46:13.268Z
Learnt from: ashit-rath
Repo: appsmithorg/appsmith PR: 36926
File: app/client/src/ce/pages/Editor/IDE/Header/useLibraryHeaderTitle.ts:1-1
Timestamp: 2024-10-22T04:46:13.268Z
Learning: In this project, importing constants from 'ee/constants/messages' in CE files is a known and acceptable pattern.
Applied to files:
app/client/src/ce/constants/messages.ts
📚 Learning: 2024-12-14T22:24:11.946Z
Learnt from: brayn003
Repo: appsmithorg/appsmith PR: 38155
File: app/client/src/git/store/selectors/gitConfigSelectors.ts:7-9
Timestamp: 2024-12-14T22:24:11.946Z
Learning: The selector `selectFetchGlobalProfileState` in `gitConfigSelectors.ts` is already memoized.
Applied to files:
app/client/src/git/store/selectors/gitGlobalSelectors.ts
🧬 Code graph analysis (17)
app/client/src/git/requests/updateGeneratedSSHKeyRequest.ts (3)
app/client/src/git/index.ts (1)
GitArtifactType(2-2)app/client/src/git/requests/updateGeneratedSSHKeyRequest.types.ts (1)
UpdateGeneratedSSHKeyResponse(6-7)app/client/src/git/requests/constants.ts (1)
GIT_BASE_URL(1-1)
app/client/src/git/hooks/useGenerateDeployKey.ts (4)
app/client/src/git/components/GitContextProvider/index.tsx (1)
useGitContext(30-32)app/client/src/git/hooks/useArtifactSelector.ts (1)
useArtifactSelector(10-30)app/client/src/git/store/selectors/gitGlobalSelectors.ts (2)
selectGenerateSSHKeyModalOpen(35-36)selectUpdateGeneratedSSHKeyState(32-33)app/client/src/git/store/gitGlobalSlice.ts (1)
gitGlobalActions(69-69)
app/client/src/components/editorComponents/Debugger/GitEntityLink.tsx (2)
app/client/src/components/editorComponents/Debugger/DebuggerEntityLink.tsx (2)
EntityLinkProps(30-37)DebuggerEntityLink(39-75)app/client/src/git/hooks/useSettings.ts (1)
useSettings(12-40)
app/client/src/git/components/GenerateDeployKeyModal/index.tsx (3)
app/client/src/git/components/common/types.ts (2)
ConnectFormDataState(5-12)GitProvider(3-3)app/client/src/reducers/uiReducers/gitSyncReducer.ts (1)
GitMetadata(822-836)app/client/src/git/hooks/useMetadata.ts (1)
useMetadata(4-12)
app/client/src/git/sagas/updateGeneratedSSHKeySaga.ts (5)
app/client/src/git/store/types.ts (1)
GitArtifactBasePayload(126-128)app/client/src/git/requests/updateGeneratedSSHKeyRequest.types.ts (1)
UpdateGeneratedSSHKeyResponse(6-7)app/client/src/git/requests/updateGeneratedSSHKeyRequest.ts (1)
updateGeneratedSSHKeyRequest(13-20)app/client/src/sagas/ErrorSagas.tsx (1)
validateResponse(100-155)app/client/src/git/sagas/helpers/handleApiErrors.ts (1)
handleApiErrors(5-29)
app/client/src/git/store/gitGlobalSlice.ts (2)
app/client/src/git/store/actions/updateGeneratedSSHKeyActions.ts (4)
updateGeneratedSSHKeyInitAction(8-17)updateGeneratedSSHKeySuccessAction(19-26)updateGeneratedSSHKeyErrorAction(28-38)resetUpdateGeneratedSSHKeyAction(40-47)app/client/src/git/store/actions/uiActions.ts (1)
toggleGenerateSSHKeyModalAction(40-49)
app/client/src/git/components/DangerZone/DangerZoneView.tsx (3)
app/client/src/utils/AppsmithUtils.tsx (1)
noop(143-145)app/client/src/ce/constants/messages.ts (3)
GENERATE_DEPLOY_KEY_TITLE(1131-1131)GENERATE_DEPLOY_KEY_MESSAGE(1132-1133)GENERATE_DEPLOY_KEY_BTN(1134-1134)app/client/src/pages/Editor/IntegrationEditor/IntegrationStyledComponents.tsx (1)
StyledDivider(4-7)
app/client/src/git/components/SettingsModal/TabGeneral/InvalidKeyWarning.tsx (3)
app/client/src/git/hooks/useStatus.ts (1)
useStatus(8-33)app/client/src/git/hooks/useSettings.ts (1)
useSettings(12-40)app/client/src/ce/constants/messages.ts (2)
GENERATE_DEPLOY_KEY_BTN(1134-1134)INVALID_DEPLOY_KEY_WARNING(1137-1138)
app/client/src/git/components/GenerateDeployKeyModal/GenerateDeployKeyModalView.tsx (5)
app/client/src/git/store/types.ts (1)
GitApiError(25-29)app/client/src/git/components/common/types.ts (1)
ConnectFormDataState(5-12)app/client/src/git/components/common/GitUIComponents.tsx (1)
StyledModalContent(54-62)app/client/src/ce/constants/messages.ts (2)
GENERATE_DEPLOY_KEY_MODAL_TITLE(1135-1135)GENERATE_DEPLOY_KEY_MODAL_WAIT_TEXT(1136-1136)app/client/src/git/components/Statusbar/index.tsx (1)
Statusbar(38-118)
app/client/src/ce/components/editorComponents/Debugger/entityTypeLinkMap.tsx (2)
app/client/src/ce/entities/DataTree/types.ts (1)
ENTITY_TYPE(20-25)app/client/src/components/editorComponents/Debugger/GitEntityLink.tsx (1)
GitEntityLink(7-22)
app/client/src/git/store/actions/updateGeneratedSSHKeyActions.ts (1)
app/client/src/git/store/types.ts (3)
GitGlobalReduxState(95-110)GitArtifactBasePayload(126-128)GitAsyncErrorPayload(130-132)
app/client/src/git/sagas/fetchStatusSaga.ts (1)
app/client/src/ce/entities/DataTree/types.ts (1)
ENTITY_TYPE(20-25)
app/client/src/git/store/actions/uiActions.ts (1)
app/client/src/git/store/types.ts (1)
GitGlobalReduxState(95-110)
app/client/src/git/requests/updateGeneratedSSHKeyRequest.types.ts (1)
app/client/src/git/types.ts (1)
GitArtifact(60-60)
app/client/src/sagas/DebuggerSagas.ts (1)
app/client/src/actions/debuggerActions.ts (2)
addErrorLogs(60-63)debuggerLog(40-43)
app/client/src/git/store/selectors/gitGlobalSelectors.ts (1)
app/client/src/git/store/types.ts (1)
GitRootState(122-124)
app/client/src/git/sagas/index.ts (2)
app/client/src/git/store/gitGlobalSlice.ts (1)
gitGlobalActions(69-69)app/client/src/git/sagas/updateGeneratedSSHKeySaga.ts (1)
updateGeneratedSSHKeySaga(12-46)
🔇 Additional comments (35)
app/client/src/git/components/ConnectModal/ConnectInitialize/index.tsx (1)
4-4: LGTM! Clean refactoring.Import paths correctly updated to reference the shared common modules as part of the component reorganization.
Also applies to: 11-11, 16-16
app/client/src/git/components/ConnectModal/ConnectInitialize/GenerateSSH.test.tsx (1)
7-7: LGTM! Import path correctly updated.The import path for
GitProviderhas been properly updated to reference the centralized types module, consistent with the PR's component reorganization.app/client/src/git/components/ConnectModal/ConnectInitialize/GenerateSSH.tsx (1)
11-11: Import paths are correct and all exports verified.The reorganized imports resolve properly:
DemoImageandErrorCalloutexported from../../common/GitUIComponentsGIT_DEMO_GIFexported from../../common/constantsGitProvidertype exported from../../common/typesNo circular dependencies detected. The relative paths are correct for the file location, and all symbols match their new export locations.
app/client/src/git/components/ConnectModal/ConnectInitialize/ChooseGitProvider.tsx (1)
10-10: All import path updates are correctly refactored.Verification confirms:
- New files exist at specified paths with all required exports ✅
- Old files removed from ConnectModal/ConnectInitialize/ ✅
- No lingering imports from old paths ✅
The remaining relative imports found (in
common/andStatusChanges/directories) are legitimate sibling/local file imports, not references to the old paths.app/client/src/git/components/common/AddDeployKey.tsx (1)
10-10: LGTM! Clean refactor.The import path update aligns with the component reorganization (common.tsx → GitUIComponents.tsx) mentioned in the PR objectives.
app/client/src/git/components/common/GitUIComponents.tsx (1)
54-62: LGTM! Modal styling component added.The StyledModalContent component provides consistent modal dimensions and positioning for the new deploy key generation flow. The hard-coded values and specificity overrides are appropriate for modal UI.
app/client/src/git/components/SettingsModal/TabGeneral/InvalidKeyWarning.tsx (1)
1-44: LGTM! Well-structured warning component.The InvalidKeyWarning component correctly detects the specific error code (AE-GIT-4032) and provides a clear call-to-action. The modal orchestration (closing settings, opening deploy key modal) is cleanly implemented with useCallback.
app/client/src/git/components/SettingsModal/TabGeneral/index.tsx (1)
5-5: LGTM! Clean integration.The InvalidKeyWarning is properly imported and rendered at an appropriate position in the TabGeneral component, ensuring visibility when the invalid key error occurs.
Also applies to: 25-25
app/client/src/git/requests/updateGeneratedSSHKeyRequest.types.ts (1)
1-7: LGTM! Type definitions follow established patterns.The type aliases correctly define the request/response contract for updating the generated SSH key, following the same pattern as other request type files in this codebase.
app/client/src/ce/constants/messages.ts (1)
1131-1138: LGTM! Message constants properly defined.All six new message constants for the deploy key generation flow follow the established pattern and provide clear, user-friendly text for the UI.
app/client/src/git/ce/components/GitModals/index.tsx (1)
10-10: LGTM! Modal properly integrated.The GenerateDeployKeyModal is correctly imported and added to the modal orchestration, following the established pattern for other Git modals in this component. Based on learnings.
Also applies to: 23-23
app/client/src/git/store/types.ts (1)
102-103: LGTM! Redux state properly extended.The two new fields cleanly extend the GitGlobalReduxState to support the deploy key generation modal and its associated async operation. The additions follow the established pattern and integrate well with the existing state structure.
app/client/src/git/store/gitGlobalSlice.ts (3)
17-17: LGTM!The import follows the existing pattern and is correctly grouped with other UI actions.
32-37: LGTM!The action imports follow the established Init/Success/Error/Reset pattern used throughout the codebase.
52-56: LGTM!The reducer registrations are correctly wired and follow the existing patterns in the slice.
Also applies to: 65-65
app/client/src/git/store/helpers/initialState.ts (1)
166-169: LGTM!The initial state additions follow the established patterns for async operations and modal visibility flags.
Also applies to: 175-175
app/client/src/git/components/DangerZone/index.tsx (1)
8-8: LGTM!The hook integration follows the existing container/view pattern used throughout this component.
Also applies to: 24-24, 45-45
app/client/src/git/store/selectors/gitGlobalSelectors.ts (1)
32-36: LGTM!The selectors follow the established pattern for simple property access from the global Git state.
app/client/src/git/sagas/index.ts (1)
45-45: LGTM!The saga is correctly registered as a non-blocking action, consistent with other SSH key operations.
Also applies to: 111-111
app/client/src/git/requests/updateGeneratedSSHKeyRequest.ts (2)
13-20: LGTM!The request function follows the established pattern for Git API requests and correctly delegates error handling to the saga layer.
7-11: Verify the TYPE_MAPPING values align with the backend ssh-keypair endpoint expectations.The mapping converts enum values to uppercase singular format for the query parameter. Unable to confirm the exact backend contract from the codebase—check API documentation or backend implementation to ensure "APPLICATION", "PACKAGE", and "WORKFLOW" are the expected values for the
artifactTypequery parameter.app/client/src/git/store/actions/uiActions.ts (1)
35-49: LGTM!The action correctly operates on global state and follows the established pattern for modal toggle actions.
app/client/src/git/components/DangerZone/DangerZoneView.tsx (3)
9-11: LGTM!The prop addition and default value follow the established patterns in this component.
Also applies to: 63-63, 82-82
108-111: LGTM!The handler correctly closes the settings modal before opening the deploy key modal, following the established pattern.
147-164: LGTM!The UI section follows the established structure and correctly uses the danger zone styling.
app/client/src/git/sagas/updateGeneratedSSHKeySaga.ts (1)
12-46: LGTM!The saga correctly orchestrates the SSH key update flow: validates the response, dispatches success actions, clears console errors, and closes the modal on success. Error handling appropriately uses
handleApiErrorsand dispatches error actions only when mapped errors exist.app/client/src/git/components/GenerateDeployKeyModal/index.tsx (1)
49-118: LGTM!The component properly wires together the hooks, manages form state, and handles modal lifecycle. The reset logic when the modal closes ensures clean state between interactions.
app/client/src/git/components/GenerateDeployKeyModal/GenerateDeployKeyModalView.tsx (1)
51-111: LGTM!The modal view correctly composes the UI elements, conditionally renders the Statusbar during updates, and properly manages button states. The
isSubmitLoadingconstant is clearly documented as unused for this modal flow.app/client/src/git/store/actions/updateGeneratedSSHKeyActions.ts (1)
8-47: LGTM!The action handlers correctly manage the loading and error states for the SSH key update flow. The pattern follows Redux Toolkit conventions with Immer-based mutations.
app/client/src/entities/AppsmithConsole/logtype.ts (1)
18-18: LGTM!The enum addition is consistent with the existing pattern and clearly named for its purpose.
app/client/src/sagas/DebuggerSagas.ts (1)
332-335: LGTM!The case implementation correctly follows the established pattern for similar log types (like MISSING_MODULE) and ensures proper error logging flow.
app/client/src/components/editorComponents/Debugger/GitEntityLink.tsx (1)
7-22: LGTM!The component logic is well-structured. The callback is properly memoized, and props are correctly forwarded to DebuggerEntityLink.
app/client/src/ce/components/editorComponents/Debugger/entityTypeLinkMap.tsx (1)
6-6: LGTM!The import and entity type mapping follow the established pattern consistently.
Also applies to: 13-13
app/client/src/ce/entities/AppsmithConsole/utils.ts (1)
11-11: LGTM!The enum addition is consistent with existing members and clearly named.
app/client/src/ce/components/editorComponents/Debugger/ErrorLogs/getLogIconForEntity.tsx (1)
13-14: LGTM!The import aliasing avoids naming conflicts, and the icon mapping follows the established pattern for other entity types.
Also applies to: 52-54
Description
This PR introduces the ability to regenerate SSH deploy keys for Git-connected applications. This feature allows users to generate new deploy keys when their existing keys are invalid, expired, or need to be rotated.
Design
Changes
Core Features
GenerateDeployKeyModal) that allows users to generate and configure new SSH deploy keysInvalidKeyWarning) that detects invalid deploy keys (error codeAE-GIT-4032) and prompts users to regenerateupdateGeneratedSSHKeyRequest) to persist the most recent regenerated SSH key on the backendUI/UX Improvements
Component Reorganization
ConnectModal/ConnectInitializetocomponents/common:AddDeployKey.tsxCopyButton.tsxconstants.tstypes.tscommon.tsxtoGitUIComponents.tsxfor better clarityAutomation
/ok-to-test tags="@tag.Git"
🔍 Cypress test results
Tip
🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/19032400320
Commit: 5f62a52
Cypress dashboard.
Tags:
@tag.GitSpec:
Mon, 03 Nov 2025 12:02:30 UTC
Communication
Should the DevRel and Marketing teams inform users about this change?
Summary by CodeRabbit
New Features
Debugger Improvements