fix: added Redeploy button that allows the user to sync the latest changes#41459
fix: added Redeploy button that allows the user to sync the latest changes#41459
Conversation
… between edit and view mode. This button shows up only when lastDeployedAt is less than modifiedAt of the application and when there are no commits to be pushed.
WalkthroughAdds a redeploy flow across UI, Redux, sagas, selectors, analytics and messages, plus registers a new "rocket-dot" icon in two design-system icon maps and minor UI wiring for redeploy indicators and actions. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant User
participant UI as TabDeployView / DeployButton
participant Hook as useRedeploy
participant Store as Redux Store
participant Saga as redeployApplicationSaga
participant API as ApplicationApi
participant Editor as EditorReducer
User->>UI: Click "Redeploy" button
UI->>Hook: call redeploy()
Hook->>Store: dispatch(REDEPLOY_APPLICATION_INIT { applicationId })
Store->>Saga: takeLatest(REDEPLOY_APPLICATION_INIT) triggers saga
Saga->>Store: select current application & page IDs
Saga->>Saga: log analytics ("REDEPLOY_APP")
Saga->>API: call publishApplication(request)
API-->>Saga: response
alt publish success
Saga->>Store: dispatch(fetchApplication(mode=EDIT))
Saga->>Store: dispatch(REDEPLOY_APPLICATION_SUCCESS)
Store->>Editor: set loadingStates.redeploying = false, redeployingError = false
Store->>UI: selectors update (isRedeploying=false)
else publish error
Saga->>Store: dispatch(REDEPLOY_APPLICATION_ERROR)
Store->>Editor: set loadingStates.redeploying = false, redeployingError = true
Store->>UI: selectors update (isRedeploying=false, error=true)
end
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ 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 |
…lso in the scenario where lastDeployedAt value is null but there are no changes to be pushed.
…e page in new tab. Added its respective sagas, selectors, redux constants. Also added RedeployWarning callout component.
… redeploy is needed. Using that redeployTrigger as the logic directly in TabDeployView. Also sending that value to RedeployWarning to decide what message to show.
…cases where redeploy is needed for packages or app, or when there are uncommited changes.
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (5)
app/client/src/ce/constants/messages.ts (1)
1057-1061: Redeploy copy is clear; consider future use ofredeployTriggerThe new
REDEPLOY_WARNING_MESSAGE,REDEPLOY_BUTTON_TOOLTIP, andREDEPLOY_MENU_OPTIONstrings are concise and consistent with existing deploy terminology. The optionalredeployTriggerargument is currently unused but safely ignored via eslint suppression.If you don’t foresee multiple redeploy reasons, you could drop the unused parameter to reduce noise; otherwise, consider wiring it into the message later (e.g., to distinguish first‑time deployment vs. re‑sync scenarios).
Also applies to: 1471-1474, 1487-1488
app/client/src/git/components/OpsModal/TabDeploy/index.tsx (1)
2-2: Redeploy wiring in TabDeploy is clean; consider centralizing deploy metadata laterUsing
useRedeployfor{ isRedeploying, redeploy }anduseSelector(getRedeployApplicationTrigger)keeps this component lean and matches existing hook/selector patterns. PassingisRedeploying,redeploy, andredeployTriggerthrough toTabDeployViewgives the view layer everything it needs to control the new “Redeploy” UX.Longer‑term, you might consider sourcing
lastDeployedAtfrom the same place asgetRedeployApplicationTrigger(or vice versa) to avoid any subtle drift between the Git artifact metadata andcurrentApplication, but that’s an optional cleanup rather than a blocker.Also applies to: 10-10, 13-13, 17-17, 25-25, 52-56
app/client/src/ce/selectors/applicationSelectors.tsx (1)
218-242: Selector logic looks solid.The timestamp comparison with a 1-second buffer is reasonable for handling precision issues. The selector correctly identifies when redeployment is needed.
Consider extracting "PENDING_DEPLOYMENT" as a named constant for better maintainability if this string is used elsewhere or might need to change:
+export const REDEPLOY_STATUS = { + PENDING_DEPLOYMENT: "PENDING_DEPLOYMENT", +} as const; + export const getRedeployApplicationTrigger = ( state: DefaultRootState, ): string | null => { const currentApplication = getCurrentApplication(state); if (!currentApplication?.modifiedAt) { return null; } if (!currentApplication?.lastDeployedAt) { - return "PENDING_DEPLOYMENT"; + return REDEPLOY_STATUS.PENDING_DEPLOYMENT; } const lastDeployedAtMs = new Date( currentApplication.lastDeployedAt, ).getTime(); const modifiedAtMs = new Date(currentApplication.modifiedAt).getTime(); // If modifiedAt is greater than lastDeployedAt by more than 1 second, deployment is needed if (modifiedAtMs - lastDeployedAtMs > 1000) { - return "PENDING_DEPLOYMENT"; + return REDEPLOY_STATUS.PENDING_DEPLOYMENT; } return null; };app/client/src/ce/sagas/ApplicationSagas.tsx (1)
227-306: Implementation is correct, but consider reducing duplication.The saga logic is sound and follows the existing publish pattern. However,
redeployApplicationSagaandpublishApplicationSagashare significant logic (navigation settings collection, analytics structure, API call, fetch flow).Consider extracting shared logic into a helper function to reduce duplication:
function* collectNavigationSettingsWithPrefix( currentApplication: ApplicationPayload | undefined, ) { const navigationSettingsWithPrefix: Record< string, NavigationSetting[keyof NavigationSetting] > = {}; if (currentApplication?.applicationDetail?.navigationSetting) { const settingKeys = objectKeys( currentApplication.applicationDetail.navigationSetting, ) as Array<keyof NavigationSetting>; settingKeys.map((key: keyof NavigationSetting) => { if (currentApplication.applicationDetail?.navigationSetting?.[key]) { const value: NavigationSetting[keyof NavigationSetting] = currentApplication.applicationDetail.navigationSetting[key]; navigationSettingsWithPrefix[`navigationSetting_${key}`] = value; } }); } return navigationSettingsWithPrefix; } function* logPublishAnalytics( currentApplication: ApplicationPayload | undefined, eventName: string, ) { if (!currentApplication) return; const appName = currentApplication.name; const appId = currentApplication?.id; const pageCount = currentApplication?.pages?.length; const navigationSettingsWithPrefix = yield call( collectNavigationSettingsWithPrefix, currentApplication, ); AnalyticsUtil.logEvent(eventName, { appId, appName, pageCount, ...navigationSettingsWithPrefix, isPublic: !!currentApplication?.isPublic, templateTitle: currentApplication?.forkedFromTemplateTitle, }); }Then both sagas can call these helpers, reducing duplication and improving maintainability.
app/client/src/pages/AppIDE/layouts/components/Header/DeployButton.tsx (1)
103-118: Icon logic is correct, minor simplification possible.The function correctly shows "rocket-dot" when action is needed (pending commits or redeploy required).
The two conditions both return "rocket-dot" and could be combined for conciseness:
const getStartIcon = useCallback(() => { if (isGitConnected && !gitStatusState?.loading) { const hasPendingCommits = gitStatusState?.value && !gitStatusState.value.isClean; - if (!hasPendingCommits && redeployTrigger) { - return "rocket-dot"; - } - - if (hasPendingCommits) { + if (hasPendingCommits || redeployTrigger) { return "rocket-dot"; } } return "rocket"; }, [isGitConnected, gitStatusState, redeployTrigger]);The current structure is fine if you prefer the explicit separation for clarity.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (2)
app/client/packages/design-system/ads/src/__assets__/icons/ads/rocket-dot.svgis excluded by!**/*.svgapp/client/packages/design-system/widgets-old/src/assets/icons/ads/rocket-dot.svgis excluded by!**/*.svg
📒 Files selected for processing (17)
app/client/packages/design-system/ads/src/Icon/Icon.provider.tsx(2 hunks)app/client/packages/design-system/widgets-old/src/Icon/index.tsx(2 hunks)app/client/src/ce/actions/applicationActions.ts(1 hunks)app/client/src/ce/constants/ReduxActionConstants.tsx(2 hunks)app/client/src/ce/constants/messages.ts(3 hunks)app/client/src/ce/reducers/uiReducers/editorReducer.tsx(3 hunks)app/client/src/ce/sagas/ApplicationSagas.tsx(1 hunks)app/client/src/ce/selectors/applicationSelectors.tsx(1 hunks)app/client/src/ce/utils/analyticsUtilTypes.ts(2 hunks)app/client/src/ee/sagas/ApplicationSagas.tsx(2 hunks)app/client/src/git/components/OpsModal/TabDeploy/RedeployWarning.tsx(1 hunks)app/client/src/git/components/OpsModal/TabDeploy/TabDeployView.tsx(10 hunks)app/client/src/git/components/OpsModal/TabDeploy/index.tsx(2 hunks)app/client/src/git/hooks/useRedeploy.ts(1 hunks)app/client/src/git/types.ts(1 hunks)app/client/src/pages/AppIDE/layouts/components/Header/DeployButton.tsx(4 hunks)app/client/src/selectors/editorSelectors.tsx(1 hunks)
🧰 Additional context used
🧠 Learnings (18)
📚 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/git/types.tsapp/client/src/pages/AppIDE/layouts/components/Header/DeployButton.tsx
📚 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/types.ts
📚 Learning: 2025-10-30T07:17:49.646Z
Learnt from: ashit-rath
Repo: appsmithorg/appsmith PR: 41312
File: app/client/src/ce/reducers/uiReducers/applicationsReducer.tsx:817-883
Timestamp: 2025-10-30T07:17:49.646Z
Learning: In app/client/src/ce/reducers/uiReducers/applicationsReducer.tsx, the isErrorPersistingAppSlug flag is unused and should be removed. There is no corresponding selector to expose it, and no handlers set it to true.
Applied to files:
app/client/src/git/components/OpsModal/TabDeploy/index.tsxapp/client/src/ce/reducers/uiReducers/editorReducer.tsxapp/client/src/selectors/editorSelectors.tsxapp/client/src/ce/selectors/applicationSelectors.tsx
📚 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/components/OpsModal/TabDeploy/index.tsxapp/client/src/git/hooks/useRedeploy.tsapp/client/src/pages/AppIDE/layouts/components/Header/DeployButton.tsxapp/client/src/git/components/OpsModal/TabDeploy/TabDeployView.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/components/OpsModal/TabDeploy/index.tsxapp/client/src/git/hooks/useRedeploy.tsapp/client/src/pages/AppIDE/layouts/components/Header/DeployButton.tsx
📚 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/components/OpsModal/TabDeploy/index.tsxapp/client/src/git/hooks/useRedeploy.ts
📚 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/components/OpsModal/TabDeploy/index.tsx
📚 Learning: 2024-10-21T13:18:10.293Z
Learnt from: brayn003
Repo: appsmithorg/appsmith PR: 36989
File: app/client/packages/git/src/actions/helpers/createSingleArtifactAction.ts:12-41
Timestamp: 2024-10-21T13:18:10.293Z
Learning: In Redux Toolkit (TypeScript), since it uses Immer internally, assigning the same initial state object across artifacts does not lead to shared mutable state issues.
Applied to files:
app/client/src/ce/reducers/uiReducers/editorReducer.tsx
📚 Learning: 2025-10-28T03:30:58.299Z
Learnt from: ashit-rath
Repo: appsmithorg/appsmith PR: 41312
File: app/client/src/sagas/InitSagas.ts:260-271
Timestamp: 2025-10-28T03:30:58.299Z
Learning: In app/client/src/sagas/InitSagas.ts, when constructing consolidatedApiParams for static page URLs, the code intentionally reuses applicationId and defaultPageId fields to pass staticApplicationSlug and staticPageSlug values respectively. This is by design, even though ConsolidatedApiParams type has dedicated staticApplicationSlug and staticPageSlug fields.
Applied to files:
app/client/src/ce/sagas/ApplicationSagas.tsxapp/client/src/ee/sagas/ApplicationSagas.tsx
📚 Learning: 2024-12-11T08:31:10.356Z
Learnt from: brayn003
Repo: appsmithorg/appsmith PR: 38088
File: app/client/src/git/components/GitQuickActions/helpers/getPullButtonStatus.ts:16-21
Timestamp: 2024-12-11T08:31:10.356Z
Learning: In the file `app/client/src/git/components/GitQuickActions/helpers/getPullButtonStatus.ts`, when defining the function `getPullBtnStatus`, it's acceptable to use default parameters in destructuring. Do not suggest removing default parameters in this context.
Applied to files:
app/client/src/pages/AppIDE/layouts/components/Header/DeployButton.tsxapp/client/src/git/components/OpsModal/TabDeploy/TabDeployView.tsx
📚 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/pages/AppIDE/layouts/components/Header/DeployButton.tsx
📚 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/OpsModal/TabDeploy/TabDeployView.tsx
📚 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/components/OpsModal/TabDeploy/TabDeployView.tsx
📚 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/components/OpsModal/TabDeploy/TabDeployView.tsx
📚 Learning: 2024-11-12T07:37:42.598Z
Learnt from: ankitakinger
Repo: appsmithorg/appsmith PR: 37330
File: app/client/src/pages/Editor/gitSync/components/GitChangesList/StaticChange.tsx:52-52
Timestamp: 2024-11-12T07:37:42.598Z
Learning: The icon provider components in `app/client/packages/design-system/widgets-old/src/Icon/index.tsx` and `app/client/packages/design-system/ads/src/Icon/Icon.provider.tsx` should provide both `settings-2-line` and `settings-v3` icons and should not be updated to remove the old icon.
Applied to files:
app/client/packages/design-system/ads/src/Icon/Icon.provider.tsxapp/client/packages/design-system/widgets-old/src/Icon/index.tsx
📚 Learning: 2024-11-12T11:42:28.998Z
Learnt from: ankitakinger
Repo: appsmithorg/appsmith PR: 37330
File: app/client/src/pages/common/SearchBar/HomepageHeaderAction.tsx:95-95
Timestamp: 2024-11-12T11:42:28.998Z
Learning: In icon provider components within the TypeScript/React codebase, old settings icons like `"settings-2-line"` and `"settings-control"` are intentionally provided alongside new icons. These references are acceptable and should not be flagged for updates.
Applied to files:
app/client/packages/design-system/ads/src/Icon/Icon.provider.tsxapp/client/packages/design-system/widgets-old/src/Icon/index.tsx
📚 Learning: 2024-10-08T15:32:34.114Z
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-10-08T15:32:34.114Z
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/packages/design-system/ads/src/Icon/Icon.provider.tsxapp/client/packages/design-system/widgets-old/src/Icon/index.tsx
📚 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/ee/sagas/ApplicationSagas.tsx
🧬 Code graph analysis (7)
app/client/src/ce/actions/applicationActions.ts (1)
app/client/src/ce/constants/ReduxActionConstants.tsx (1)
ReduxActionTypes(1328-1373)
app/client/src/git/components/OpsModal/TabDeploy/RedeployWarning.tsx (1)
app/client/src/ce/constants/messages.ts (1)
REDEPLOY_WARNING_MESSAGE(1057-1061)
app/client/src/git/components/OpsModal/TabDeploy/index.tsx (3)
app/client/src/git/components/GitContextProvider/index.tsx (1)
useGitContext(30-32)app/client/src/ce/selectors/applicationSelectors.tsx (1)
getRedeployApplicationTrigger(218-242)app/client/src/git/hooks/useRedeploy.ts (1)
useRedeploy(9-24)
app/client/src/git/hooks/useRedeploy.ts (2)
app/client/src/selectors/editorSelectors.tsx (2)
getCurrentApplicationId(246-247)getIsRedeployingApplication(159-160)app/client/src/ce/actions/applicationActions.ts (1)
redeployApplication(188-195)
app/client/src/pages/AppIDE/layouts/components/Header/DeployButton.tsx (4)
app/client/src/git/hooks/useArtifactSelector.ts (1)
useArtifactSelector(10-30)app/client/src/git/store/selectors/gitArtifactSelectors.ts (1)
selectStatusState(106-109)app/client/src/ce/selectors/applicationSelectors.tsx (1)
getRedeployApplicationTrigger(218-242)app/client/src/ce/constants/messages.ts (3)
UNCOMMITTED_CHANGES(1024-1024)REDEPLOY_BUTTON_TOOLTIP(1471-1474)DEPLOY_BUTTON_TOOLTIP(1469-1470)
app/client/src/git/components/OpsModal/TabDeploy/TabDeployView.tsx (3)
app/client/src/utils/AppsmithUtils.tsx (1)
noop(143-145)app/client/src/pages/Editor/gitSync/components/DeployPreview.tsx (1)
DeployPreview(36-79)app/client/src/ce/constants/messages.ts (1)
REDEPLOY_MENU_OPTION(1487-1487)
app/client/src/ee/sagas/ApplicationSagas.tsx (1)
app/client/src/ce/sagas/ApplicationSagas.tsx (1)
redeployApplicationSaga(227-306)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (8)
- GitHub Check: client-check-cyclic-deps / check-cyclic-dependencies
- GitHub Check: client-lint / client-lint
- GitHub Check: client-prettier / prettier-check
- GitHub Check: client-build / client-build
- GitHub Check: client-unit-tests / client-unit-tests
- GitHub Check: chromatic-deployment
- GitHub Check: storybook-tests
- GitHub Check: chromatic-deployment
🔇 Additional comments (19)
app/client/packages/design-system/ads/src/Icon/Icon.provider.tsx (1)
207-209: Rocket-dot icon wiring is consistent and type-safeImporting
RocketDotIconviaimportSvgand adding"rocket-dot": RocketDotIcontoICON_LOOKUPmatches the existing icon patterns and keepsIconCollection/IconNamesin sync. No issues from a typing or runtime perspective.Also applies to: 1595-1595
app/client/packages/design-system/widgets-old/src/Icon/index.tsx (1)
417-419: Rocket-dot added correctly to legacy icon map
RocketDotIconis imported and exposed via"rocket-dot": <RocketDotIcon />inICON_LOOKUPin line with the existing icon conventions here and stays consistent with the ADS provider’s key. Looks good.Also applies to: 875-875
app/client/src/git/types.ts (1)
25-42:modifiedAtfield addition looks correct; verify API contract and null-handling at call sitesThe new
modifiedAt?: string;onGitApplicationArtifactis consistent with the existinglastDeployedAt?: string;and fits the redeploy logic needs.Two things to double‑check outside this file:
- Backend/API payloads – Confirm all endpoints populating
GitApplicationArtifactactually sendmodifiedAt(or that the redeploy logic gracefully handles it beingundefinedfor older payloads).- Selector/logic usage – Wherever you compare
lastDeployedAtvsmodifiedAt, ensure you handle missing timestamps explicitly so redeploy indicators don’t show up incorrectly or break when one side isundefined.If packages will ever support a similar redeploy flow, consider whether
GitPackageArtifactshould also gain amodifiedAtfield for consistency, otherwise this asymmetry is fine as‑is.app/client/src/ce/utils/analyticsUtilTypes.ts (1)
45-46: Redeploy analytics event names look consistent
REDEPLOY_APPandGS_REDEPLOY_APPLICATION_CLICKfollow the existing naming/placement conventions and safely extend theEventNameunion.Also applies to: 206-207
app/client/src/ce/constants/ReduxActionConstants.tsx (1)
1003-1023: Redeploy Redux action constants are well‑integrated
REDEPLOY_APPLICATION_INIT/SUCCESS/ERRORare added in the right groups, align with existing publish action naming, and are correctly surfaced viaReduxActionTypes,ReduxActionErrorTypes, andtoastMessageErrorTypes.Also applies to: 1025-1034
app/client/src/selectors/editorSelectors.tsx (1)
159-164: Redeploy selectors align with existing loading state patterns
getIsRedeployingApplicationandgetRedeployingErrorfollow the same structure as the publish selectors and correctly read fromstate.ui.editor.loadingStates. This gives a clean surface for UI/hooks likeuseRedeploy.app/client/src/ee/sagas/ApplicationSagas.tsx (1)
37-40: LGTM! Redeploy saga wired correctly.The takeLatest watcher follows the same pattern as the existing publish flow and is positioned appropriately after PUBLISH_APPLICATION_INIT.
app/client/src/git/hooks/useRedeploy.ts (1)
1-24: LGTM! Clean hook implementation.The conditional dispatch check and dependency array are correct. The hook follows React best practices.
app/client/src/ce/actions/applicationActions.ts (1)
188-195: LGTM! Action creator follows established patterns.The implementation mirrors the existing
publishApplicationaction creator and maintains consistency with Redux conventions.app/client/src/git/components/OpsModal/TabDeploy/RedeployWarning.tsx (1)
1-42: Component implementation looks good.The warning callout is properly structured with appropriate styling and test ID. The link to documentation provides helpful context for users.
app/client/src/pages/AppIDE/layouts/components/Header/DeployButton.tsx (1)
53-72: LGTM! Tooltip logic correctly prioritizes states.The cascading conditional logic appropriately handles package upgrade, git status, and redeploy scenarios, with proper fallback to the default tooltip.
app/client/src/ce/reducers/uiReducers/editorReducer.tsx (1)
21-22: LGTM! Reducer state management follows established patterns.The redeploy loading states are managed consistently with the existing publish flow. The handlers correctly update state for INIT, ERROR, and SUCCESS actions.
Also applies to: 122-143, 365-366
app/client/src/git/components/OpsModal/TabDeploy/TabDeployView.tsx (7)
19-19: LGTM!New imports for redeploy functionality are correctly placed and follow established patterns.
Also applies to: 41-41
88-93: LGTM!New props for redeploy state are well-typed and defaults follow the established pattern in this component. Based on learnings, using default parameters in destructuring is acceptable here.
Also applies to: 111-115
149-151: LGTM!The
shouldShowRedeploycondition correctly gates the redeploy UI to scenarios where there are no pending changes and a redeploy trigger exists.
276-281: LGTM!Analytics logging and callback structure are consistent with other trigger functions in this component (
triggerCommit,triggerPull).
324-326: LGTM!
RedeployWarningis correctly guarded byshouldShowRedeploy, which ensuresredeployTriggeris non-null when rendered.
433-442: LGTM!Redeploy button follows the established button patterns in this footer. The
isLoadingstate prevents double-clicks, and test ID is properly assigned.
416-416: LGTM!Good addition of
!shouldShowRedeployto ensure mutual exclusivity between the commit and redeploy buttons.
app/client/src/git/components/OpsModal/TabDeploy/TabDeployView.tsx
Outdated
Show resolved
Hide resolved
| `Some changes may reappear after discarding them, these changes support new features in Appsmith. You can safely commit them to your repository.`; | ||
| export const REDEPLOY_WARNING_MESSAGE = ( | ||
| // eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
| redeployTrigger?: string, |
There was a problem hiding this comment.
We need this so that EE rep can use the same function for the case redeployment is because of packages getting updated
app/client/src/pages/AppIDE/layouts/components/Header/DeployButton.tsx
Outdated
Show resolved
Hide resolved
app/client/src/pages/AppIDE/layouts/components/Header/DeployButton.tsx
Outdated
Show resolved
Hide resolved
…r getRedeploymentTrigger.
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (3)
app/client/src/ce/selectors/applicationSelectors.tsx (2)
218-221: Unused enum value: PendingDeploymentWithPackage.The enum value
PendingDeploymentWithPackageis declared but never returned bygetRedeployApplicationTrigger. Remove it unless you plan to use it soon.export enum RedeployTrigger { PendingDeployment = "PENDING_DEPLOYMENT", - PendingDeploymentWithPackage = "PENDING_DEPLOYMENT_WITH_PACKAGE", }
223-246: Logic looks good.The selector correctly compares timestamps to determine if redeployment is needed. The 1-second threshold accounts for minor timing discrepancies.
Optional: Extract the 1000ms threshold into a named constant for clarity:
+const DEPLOYMENT_TIMESTAMP_THRESHOLD_MS = 1000; + export const getRedeployApplicationTrigger = createSelector( getCurrentApplication, (currentApplication): RedeployTrigger | null => { // ... existing code ... // If modifiedAt is greater than lastDeployedAt by more than 1 second, deployment is needed - if (modifiedAtMs - lastDeployedAtMs > 1000) { + if (modifiedAtMs - lastDeployedAtMs > DEPLOYMENT_TIMESTAMP_THRESHOLD_MS) { return RedeployTrigger.PendingDeployment; }app/client/src/pages/AppIDE/layouts/components/Header/DeployButton.tsx (1)
53-72: Extract duplicate logic.The
hasPendingCommitscalculation appears in bothtooltipTextandstartIconuseMemo blocks. Extract it to reduce duplication.+ const hasPendingCommits = useMemo(() => { + return ( + isGitConnected && + !gitStatusState?.loading && + gitStatusState?.value && + !gitStatusState.value.isClean + ); + }, [isGitConnected, gitStatusState]); const tooltipText = useMemo(() => { if (isPackageUpgrading) { return createMessage(PACKAGE_UPGRADING_ACTION_STATUS, "deploy this app"); } - if (isGitConnected && !gitStatusState?.loading) { - const hasPendingCommits = - gitStatusState?.value && !gitStatusState.value.isClean; - - if (hasPendingCommits) { + if (hasPendingCommits) { return createMessage(UNCOMMITTED_CHANGES); - } + } + if (isGitConnected && !gitStatusState?.loading) { if (redeployTrigger) { return REDEPLOY_BUTTON_TOOLTIP(redeployTrigger); } } return createMessage(DEPLOY_BUTTON_TOOLTIP); - }, [isPackageUpgrading, isGitConnected, gitStatusState, redeployTrigger]); + }, [isPackageUpgrading, hasPendingCommits, isGitConnected, gitStatusState, redeployTrigger]); const startIcon = useMemo(() => { - if (isGitConnected && !gitStatusState?.loading) { - const hasPendingCommits = - gitStatusState?.value && !gitStatusState.value.isClean; - - if (!hasPendingCommits && redeployTrigger) { + if (!hasPendingCommits && redeployTrigger) { return "rocket-dot"; - } + } - if (hasPendingCommits) { + if (hasPendingCommits) { return "rocket-dot"; - } } return "rocket"; - }, [isGitConnected, gitStatusState, redeployTrigger]); + }, [hasPendingCommits, redeployTrigger]);Also applies to: 103-118
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
app/client/src/ce/selectors/applicationSelectors.tsx(1 hunks)app/client/src/pages/AppIDE/layouts/components/Header/DeployButton.tsx(4 hunks)
🧰 Additional context used
🧠 Learnings (6)
📚 Learning: 2025-10-30T07:17:49.646Z
Learnt from: ashit-rath
Repo: appsmithorg/appsmith PR: 41312
File: app/client/src/ce/reducers/uiReducers/applicationsReducer.tsx:817-883
Timestamp: 2025-10-30T07:17:49.646Z
Learning: In app/client/src/ce/reducers/uiReducers/applicationsReducer.tsx, the isErrorPersistingAppSlug flag is unused and should be removed. There is no corresponding selector to expose it, and no handlers set it to true.
Applied to files:
app/client/src/ce/selectors/applicationSelectors.tsxapp/client/src/pages/AppIDE/layouts/components/Header/DeployButton.tsx
📚 Learning: 2024-12-11T08:31:10.356Z
Learnt from: brayn003
Repo: appsmithorg/appsmith PR: 38088
File: app/client/src/git/components/GitQuickActions/helpers/getPullButtonStatus.ts:16-21
Timestamp: 2024-12-11T08:31:10.356Z
Learning: In the file `app/client/src/git/components/GitQuickActions/helpers/getPullButtonStatus.ts`, when defining the function `getPullBtnStatus`, it's acceptable to use default parameters in destructuring. Do not suggest removing default parameters in this context.
Applied to files:
app/client/src/pages/AppIDE/layouts/components/Header/DeployButton.tsx
📚 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/pages/AppIDE/layouts/components/Header/DeployButton.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/pages/AppIDE/layouts/components/Header/DeployButton.tsx
📚 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/pages/AppIDE/layouts/components/Header/DeployButton.tsx
📚 Learning: 2025-02-20T13:36:10.743Z
Learnt from: alex-golovanov
Repo: appsmithorg/appsmith PR: 39379
File: app/client/src/pages/AppIDE/components/LibrariesList/JSLibrariesSection.tsx:0-0
Timestamp: 2025-02-20T13:36:10.743Z
Learning: When reviewing React components, ensure that useMemo and useEffect hooks include all variables used within their callbacks in their dependency arrays to prevent stale values and potential bugs.
Applied to files:
app/client/src/pages/AppIDE/layouts/components/Header/DeployButton.tsx
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (8)
- GitHub Check: client-unit-tests / client-unit-tests
- GitHub Check: client-prettier / prettier-check
- GitHub Check: client-check-cyclic-deps / check-cyclic-dependencies
- GitHub Check: client-lint / client-lint
- GitHub Check: client-build / client-build
- GitHub Check: storybook-tests
- GitHub Check: chromatic-deployment
- GitHub Check: chromatic-deployment
🔇 Additional comments (1)
app/client/src/pages/AppIDE/layouts/components/Header/DeployButton.tsx (1)
50-51: LGTM!The new selectors are properly initialized.
…s as it is already being logged in TabDeployView component.
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
app/client/src/ce/sagas/ApplicationSagas.tsx (1)
227-268: Redeploy saga mirrors publish flow; consider extracting shared helper and analytics parityFunctionally this looks correct and consistent with
publishApplicationSaga(publish → validate →FETCH_APPLICATION_INIT→ wait forFETCH_APPLICATION_SUCCESS/ERROR), so no blockers from my side.You might want to:
- Extract the common “publish + validate + fetch + wait” sequence used here and in
publishApplicationSagainto a small helper to avoid duplication and keep behaviour in sync if the flow changes later.- If you intend to track redeploys (there’s a
REDEPLOY_APPanalytics event type elsewhere in the PR), consider logging that here (potentially via the same helper) for parity with thePUBLISH_APPevent, unless it’s already captured in the UI layer.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
app/client/src/ce/sagas/ApplicationSagas.tsx(1 hunks)
🧰 Additional context used
🧠 Learnings (6)
📚 Learning: 2025-10-28T03:30:58.299Z
Learnt from: ashit-rath
Repo: appsmithorg/appsmith PR: 41312
File: app/client/src/sagas/InitSagas.ts:260-271
Timestamp: 2025-10-28T03:30:58.299Z
Learning: In app/client/src/sagas/InitSagas.ts, when constructing consolidatedApiParams for static page URLs, the code intentionally reuses applicationId and defaultPageId fields to pass staticApplicationSlug and staticPageSlug values respectively. This is by design, even though ConsolidatedApiParams type has dedicated staticApplicationSlug and staticPageSlug fields.
Applied to files:
app/client/src/ce/sagas/ApplicationSagas.tsx
📚 Learning: 2024-07-26T21:12:57.228Z
Learnt from: ankitakinger
Repo: appsmithorg/appsmith PR: 29965
File: app/client/src/ce/sagas/ApplicationSagas.tsx:736-742
Timestamp: 2024-07-26T21:12:57.228Z
Learning: The use of `editorId` instead of `appId` is an intentional change in the PR and is part of reverting to a previous functionality.
Applied to files:
app/client/src/ce/sagas/ApplicationSagas.tsx
📚 Learning: 2024-10-22T07:08:25.558Z
Learnt from: rishabhrathod01
Repo: appsmithorg/appsmith PR: 37001
File: app/server/appsmith-server/src/main/java/com/appsmith/server/layouts/UpdateLayoutServiceCEImpl.java:136-138
Timestamp: 2024-10-22T07:08:25.558Z
Learning: When a `Span` is started before a `try-catch` block and ended after it, there is no need to end the span inside the catch block.
Applied to files:
app/client/src/ce/sagas/ApplicationSagas.tsx
📚 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/ce/sagas/ApplicationSagas.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/ce/sagas/ApplicationSagas.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/ce/sagas/ApplicationSagas.tsx
🧬 Code graph analysis (1)
app/client/src/ce/sagas/ApplicationSagas.tsx (4)
app/client/src/ce/api/ApplicationApi.tsx (4)
PublishApplicationRequest(19-21)PublishApplicationResponse(28-28)ApplicationApi(291-567)fetchApplication(329-333)app/client/src/sagas/ErrorSagas.tsx (1)
validateResponse(100-155)app/client/src/selectors/editorSelectors.tsx (2)
getCurrentApplicationId(246-247)getCurrentPageId(129-130)app/client/src/ce/actions/applicationActions.ts (1)
fetchApplication(47-52)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (8)
- GitHub Check: client-build / client-build
- GitHub Check: client-lint / client-lint
- GitHub Check: client-prettier / prettier-check
- GitHub Check: client-unit-tests / client-unit-tests
- GitHub Check: client-check-cyclic-deps / check-cyclic-dependencies
- GitHub Check: storybook-tests
- GitHub Check: chromatic-deployment
- GitHub Check: chromatic-deployment
app/client/src/pages/AppIDE/layouts/components/Header/DeployButton.tsx
Outdated
Show resolved
Hide resolved
…onstants along with object mapping for messages. Using the introduced const in places where redeployment trigger is used. Minor fixes in ApplicationSagas as well
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (3)
app/client/src/git/components/OpsModal/TabDeploy/RedeployWarning.tsx (1)
18-43: Avoid rendering an empty warning whenredeployTriggeris nullRight now the Callout always renders, and the heading text becomes empty if
redeployTriggerisnull. To avoid a blank warning (and to be defensive against future changes), you can short‑circuit the component and then drop the inline&&:const RedeployWarning: React.FC<RedeployWarningProps> = ({ redeployTrigger, }) => { - const redeployDocUrl = - "https://docs.appsmith.com/advanced-concepts/version-control-with-git/commit-and-push"; + const redeployDocUrl = + "https://docs.appsmith.com/advanced-concepts/version-control-with-git/commit-and-push"; + + if (!redeployTrigger) { + return null; + } @@ - <Text kind="heading-xs"> - {redeployTrigger && - createMessage(REDEPLOY_WARNING_MESSAGE[redeployTrigger])} - </Text> + <Text kind="heading-xs"> + {createMessage(REDEPLOY_WARNING_MESSAGE[redeployTrigger])} + </Text>Optionally, consider moving the docs URL and
"Learn more"label into shared constants/messages for easier maintenance and localization, but the current behavior is functionally fine.app/client/src/ce/constants/DeploymentConstants.ts (1)
6-25: Type-safe trigger/message mapping looks solid;ValueOfreuse is optionalThe pattern of:
REDEPLOY_TRIGGERSasas const,RedeployTriggerValue = ValueOf<typeof REDEPLOY_TRIGGERS>, andRecord<RedeployTriggerValue, () => string>for both warning and tooltipis a nice, type-safe way to guarantee every trigger has corresponding copy.
If there’s already a shared
ValueOfhelper type in the codebase, you might consider reusing it to avoid redefining the generic; if not, this local definition is perfectly fine as-is.app/client/src/pages/AppIDE/layouts/components/Header/DeployButton.tsx (1)
50-72: DeduplicatehasPendingCommitslogic between tooltip and icon for clarityThe core logic:
- derive
hasPendingCommitsfromgitStatusState?.value.isClean, and- use it in both
tooltipTextandstartIcon,is duplicated across the two
useMemoblocks. It’s correct, but a bit harder to maintain if the status shape changes.You could centralize this into a single computed value and reuse it, e.g.:
- const gitStatusState = useArtifactSelector(selectStatusState); - const redeployTrigger = useSelector(getRedeployApplicationTrigger); + const gitStatusState = useArtifactSelector(selectStatusState); + const redeployTrigger = useSelector(getRedeployApplicationTrigger); + + const hasPendingCommits = useMemo(() => { + if (!isGitConnected || gitStatusState?.loading || !gitStatusState?.value) { + return false; + } + + return !gitStatusState.value.isClean; + }, [gitStatusState, isGitConnected]); @@ - const tooltipText = useMemo(() => { + const tooltipText = useMemo(() => { if (isPackageUpgrading) { return createMessage(PACKAGE_UPGRADING_ACTION_STATUS, "deploy this app"); } - if (isGitConnected && !gitStatusState?.loading) { - const hasPendingCommits = - gitStatusState?.value && !gitStatusState.value.isClean; - - if (hasPendingCommits) { + if (isGitConnected && !gitStatusState?.loading) { + if (hasPendingCommits) { return createMessage(UNCOMMITTED_CHANGES); } if (redeployTrigger) { return createMessage(REDEPLOY_BUTTON_TOOLTIP[redeployTrigger]); } } @@ - const startIcon = useMemo(() => { - if (isGitConnected && !gitStatusState?.loading) { - const hasPendingCommits = - gitStatusState?.value && !gitStatusState.value.isClean; - - if (!hasPendingCommits && redeployTrigger) { - return "rocket-dot"; - } - - if (hasPendingCommits) { - return "rocket-dot"; - } - } - - return "rocket"; - }, [isGitConnected, gitStatusState, redeployTrigger]); + const startIcon = useMemo(() => { + if (isGitConnected && !gitStatusState?.loading) { + if (!hasPendingCommits && redeployTrigger) { + return "rocket-dot"; + } + + if (hasPendingCommits) { + return "rocket-dot"; + } + } + + return "rocket"; + }, [isGitConnected, gitStatusState, redeployTrigger, hasPendingCommits]);This keeps the “what counts as pending commits?” rule in one place while preserving the existing behavior for tooltips and the rocket/rocket-dot icon.
Also applies to: 103-118
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (8)
app/client/src/ce/constants/DeploymentConstants.ts(1 hunks)app/client/src/ce/constants/messages.ts(3 hunks)app/client/src/ce/sagas/ApplicationSagas.tsx(1 hunks)app/client/src/ce/selectors/applicationSelectors.tsx(2 hunks)app/client/src/ee/constants/DeploymentConstants.ts(1 hunks)app/client/src/git/components/OpsModal/TabDeploy/RedeployWarning.tsx(1 hunks)app/client/src/git/components/OpsModal/TabDeploy/TabDeployView.tsx(10 hunks)app/client/src/pages/AppIDE/layouts/components/Header/DeployButton.tsx(4 hunks)
🚧 Files skipped from review as they are similar to previous changes (4)
- app/client/src/ce/sagas/ApplicationSagas.tsx
- app/client/src/ce/selectors/applicationSelectors.tsx
- app/client/src/ce/constants/messages.ts
- app/client/src/git/components/OpsModal/TabDeploy/TabDeployView.tsx
🧰 Additional context used
🧠 Learnings (8)
📚 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/ee/constants/DeploymentConstants.tsapp/client/src/pages/AppIDE/layouts/components/Header/DeployButton.tsx
📚 Learning: 2024-10-24T08:38:20.429Z
Learnt from: ankitakinger
Repo: appsmithorg/appsmith PR: 37056
File: app/client/src/pages/Editor/JSEditor/JSObjectNameEditor/JSObjectNameEditor.tsx:22-25
Timestamp: 2024-10-24T08:38:20.429Z
Learning: "constants/AppConstants" does not export "SaveActionNameParams".
Applied to files:
app/client/src/ee/constants/DeploymentConstants.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/pages/AppIDE/layouts/components/Header/DeployButton.tsx
📚 Learning: 2024-12-11T08:31:10.356Z
Learnt from: brayn003
Repo: appsmithorg/appsmith PR: 38088
File: app/client/src/git/components/GitQuickActions/helpers/getPullButtonStatus.ts:16-21
Timestamp: 2024-12-11T08:31:10.356Z
Learning: In the file `app/client/src/git/components/GitQuickActions/helpers/getPullButtonStatus.ts`, when defining the function `getPullBtnStatus`, it's acceptable to use default parameters in destructuring. Do not suggest removing default parameters in this context.
Applied to files:
app/client/src/pages/AppIDE/layouts/components/Header/DeployButton.tsx
📚 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/pages/AppIDE/layouts/components/Header/DeployButton.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/pages/AppIDE/layouts/components/Header/DeployButton.tsx
📚 Learning: 2025-02-20T13:36:10.743Z
Learnt from: alex-golovanov
Repo: appsmithorg/appsmith PR: 39379
File: app/client/src/pages/AppIDE/components/LibrariesList/JSLibrariesSection.tsx:0-0
Timestamp: 2025-02-20T13:36:10.743Z
Learning: When reviewing React components, ensure that useMemo and useEffect hooks include all variables used within their callbacks in their dependency arrays to prevent stale values and potential bugs.
Applied to files:
app/client/src/pages/AppIDE/layouts/components/Header/DeployButton.tsx
📚 Learning: 2024-07-26T21:12:57.228Z
Learnt from: ankitakinger
Repo: appsmithorg/appsmith PR: 29573
File: app/client/src/ce/entities/DataTree/types.ts:182-186
Timestamp: 2024-07-26T21:12:57.228Z
Learning: The use of `any` type for `moduleInstanceEntities` in `app/client/src/ce/entities/DataTree/types.ts` is intentional and was done by another developer. This decision is likely to serve a specific purpose within the codebase, which may be related to maintaining compatibility between CE and EE or other architectural reasons.
Applied to files:
app/client/src/pages/AppIDE/layouts/components/Header/DeployButton.tsx
🧬 Code graph analysis (3)
app/client/src/git/components/OpsModal/TabDeploy/RedeployWarning.tsx (1)
app/client/src/ce/constants/DeploymentConstants.ts (2)
RedeployTriggerValue(11-11)REDEPLOY_WARNING_MESSAGE(13-18)
app/client/src/ce/constants/DeploymentConstants.ts (1)
app/client/src/ce/constants/messages.ts (2)
REDEPLOY_APP_WARNING(1057-1058)REDEPLOY_APP_BUTTON_TOOLTIP(1468-1469)
app/client/src/pages/AppIDE/layouts/components/Header/DeployButton.tsx (5)
app/client/src/git/hooks/useArtifactSelector.ts (1)
useArtifactSelector(10-30)app/client/src/git/store/selectors/gitArtifactSelectors.ts (1)
selectStatusState(106-109)app/client/src/ce/selectors/applicationSelectors.tsx (1)
getRedeployApplicationTrigger(222-245)app/client/src/ce/constants/messages.ts (3)
PACKAGE_UPGRADING_ACTION_STATUS(504-505)UNCOMMITTED_CHANGES(1024-1024)DEPLOY_BUTTON_TOOLTIP(1466-1467)app/client/src/ce/constants/DeploymentConstants.ts (1)
REDEPLOY_BUTTON_TOOLTIP(20-25)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (8)
- GitHub Check: client-prettier / prettier-check
- GitHub Check: client-unit-tests / client-unit-tests
- GitHub Check: client-build / client-build
- GitHub Check: client-lint / client-lint
- GitHub Check: client-check-cyclic-deps / check-cyclic-dependencies
- GitHub Check: chromatic-deployment
- GitHub Check: chromatic-deployment
- GitHub Check: storybook-tests
🔇 Additional comments (1)
app/client/src/ee/constants/DeploymentConstants.ts (1)
1-1: EE barrel re-export is appropriateRe-exporting the CE deployment constants/types through this EE barrel keeps the EE import surface consistent without duplicating definitions. No issues here.
…ment of EE/CE message mapping for redeploy button tooltip. Renamed variable in DeployPreview from isCommitSuccess to isSuccess to make it generic to be used for redeploying and commit success. Updated the rocket-dot icon
There was a problem hiding this comment.
Actionable comments posted: 0
♻️ Duplicate comments (1)
app/client/src/git/components/OpsModal/TabDeploy/TabDeployView.tsx (1)
386-386: Potential premature success indicator during redeploy.Passing
isRedeployingdirectly shows the success tick during the redeploy operation rather than after completion. TheisCommitSuccesspattern (line 174-176) shows success only after loading completes:hasSubmitted && !isCommitLoading.Consider deriving an
isRedeploySuccesssimilar toisCommitSuccess:const isRedeploySuccess = hasRedeployed && !isRedeploying;Then update line 386:
- <DeployPreview isSuccess={isCommitSuccess || isRedeploying} /> + <DeployPreview isSuccess={isCommitSuccess || isRedeploySuccess} />
🧹 Nitpick comments (1)
app/client/src/pages/AppIDE/layouts/components/Header/DeployButton.tsx (1)
53-72: Consider extracting duplicatedhasPendingCommitscomputation.The logic for
hasPendingCommits(lines 59-60) is duplicated in thestartIconuseMemo (lines 105-106). Extracting this to a separate memoized value would improve maintainability.+ const hasPendingCommits = useMemo(() => { + return isGitConnected && !gitStatusState?.loading && + gitStatusState?.value && !gitStatusState.value.isClean; + }, [isGitConnected, gitStatusState]); + const tooltipText = useMemo(() => { if (isPackageUpgrading) { return createMessage(PACKAGE_UPGRADING_ACTION_STATUS, "deploy this app"); } if (isGitConnected && !gitStatusState?.loading) { - const hasPendingCommits = - gitStatusState?.value && !gitStatusState.value.isClean; - if (hasPendingCommits) { return createMessage(UNCOMMITTED_CHANGES); } if (redeployTrigger) { return createMessage(REDEPLOY_APP_BUTTON_TOOLTIP); } } return createMessage(DEPLOY_BUTTON_TOOLTIP); - }, [isPackageUpgrading, isGitConnected, gitStatusState, redeployTrigger]); + }, [isPackageUpgrading, hasPendingCommits, redeployTrigger]);
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (2)
app/client/packages/design-system/ads/src/__assets__/icons/ads/rocket-dot.svgis excluded by!**/*.svgapp/client/packages/design-system/widgets-old/src/assets/icons/ads/rocket-dot.svgis excluded by!**/*.svg
📒 Files selected for processing (5)
app/client/src/ce/constants/DeploymentConstants.ts(1 hunks)app/client/src/ce/constants/messages.ts(3 hunks)app/client/src/git/components/OpsModal/TabDeploy/DeployPreview.tsx(2 hunks)app/client/src/git/components/OpsModal/TabDeploy/TabDeployView.tsx(10 hunks)app/client/src/pages/AppIDE/layouts/components/Header/DeployButton.tsx(4 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- app/client/src/ce/constants/messages.ts
🧰 Additional context used
🧠 Learnings (12)
📚 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/components/OpsModal/TabDeploy/TabDeployView.tsxapp/client/src/pages/AppIDE/layouts/components/Header/DeployButton.tsx
📚 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/components/OpsModal/TabDeploy/TabDeployView.tsx
📚 Learning: 2024-12-11T08:31:10.356Z
Learnt from: brayn003
Repo: appsmithorg/appsmith PR: 38088
File: app/client/src/git/components/GitQuickActions/helpers/getPullButtonStatus.ts:16-21
Timestamp: 2024-12-11T08:31:10.356Z
Learning: In the file `app/client/src/git/components/GitQuickActions/helpers/getPullButtonStatus.ts`, when defining the function `getPullBtnStatus`, it's acceptable to use default parameters in destructuring. Do not suggest removing default parameters in this context.
Applied to files:
app/client/src/git/components/OpsModal/TabDeploy/TabDeployView.tsxapp/client/src/pages/AppIDE/layouts/components/Header/DeployButton.tsx
📚 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/OpsModal/TabDeploy/TabDeployView.tsx
📚 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/components/OpsModal/TabDeploy/TabDeployView.tsxapp/client/src/pages/AppIDE/layouts/components/Header/DeployButton.tsx
📚 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/components/OpsModal/TabDeploy/TabDeployView.tsx
📚 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/components/OpsModal/TabDeploy/TabDeployView.tsx
📚 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/pages/AppIDE/layouts/components/Header/DeployButton.tsx
📚 Learning: 2025-02-20T13:36:10.743Z
Learnt from: alex-golovanov
Repo: appsmithorg/appsmith PR: 39379
File: app/client/src/pages/AppIDE/components/LibrariesList/JSLibrariesSection.tsx:0-0
Timestamp: 2025-02-20T13:36:10.743Z
Learning: When reviewing React components, ensure that useMemo and useEffect hooks include all variables used within their callbacks in their dependency arrays to prevent stale values and potential bugs.
Applied to files:
app/client/src/pages/AppIDE/layouts/components/Header/DeployButton.tsx
📚 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/pages/AppIDE/layouts/components/Header/DeployButton.tsx
📚 Learning: 2024-10-08T15:32:34.114Z
Learnt from: ankitakinger
Repo: appsmithorg/appsmith PR: 29573
File: app/client/src/ce/entities/DataTree/types.ts:182-186
Timestamp: 2024-10-08T15:32:34.114Z
Learning: The use of `any` type for `moduleInstanceEntities` in `app/client/src/ce/entities/DataTree/types.ts` is intentional and was done by another developer. This decision is likely to serve a specific purpose within the codebase, which may be related to maintaining compatibility between CE and EE or other architectural reasons.
Applied to files:
app/client/src/pages/AppIDE/layouts/components/Header/DeployButton.tsx
📚 Learning: 2025-10-30T07:17:49.646Z
Learnt from: ashit-rath
Repo: appsmithorg/appsmith PR: 41312
File: app/client/src/ce/reducers/uiReducers/applicationsReducer.tsx:817-883
Timestamp: 2025-10-30T07:17:49.646Z
Learning: In app/client/src/ce/reducers/uiReducers/applicationsReducer.tsx, the isErrorPersistingAppSlug flag is unused and should be removed. There is no corresponding selector to expose it, and no handlers set it to true.
Applied to files:
app/client/src/pages/AppIDE/layouts/components/Header/DeployButton.tsx
🧬 Code graph analysis (2)
app/client/src/ce/constants/DeploymentConstants.ts (1)
app/client/src/ce/constants/messages.ts (1)
REDEPLOY_APP_WARNING(1057-1058)
app/client/src/git/components/OpsModal/TabDeploy/TabDeployView.tsx (3)
app/client/src/ce/constants/DeploymentConstants.ts (1)
RedeployTriggerValue(8-8)app/client/src/git/components/OpsModal/TabDeploy/DeployPreview.tsx (1)
DeployPreview(38-97)app/client/src/ce/constants/messages.ts (1)
REDEPLOY_MENU_OPTION(1482-1482)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (8)
- GitHub Check: client-check-cyclic-deps / check-cyclic-dependencies
- GitHub Check: client-prettier / prettier-check
- GitHub Check: client-lint / client-lint
- GitHub Check: client-unit-tests / client-unit-tests
- GitHub Check: client-build / client-build
- GitHub Check: storybook-tests
- GitHub Check: chromatic-deployment
- GitHub Check: chromatic-deployment
🔇 Additional comments (6)
app/client/src/git/components/OpsModal/TabDeploy/DeployPreview.tsx (1)
35-52: LGTM! Clean prop generalization.The rename from
isCommitSuccesstoisSuccessappropriately generalizes the component to handle both commit and redeploy success states while maintaining existing behavior.app/client/src/git/components/OpsModal/TabDeploy/TabDeployView.tsx (4)
89-120: LGTM! Props follow established patterns.The new redeploy-related props (
isRedeploying,redeploy,redeployTrigger) follow the same patterns as existing props with appropriate types and defaults.
150-151: Redeploy gating logic looks correct.The
shouldShowRedeploycondition appropriately shows redeploy UI only when status is loaded, there are no pending changes, and a redeploy trigger exists. This aligns with the PR objectives.
277-282: Analytics logging follows established pattern.The
handleRedeploycallback follows the same pattern as other Git modal actions (commit, pull, discard) by logging analytics before invoking the action.
417-443: LGTM! Button rendering logic is sound.The mutually exclusive rendering of commit and redeploy buttons based on
shouldShowRedeployensures a clean UX. The redeploy button appropriately uses loading state and analytics logging.app/client/src/ce/constants/DeploymentConstants.ts (1)
1-15: Message content may not align with trigger mechanism.The
REDEPLOY_APP_WARNINGmessage states "not using the latest versions of some packages," but thePendingDeploymenttrigger is set when changes are detected since the last deployment (modifiedAtMs - lastDeployedAtMs > 1000). These detect different conditions—package version status vs. pending changes—which could mislead users about why a redeploy is needed.
Description
Added Redeploy button that allows the user to sync the latest changes between edit and view mode. This button shows up only when lastDeployedAt is less than modifiedAt of the application and when there are no more commits to be pushed.
Below is a video of where changes are pulled from remote in the edit mode, but due to some technical glitch, fails to deploy/publish the Application. And there are no more commits to be pushed to deploy the App.
Earlier workaround was to introduce a change and click Discard and Pull. But with this PR, we are introducing the Redeploy button with Callout in the GIT Modal so that the view mode can be in sync with edit mode.
Also showing an orange dot next to deploy icon to indicate that the App needs to be redeployed
CE.Repo.-.Need.for.Redeploy.button.mp4
Fixes 41457
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.All"
🔍 Cypress test results
Tip
🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/20256007695
Commit: 91df629
Cypress dashboard.
Tags:
@tag.AllSpec:
Tue, 16 Dec 2025 05:01:29 UTC
Communication
Should the DevRel and Marketing teams inform users about this change?
Summary by CodeRabbit
New Features
Style
✏️ Tip: You can customize this high-level summary in your review settings.