Skip to content

Commit 55ac824

Browse files
authored
chore: CE compatibility pr for ee fix (#41572)
## Description > [!TIP] > _Add a TL;DR when the description is longer than 500 words or extremely technical (helps the content, marketing, and DevRel team)._ > > _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 https://linear.app/appsmith/issue/APP-14832/support-ssh-keys-for-git-authentication-in-appsmith > [!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/22309832980> > Commit: 49c032c > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=22309832980&attempt=1" target="_blank">Cypress dashboard</a>. > Tags: `@tag.Git` > Spec: > <hr>Mon, 23 Feb 2026 15:11:26 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 - New Features - Connect and Import modals now support using existing SSH keys or generating new ones, with key fetching, selection, and inclusion in submissions. - Integrated SSH Key Manager (behind a feature flag) and exposed SSH key data in Git flows. - Added context provider to enable SSH key workflows in the import experience. - Style - Updated UI copy for Git connection steps (e.g., “Enter Repository URL”, “Set Up SSH Key”, “Configure SSH Key”, and refined SSH URL instructions). - Tests - Adjusted tests to match updated UI text. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent 2b702ee commit 55ac824

19 files changed

Lines changed: 603 additions & 167 deletions

File tree

app/client/src/ce/constants/messages.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1093,7 +1093,7 @@ export const ERROR_GIT_INVALID_REMOTE = () =>
10931093

10941094
// Git Connect V2
10951095
export const CHOOSE_A_GIT_PROVIDER_STEP = () => "Choose a Git provider";
1096-
export const GENERATE_SSH_KEY_STEP = () => "Generate SSH key";
1096+
export const GENERATE_SSH_KEY_STEP = () => "Configure SSH Key";
10971097
export const ADD_DEPLOY_KEY_STEP = () => "Add deploy key";
10981098
export const CHOOSE_GIT_PROVIDER_QUESTION = () =>
10991099
"To begin with, choose your Git service provider";
@@ -1114,19 +1114,18 @@ export const ERROR_REPO_NOT_EMPTY_MESSAGE = () =>
11141114
"Kindly create a new repository and provide its remote SSH URL here. We require an empty repository to continue.";
11151115
export const READ_DOCS = () => "Read Docs";
11161116
export const COPY_SSH_URL_MESSAGE = () =>
1117-
"To generate the SSH Key, in your repo, copy the Remote SSH URL & paste it in the input field below.";
1117+
"Copy the Remote SSH URL from your repository and paste it in the input field below.";
11181118
export const REMOTE_URL_INPUT_LABEL = () => "Remote SSH URL";
11191119
export const HOW_TO_COPY_REMOTE_URL = () =>
11201120
"How to copy & paste SSH remote URL";
11211121
export const ERROR_SSH_KEY_MISCONF_TITLE = () => "SSH key misconfiguration";
11221122
export const ERROR_SSH_KEY_MISCONF_MESSAGE = () =>
11231123
"It seems that your SSH key hasn't been added to your repository. To proceed, please revisit the steps below and configure your SSH key correctly.";
1124-
export const ADD_DEPLOY_KEY_STEP_TITLE = () =>
1125-
"Add deploy key & give write access";
1124+
export const ADD_DEPLOY_KEY_STEP_TITLE = () => "Set Up SSH Key";
11261125
export const HOW_TO_ADD_DEPLOY_KEY = () =>
11271126
"How to paste SSH Key in repo and give write access?";
11281127
export const CONSENT_ADDED_DEPLOY_KEY = () =>
1129-
"I've added the deploy key and gave it write access";
1128+
"I confirm this SSH key has write access to the repository";
11301129
export const PREVIOUS_STEP = () => "Previous step";
11311130
export const GIT_AUTHOR = () => "Git author";
11321131
export const DISCONNECT_GIT = () => "Disconnect Git";

app/client/src/ce/entities/FeatureFlag.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ export const FEATURE_FLAG = {
6767
release_static_url_enabled: "release_static_url_enabled",
6868
release_window_dimensions_enabled: "release_window_dimensions_enabled",
6969
release_branding_logo_resize_enabled: "release_branding_logo_resize_enabled",
70+
release_ssh_key_manager_enabled: "release_ssh_key_manager_enabled",
7071
} as const;
7172

7273
export type FeatureFlag = keyof typeof FEATURE_FLAG;
@@ -122,6 +123,7 @@ export const DEFAULT_FEATURE_FLAG_VALUE: FeatureFlags = {
122123
release_static_url_enabled: false,
123124
release_window_dimensions_enabled: false,
124125
release_branding_logo_resize_enabled: false,
126+
release_ssh_key_manager_enabled: false,
125127
};
126128

127129
export const AB_TESTING_EVENT_KEYS = {
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import noop from "lodash/noop";
2+
import type { SSHKeyOption } from "git/components/common/types";
3+
4+
export interface UseSSHKeyManagerReturn {
5+
isSSHKeyManagerEnabled: boolean;
6+
sshKeys: SSHKeyOption[] | null;
7+
isSSHKeysLoading: boolean;
8+
fetchSSHKeys: () => void;
9+
onCreateSSHKey: () => void;
10+
}
11+
12+
export default function useSSHKeyManager(): UseSSHKeyManagerReturn {
13+
return {
14+
isSSHKeyManagerEnabled: false,
15+
sshKeys: null,
16+
isSSHKeysLoading: false,
17+
fetchSSHKeys: noop,
18+
onCreateSSHKey: noop,
19+
};
20+
}

app/client/src/ce/pages/Applications/index.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ import {
143143
GitImportModal as NewGitImportModal,
144144
GitImportOverrideModal,
145145
} from "git";
146+
import { GitImportContextProvider } from "git-artifact-helpers/application/components";
146147
import OldRepoLimitExceededErrorModal from "pages/Editor/gitSync/RepoLimitExceededErrorModal";
147148
import { trackCurrentDomain } from "utils/multiOrgDomains";
148149
import OrganizationDropdown from "components/OrganizationDropdown";
@@ -154,11 +155,11 @@ function GitModals() {
154155
const isGitModEnabled = useGitModEnabled();
155156

156157
return isGitModEnabled ? (
157-
<>
158+
<GitImportContextProvider>
158159
<NewGitImportModal />
159160
<NewGitRepoLimitErrorModal />
160161
<GitImportOverrideModal />
161-
</>
162+
</GitImportContextProvider>
162163
) : (
163164
<>
164165
<OldGitSyncModal isImport />
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export { default } from "ce/hooks/useSSHKeyManager";
2+
export * from "ce/hooks/useSSHKeyManager";

app/client/src/git-artifact-helpers/application/components/GitApplicationContextProvider.tsx

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import {
2020
getCurrentAppWorkspace,
2121
} from "ee/selectors/selectedWorkspaceSelectors";
2222
import applicationStatusTransformer from "../applicationStatusTransformer";
23+
import useSSHKeyManager from "ee/hooks/useSSHKeyManager";
2324

2425
interface GitApplicationContextProviderProps {
2526
children: React.ReactNode;
@@ -66,19 +67,32 @@ export default function GitApplicationContextProvider({
6667
dispatch(fetchAllApplicationsOfWorkspace());
6768
}, [dispatch]);
6869

70+
const {
71+
fetchSSHKeys,
72+
isSSHKeyManagerEnabled,
73+
isSSHKeysLoading,
74+
onCreateSSHKey,
75+
sshKeys,
76+
} = useSSHKeyManager();
77+
6978
return (
7079
<GitContextProvider
7180
artifact={artifact ?? null}
7281
artifactType={artifactType}
7382
artifacts={artifacts ?? null}
7483
baseArtifactId={artifact?.baseId ?? ""}
7584
fetchArtifacts={fetchApplications}
85+
fetchSSHKeys={fetchSSHKeys}
7686
importWorkspaceId={importWorkspaceId}
7787
isConnectPermitted={isConnectPermitted}
7888
isManageAutocommitPermitted={isManageAutocommitPermitted}
7989
isManageDefaultBranchPermitted={isManageDefaultBranchPermitted}
8090
isManageProtectedBranchesPermitted={isManageProtectedBranchesPermitted}
91+
isSSHKeyManagerEnabled={isSSHKeyManagerEnabled}
92+
isSSHKeysLoading={isSSHKeysLoading}
93+
onCreateSSHKey={onCreateSSHKey}
8194
setImportWorkspaceId={setImportWorkspaceId}
95+
sshKeys={sshKeys}
8296
statusTransformer={applicationStatusTransformer}
8397
workspace={workspace ?? null}
8498
>
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
import React, { useCallback } from "react";
2+
import { useDispatch, useSelector } from "react-redux";
3+
import { GitContextProvider } from "git";
4+
import { getWorkspaceIdForImport } from "ee/selectors/applicationSelectors";
5+
import { setWorkspaceIdForImport } from "ee/actions/applicationActions";
6+
import { getCurrentAppWorkspace } from "ee/selectors/selectedWorkspaceSelectors";
7+
import noop from "lodash/noop";
8+
import useSSHKeyManager from "ee/hooks/useSSHKeyManager";
9+
10+
interface GitImportContextProviderProps {
11+
children: React.ReactNode;
12+
}
13+
14+
const NULL_NOOP = () => null;
15+
16+
/**
17+
* Lightweight GitContextProvider for the Applications page where ImportModal
18+
* is rendered without a current artifact. Provides only SSH key manager data
19+
* and workspace-level fields; artifact-specific fields default to null/noop.
20+
*/
21+
export default function GitImportContextProvider({
22+
children,
23+
}: GitImportContextProviderProps) {
24+
const dispatch = useDispatch();
25+
26+
const workspace = useSelector(getCurrentAppWorkspace);
27+
const importWorkspaceId = useSelector(getWorkspaceIdForImport);
28+
29+
const setImportWorkspaceIdCb = useCallback(() => {
30+
if (workspace?.id) {
31+
dispatch(
32+
setWorkspaceIdForImport({ editorId: "", workspaceId: workspace.id }),
33+
);
34+
}
35+
}, [dispatch, workspace?.id]);
36+
37+
const {
38+
fetchSSHKeys,
39+
isSSHKeyManagerEnabled,
40+
isSSHKeysLoading,
41+
onCreateSSHKey,
42+
sshKeys,
43+
} = useSSHKeyManager();
44+
45+
return (
46+
<GitContextProvider
47+
artifact={null}
48+
artifactType={null}
49+
artifacts={null}
50+
baseArtifactId={null}
51+
fetchArtifacts={noop}
52+
fetchSSHKeys={fetchSSHKeys}
53+
importWorkspaceId={importWorkspaceId}
54+
isConnectPermitted={false}
55+
isManageAutocommitPermitted={false}
56+
isManageDefaultBranchPermitted={false}
57+
isManageProtectedBranchesPermitted={false}
58+
isSSHKeyManagerEnabled={isSSHKeyManagerEnabled}
59+
isSSHKeysLoading={isSSHKeysLoading}
60+
onCreateSSHKey={onCreateSSHKey}
61+
setImportWorkspaceId={setImportWorkspaceIdCb}
62+
sshKeys={sshKeys}
63+
statusTransformer={NULL_NOOP}
64+
workspace={workspace ?? null}
65+
>
66+
{children}
67+
</GitContextProvider>
68+
);
69+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
export { default as GitApplicationContextProvider } from "./GitApplicationContextProvider";
2+
export { default as GitImportContextProvider } from "./GitImportContextProvider";

app/client/src/git/ce/constants/messages.tsx

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ export const IMPORT_OVERRIDE_MODAL = {
1515
export const CONNECT_GIT = {
1616
MODAL_TITLE: "Configure Git",
1717
CHOOSE_PROVIDER_CTA: "Configure Git",
18-
GENERATE_SSH_KEY_CTA: "Generate SSH key",
18+
GENERATE_SSH_KEY_CTA: "Continue",
1919
CONNECT_CTA: "Connect Git",
2020
CHOOSE_PROVIDER_STEP_TITLE: "Choose a Git provider",
21-
GENERATE_SSH_KEY_STEP_TITLE: "Generate SSH key",
22-
ADD_DEPLOY_KEY_STEP_TITLE: "Add deploy key",
21+
GENERATE_SSH_KEY_STEP_TITLE: "Enter Repository URL",
22+
ADD_DEPLOY_KEY_STEP_TITLE: "Set Up SSH Key",
2323
WAIT_TEXT: "Please wait while we connect to Git...",
2424
PREV_STEP: "Previous step",
2525
};
@@ -51,6 +51,12 @@ export const RELEASE_NOTES_INPUT = {
5151
PLACEHOLDER: "Your release notes here",
5252
};
5353

54+
export const ARTIFACT_SSH_KEY_MANAGER = {
55+
NO_KEYS_TITLE: "",
56+
NO_KEYS_DESCRIPTION: "",
57+
CREATE_KEY_CTA: "",
58+
};
59+
5460
export const LATEST_COMMIT_INFO = {
5561
TITLE: "Commit",
5662
LOADING_COMMIT_MESSAGE: "Fetching latest commit...",

app/client/src/git/components/ConnectModal/ConnectInitialize/GenerateSSH.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ describe("GenerateSSH Component", () => {
2626

2727
it("renders the component correctly", () => {
2828
render(<GenerateSSH {...defaultProps} />);
29-
expect(screen.getByText("Generate SSH key")).toBeInTheDocument();
29+
expect(screen.getByText("Configure SSH Key")).toBeInTheDocument();
3030
expect(
3131
screen.getByTestId("t--git-connect-remote-input"),
3232
).toBeInTheDocument();

0 commit comments

Comments
 (0)