From 5e0c4d6d2f8528827ba3af37a95c631cbf1ad0f8 Mon Sep 17 00:00:00 2001 From: Trisha Anand Date: Fri, 17 Jun 2022 15:01:52 +0530 Subject: [PATCH 1/2] fix: Fix migration for overwriting recently used workspaces (#14634) --- .../server/migrations/DatabaseChangelog2.java | 51 ++----------------- 1 file changed, 5 insertions(+), 46 deletions(-) diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/migrations/DatabaseChangelog2.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/migrations/DatabaseChangelog2.java index df5f2dbc3d..090483443f 100644 --- a/app/server/appsmith-server/src/main/java/com/appsmith/server/migrations/DatabaseChangelog2.java +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/migrations/DatabaseChangelog2.java @@ -1,89 +1,50 @@ package com.appsmith.server.migrations; -import com.appsmith.external.models.ApiTemplate; -import com.appsmith.external.models.BaseDomain; -import com.appsmith.external.models.Category; import com.appsmith.external.models.Datasource; import com.appsmith.external.models.Property; -import com.appsmith.external.models.Provider; import com.appsmith.external.models.QBaseDomain; import com.appsmith.external.models.QDatasource; -import com.appsmith.server.acl.AppsmithRole; import com.appsmith.server.constants.FieldName; -import com.appsmith.server.domains.Action; import com.appsmith.server.domains.ActionCollection; import com.appsmith.server.domains.Application; import com.appsmith.server.domains.ApplicationPage; -import com.appsmith.server.domains.Asset; -import com.appsmith.server.domains.Collection; import com.appsmith.server.domains.Comment; -import com.appsmith.server.domains.CommentNotification; import com.appsmith.server.domains.CommentThread; -import com.appsmith.server.domains.CommentThreadNotification; -import com.appsmith.server.domains.Config; -import com.appsmith.server.domains.GitDeployKeys; -import com.appsmith.server.domains.Group; -import com.appsmith.server.domains.InviteUser; -import com.appsmith.server.domains.Layout; import com.appsmith.server.domains.NewAction; import com.appsmith.server.domains.NewPage; -import com.appsmith.server.domains.Notification; import com.appsmith.server.domains.Organization; -import com.appsmith.server.domains.Page; -import com.appsmith.server.domains.PasswordResetToken; import com.appsmith.server.domains.Plugin; -import com.appsmith.server.domains.QAction; -import com.appsmith.server.domains.QActionCollection; import com.appsmith.server.domains.PricingPlan; +import com.appsmith.server.domains.QActionCollection; import com.appsmith.server.domains.QApplication; -import com.appsmith.server.domains.QCollection; import com.appsmith.server.domains.QComment; import com.appsmith.server.domains.QCommentThread; -import com.appsmith.server.domains.QConfig; -import com.appsmith.server.domains.QGroup; -import com.appsmith.server.domains.QInviteUser; import com.appsmith.server.domains.QNewAction; import com.appsmith.server.domains.QNewPage; import com.appsmith.server.domains.QOrganization; import com.appsmith.server.domains.QPlugin; +import com.appsmith.server.domains.QTenant; import com.appsmith.server.domains.QTheme; import com.appsmith.server.domains.QUser; import com.appsmith.server.domains.QUserData; import com.appsmith.server.domains.QWorkspace; -import com.appsmith.server.domains.Role; -import com.appsmith.server.domains.Sequence; -import com.appsmith.server.domains.Theme; -import com.appsmith.server.domains.UsagePulse; -import com.appsmith.server.domains.User; -import com.appsmith.server.domains.UserData; -import com.appsmith.server.domains.QTenant; import com.appsmith.server.domains.Sequence; import com.appsmith.server.domains.Tenant; +import com.appsmith.server.domains.Theme; import com.appsmith.server.domains.User; +import com.appsmith.server.domains.UserData; import com.appsmith.server.domains.Workspace; -import com.appsmith.server.domains.WorkspacePlugin; import com.appsmith.server.dtos.ActionDTO; -import com.appsmith.server.dtos.ApplicationTemplate; -import com.appsmith.server.dtos.ResetUserPasswordDTO; import com.appsmith.server.exceptions.AppsmithError; import com.appsmith.server.exceptions.AppsmithException; import com.appsmith.server.helpers.TextUtils; -import com.appsmith.server.services.ce.ConfigServiceCE; -import com.appsmith.server.services.ce.ConfigServiceCEImpl; import com.github.cloudyrock.mongock.ChangeLog; import com.github.cloudyrock.mongock.ChangeSet; import com.github.cloudyrock.mongock.driver.mongodb.springdata.v3.decorator.impl.MongockTemplate; import com.google.gson.Gson; import lombok.extern.slf4j.Slf4j; -import reactor.core.publisher.Flux; - -import org.bson.BsonArray; -import org.bson.Document; -import org.springframework.data.mongodb.core.aggregation.AggregationOperation; -import org.springframework.data.mongodb.core.aggregation.AggregationPipeline; import org.springframework.data.mongodb.core.aggregation.AggregationUpdate; import org.springframework.data.mongodb.core.aggregation.Fields; -import org.springframework.data.mongodb.core.aggregation.SetOperation; import org.springframework.data.mongodb.core.query.Criteria; import org.springframework.data.mongodb.core.query.Query; import org.springframework.data.mongodb.core.query.Update; @@ -94,14 +55,12 @@ import org.springframework.util.StringUtils; import reactor.core.publisher.Flux; import java.time.Instant; -import java.util.Arrays; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Optional; import java.util.Set; -import java.util.Map.Entry; import java.util.regex.Matcher; import java.util.regex.Pattern; import java.util.stream.Collectors; @@ -967,7 +926,7 @@ public class DatabaseChangelog2 { AggregationUpdate.update().set(fieldName(QTheme.theme.workspaceId)).toValueOf(Fields.field(fieldName(QTheme.theme.organizationId))), Theme.class); mongockTemplate.updateMulti(new Query(), - AggregationUpdate.update().set(fieldName(QUserData.userData.recentlyUsedOrgIds)).toValueOf(Fields.field(fieldName(QUserData.userData.recentlyUsedWorkspaceIds))), + AggregationUpdate.update().set(fieldName(QUserData.userData.recentlyUsedWorkspaceIds)).toValueOf(Fields.field(fieldName(QUserData.userData.recentlyUsedOrgIds))), UserData.class); mongockTemplate.updateMulti(new Query(), AggregationUpdate.update().set(fieldName(QWorkspace.workspace.isAutoGeneratedWorkspace)).toValueOf(Fields.field(fieldName(QWorkspace.workspace.isAutoGeneratedOrganization))), From 7ae511f402e8907d024f593da22453d4bed67534 Mon Sep 17 00:00:00 2001 From: Arpit Mohan Date: Wed, 22 Jun 2022 06:27:40 +0200 Subject: [PATCH 2/2] ci: Revert "ci: Use buildjet runners for Cypress tests, and fewer of them" Reverts #14636 Reverting this change for now because there is an issue when re-running the failed specs. The action is unable to find the correct directory. --- .github/workflows/test-build-docker-image.yml | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-build-docker-image.yml b/.github/workflows/test-build-docker-image.yml index cfca4329ec..d2f1a66784 100644 --- a/.github/workflows/test-build-docker-image.yml +++ b/.github/workflows/test-build-docker-image.yml @@ -761,7 +761,7 @@ jobs: (github.event_name == 'pull_request_review' && github.event.review.state == 'approved' && github.event.pull_request.head.repo.full_name == github.repository)) - runs-on: buildjet-4vcpu-ubuntu-2004 + runs-on: ubuntu-latest defaults: run: working-directory: app/client @@ -778,6 +778,23 @@ jobs: 4, 5, 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, ] # Service containers to run with this job. Required for running tests