Skip to content

Commit

Permalink
chore: Make EE opt-out (#2729)
Browse files Browse the repository at this point in the history
Co-authored-by: Štěpán Granát <[email protected]>
  • Loading branch information
JanCizmar and stepan662 authored Dec 6, 2024
1 parent d426a9a commit b1fcd58
Show file tree
Hide file tree
Showing 217 changed files with 2,627 additions and 1,753 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ jobs:
"server-app:runContextRecreatingTests",
"server-app:runStandardTests",
"server-app:runWebsocketTests",
"server-app:runWithoutEeTests",
"ee-test:test",
"data:test",
"security:test",
Expand Down Expand Up @@ -117,6 +118,11 @@ jobs:
tar -xzf ~/ee-backend-app.tgz ./ee/backend/app/build
tar -xzf ~/ee-backend-tests.tgz ./ee/backend/tests/build
- name: Remove ee
if: matrix.command == 'server-app:runWithoutEeTests'
run: |
rm -rf ./ee
- name: Run backend tests
uses: nick-fields/retry@v2
with:
Expand Down Expand Up @@ -347,6 +353,14 @@ jobs:
env:
TOLGEE_API_KEY: ${{secrets.TOLGEE_API_KEY}}

- name: Check it builds without ee directory
run: |
rm -rf ./src/ee
npm install
npm run tsc
npm run build
working-directory: ./webapp

e2e-code-checks:
name: E2E Static Check 🪲
runs-on: ubuntu-latest
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ e2e/cypress/integration/examples/
/webapp/.env.development.local
/webapp/.env.test.local
/webapp/.env.production.local
/webapp/src/eeSetup/eeModule.current.tsx

/webapp/npm-debug.log*
/webapp/yarn-debug.log*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,10 @@ class InitialDataController(
private val userController: V2UserController,
private val userPreferencesService: UserPreferencesService,
private val preferredOrganizationFacade: PreferredOrganizationFacade,
private val eeSubscriptionModelAssembler: IEeSubscriptionModelAssembler,
private val eeSubscriptionProvider: EeSubscriptionProvider,
@Suppress("SpringJavaInjectionPointsAutowiringInspection")
private val eeSubscriptionModelAssembler: IEeSubscriptionModelAssembler?,
@Suppress("SpringJavaInjectionPointsAutowiringInspection")
private val eeSubscriptionProvider: EeSubscriptionProvider?,
private val announcementController: AnnouncementController,
) : IController {
@GetMapping(value = [""])
Expand All @@ -40,8 +42,8 @@ class InitialDataController(
InitialDataModel(
serverConfiguration = configurationController.getPublicConfiguration(),
eeSubscription =
eeSubscriptionProvider.findSubscriptionDto()?.let {
eeSubscriptionModelAssembler.toModel(
eeSubscriptionProvider?.findSubscriptionDto()?.let {
eeSubscriptionModelAssembler?.toModel(
it,
)
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package io.tolgee.api.v2.controllers

import io.swagger.v3.oas.annotations.Operation
import io.swagger.v3.oas.annotations.tags.Tag
import io.tolgee.api.EeInvitationService
import io.tolgee.constants.Message
import io.tolgee.dtos.misc.CreateOrganizationInvitationParams
import io.tolgee.dtos.misc.CreateProjectInvitationParams
Expand All @@ -22,7 +21,8 @@ import io.tolgee.security.authentication.AllowApiAccess
import io.tolgee.security.authentication.RequiresSuperAuthentication
import io.tolgee.security.authorization.RequiresOrganizationRole
import io.tolgee.security.authorization.RequiresProjectPermissions
import io.tolgee.service.InvitationService
import io.tolgee.service.invitation.EeInvitationService
import io.tolgee.service.invitation.InvitationService
import io.tolgee.service.organization.OrganizationRoleService
import io.tolgee.service.organization.OrganizationService
import io.tolgee.service.project.ProjectService
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ import io.tolgee.security.authentication.AllowApiAccess
import io.tolgee.security.authentication.AuthenticationFacade
import io.tolgee.security.authorization.RequiresProjectPermissions
import io.tolgee.security.authorization.UseDefaultPermissions
import io.tolgee.service.ITaskService
import io.tolgee.service.key.ScreenshotService
import io.tolgee.service.language.LanguageService
import io.tolgee.service.queryBuilders.CursorUtil
import io.tolgee.service.security.SecurityService
import io.tolgee.service.task.ITaskService
import io.tolgee.service.translation.TranslationService
import jakarta.validation.Valid
import org.springdoc.core.annotations.ParameterObject
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ package io.tolgee.hateoas.contentDelivery

import io.tolgee.api.v2.controllers.contentDelivery.ContentDeliveryConfigController
import io.tolgee.configuration.tolgee.TolgeeProperties
import io.tolgee.hateoas.ee.contentStorage.IContentStorageModelAssembler
import io.tolgee.hateoas.ee.contentStorage.ContentStorageModelAssembler
import io.tolgee.model.contentDelivery.ContentDeliveryConfig
import org.springframework.hateoas.server.mvc.RepresentationModelAssemblerSupport
import org.springframework.stereotype.Component

@Component
class ContentDeliveryConfigModelAssembler(
private val contentStorageModelAssembler: IContentStorageModelAssembler,
private val contentStorageModelAssembler: ContentStorageModelAssembler,
private val tolgeeProperties: TolgeeProperties,
) : RepresentationModelAssemblerSupport<ContentDeliveryConfig, ContentDeliveryConfigModel>(
ContentDeliveryConfigController::class.java,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ package io.tolgee.hateoas.ee.contentStorage

import io.tolgee.model.contentDelivery.ContentStorage

interface IContentStorageModelAssembler {
interface ContentStorageModelAssembler {
fun toModel(entity: ContentStorage): ContentStorageModel
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package io.tolgee.hateoas.ee.contentStorage

import io.tolgee.constants.Feature
import io.tolgee.exceptions.NotImplementedInOss
import io.tolgee.model.contentDelivery.ContentStorage
import org.springframework.stereotype.Component

@Component
class ContentStorageModelAssemblerOssImpl : ContentStorageModelAssembler {
override fun toModel(entity: ContentStorage): ContentStorageModel {
throw NotImplementedInOss(Feature.PROJECT_LEVEL_CONTENT_STORAGES)
}
}
14 changes: 12 additions & 2 deletions backend/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,9 @@ dependencies {
/**
* EE MODULE
*/
implementation(project(':ee-app'))

if (gradle.ext.eeAppDirectoryExists) {
implementation(project(':ee-app'))
}

/**
* Dev module
Expand Down Expand Up @@ -232,6 +233,15 @@ tasks.register('runWebsocketTests', Test) {
setTestRetry(it)
}

tasks.register('runWithoutEeTests', Test) {
outputs.upToDateWhen { false }
useJUnitPlatform {
includeTags "withoutEe"
}
maxHeapSize = "4096m"
setTestRetry(it)
}

springBoot {
buildInfo {
properties {
Expand Down
Loading

0 comments on commit b1fcd58

Please sign in to comment.