chore: fixing file lock issues on autocommit#33549
Conversation
WalkthroughThe changes encompass the addition of new methods and modifications to existing ones in various service classes to enhance application and page management based on different modes (view/edit). The primary objective is to eliminate redundant DSL migration calls in the Changes
Assessment against linked issues
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
## Description -`application` attribute of `pages` field in consolidated apis was missing `isPublic` field. it is part of transient properties which is not stored. Since the method was not included in the application find flow the property was not getting set. ## Automation /ok-to-test tags="@tag.All" ### 🔍 Cypress test results <!-- This is an auto-generated comment: Cypress test results --> > [!CAUTION] > 🔴 🔴 🔴 Some tests have failed. > Workflow run: <https://github.com/appsmithorg/appsmith/actions/runs/9125066518> > Commit: 6c5bd4a > Cypress dashboard: <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=9125066518&attempt=4&selectiontype=test&testsstatus=failed&specsstatus=fail" target="_blank"> Click here!</a> > The following are new failures, please fix them before merging the PR: <ol> > <li>cypress/e2e/Regression/ClientSide/Branding/Branding_spec.js > <li>cypress/e2e/Regression/ClientSide/Fork/ForkApplication_spec.ts > <li>cypress/e2e/Regression/ClientSide/OtherUIFeatures/ExportApplication_spec.js > <li>cypress/e2e/Regression/ClientSide/ProductRamps/PrivateEmbedRamp_spec.ts > <li>cypress/e2e/Regression/ClientSide/Workspace/ShareAppTests_Spec.ts </ol> > To know the list of identified flaky tests - <a href="https://internal.appsmith.com/app/cypress-dashboard/identified-flaky-tests-65890b3c81d7400d08fa9ee3?branch=master" target="_blank">Refer here</a> <!-- end of auto-generated comment: Cypress test results --> ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [ ] No
There was a problem hiding this comment.
Actionable comments posted: 5
Out of diff range and nitpick comments (1)
app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/ApplicationPageServiceCEImpl.java (1)
Line range hint
381-405: Enhance DSL migration logic to include default resource updates.// The method `getPageDTOAfterMigratingDSL` has been modified to include logic for on-demand DSL migration based on the view mode. // This change is part of the enhancements to improve the handling of DSL migrations and ensure that the migrated DSL is saved correctly. // It is important to ensure that the default resources are updated correctly after the migration to maintain consistency across the application.
| public Mono<List<NewPage>> getPagesBasedOnApplicationMode( | ||
| Application branchedApplication, ApplicationMode applicationMode) { | ||
|
|
||
| Boolean viewMode = ApplicationMode.PUBLISHED.equals(applicationMode) ? Boolean.TRUE : Boolean.FALSE; | ||
|
|
||
| List<ApplicationPage> applicationPages = Boolean.TRUE.equals(viewMode) | ||
| ? branchedApplication.getPublishedPages() | ||
| : branchedApplication.getPages(); | ||
|
|
||
| Set<String> pageIds = | ||
| applicationPages.stream().map(ApplicationPage::getId).collect(Collectors.toSet()); | ||
|
|
||
| return newPageService | ||
| .findByBranchNameAndDefaultPageId(branchName, defaultPageId, pagePermission.getReadPermission()) | ||
| .flatMap(newPage -> { | ||
| return sendPageViewAnalyticsEvent(newPage, viewMode) | ||
| .then(getPage(newPage, viewMode)) | ||
| .zipWith(Mono.just(newPage)); | ||
| .findNewPagesByApplicationId(branchedApplication.getId(), pagePermission.getReadPermission()) | ||
| .filter(newPage -> pageIds.contains(newPage.getId())) | ||
| .collectList() | ||
| .flatMap(newPageList -> { | ||
| if (Boolean.TRUE.equals(viewMode)) { | ||
| return Mono.just(newPageList); | ||
| } | ||
|
|
||
| // autocommit if migration is required | ||
| return migrateSchemasForGitConnectedApps(branchedApplication, newPageList) | ||
| .onErrorResume(error -> { | ||
| log.debug( | ||
| "Skipping the autocommit for applicationId : {} due to error; {}", | ||
| branchedApplication.getId(), | ||
| error.getMessage()); | ||
|
|
||
| return Mono.just(Boolean.FALSE); | ||
| }) | ||
| .thenReturn(newPageList); | ||
| }); | ||
| } |
There was a problem hiding this comment.
Refactor the method to handle autocommit during schema migration.
// The method `getPagesBasedOnApplicationMode` has been refactored to handle autocommit during schema migration.
// This is a critical change as it involves modifying the behavior of how pages are fetched based on the application mode.
// The method now includes logic to migrate schemas for Git-connected apps and handle errors during the migration process.
// This change is intended to fix file lock issues by removing redundant DSL migration calls.
Description
Fixes #33384
Automation
/ok-to-test tags="@tag.All"
🔍 Cypress test results
Communication
Should the DevRel and Marketing teams inform users about this change?
Summary by CodeRabbit
New Features
Refactor
ConsolidatedAPIServiceImplfor better performance.ApplicationServiceCEfor finding applications by default ID, branch name, and mode.Tests
ConsolidatedAPIServiceImplTestfor method call modifications.Tip
🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/9126493633
Commit: 82285f6
Cypress dashboard url: Click here!