Skip to content

fix(server): prevent import from corrupting published layoutOnLoadActions#41737

Merged
subrata71 merged 1 commit intoreleasefrom
fix/app-15122-cd-layoutonloadactions-corruption
Apr 13, 2026
Merged

fix(server): prevent import from corrupting published layoutOnLoadActions#41737
subrata71 merged 1 commit intoreleasefrom
fix/app-15122-cd-layoutonloadactions-corruption

Conversation

@subrata71
Copy link
Copy Markdown
Collaborator

@subrata71 subrata71 commented Apr 13, 2026

Description

When a CD deployment is rejected by the orphan check (GIT_CD_PUBLISH_ARTIFACT_FAILURE), the previously deployed published app was being corrupted. The layoutOnLoadActions in the published page's layout — which determines which actions auto-execute on page load — was being mutated with wrong/null action IDs by the import step, before the orphan check had a chance to block the deployment.

Root cause: getLayoutOnLoadActionsForPage in NewPageImportableServiceCEImpl (lines 600-616) processed and mutated the published page's layoutOnLoadActions using the import's actionIdMap. This map is keyed by Git/import action IDs, but the published layout contains production action IDs from the last successful deployment. The lookup actionIdMap.get(productionId) returns null, corrupting the published layout. The page is then saved via full-document saveAll, persisting the corruption before the orphan check runs.

Fix: Remove the published page layout processing from getLayoutOnLoadActionsForPage. Published page state must only be updated by the explicit publishPages step during a successful deploy, never during import.

EE Companion PR: https://github.com/appsmithorg/appsmith-ee/pull/8918

Fixes https://linear.app/appsmith/issue/APP-15122/cd-deployment-corrupts-published-apps-layoutonloadactions-even-when

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/24331202801
Commit: 94a4e1c
Cypress dashboard.
Tags: @tag.All
Spec:


Mon, 13 Apr 2026 08:31:45 UTC

Communication

Should the DevRel and Marketing teams inform users about this change?

  • Yes
  • No

Summary by CodeRabbit

  • Bug Fixes
    • Fixed an issue during page import where published layouts were being unintentionally modified. The import process now correctly preserves published page layouts without alteration.

…ions

Remove published page layout processing from getLayoutOnLoadActionsForPage.
The import's actionIdMap maps Git/import IDs, not production IDs, so remapping
published layout action IDs corrupts them (sets to null). The published page
state should only be updated by the publishPages step during successful deploy.
@subrata71 subrata71 requested a review from a team as a code owner April 13, 2026 07:29
@linear
Copy link
Copy Markdown

linear bot commented Apr 13, 2026

@subrata71 subrata71 self-assigned this Apr 13, 2026
@subrata71 subrata71 added the ok-to-test Required label for CI label Apr 13, 2026
@subrata71 subrata71 requested a review from sondermanish April 13, 2026 07:30
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 13, 2026

Walkthrough

The change removes logic that processes published page layouts during import, specifically the iteration and mutation of action IDs and collection IDs within layoutOnLoadActions. The method now focuses solely on unpublished layouts for action remapping, leaving published layouts unprocessed.

Changes

Cohort / File(s) Summary
Published Layout Processing Removal
app/server/appsmith-server/src/main/java/com/appsmith/server/newpages/importable/NewPageImportableServiceCEImpl.java
Removed iteration and remapping logic for published page layouts; now only unpublished layouts have their action IDs and collection IDs rewritten during import.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

📄 Published layouts rest untouched today,
Unpublished paths now lead the way,
Action IDs map with cleaner care,
Simplified flows float through the air. ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main fix: preventing import from corrupting published layoutOnLoadActions, which is the core change in the PR.
Description check ✅ Passed The PR description is comprehensive, clearly explaining the root cause, fix, and providing relevant links including the linear issue and EE companion PR.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/app-15122-cd-layoutonloadactions-corruption

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@subrata71 subrata71 merged commit 7d8a5ef into release Apr 13, 2026
93 checks passed
@subrata71 subrata71 deleted the fix/app-15122-cd-layoutonloadactions-corruption branch April 13, 2026 10:49
@btsgh btsgh mentioned this pull request Apr 14, 2026
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ok-to-test Required label for CI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants