Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Make EE opt-out #2729

Merged
merged 36 commits into from
Dec 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
f77de95
chore: Make EE plugin on frontend > it builds
JanCizmar Nov 27, 2024
2117764
chore: Make EE plugin on frontend > it runs
JanCizmar Nov 27, 2024
be16e53
chore: Make EE plugin on frontend > fix routing
JanCizmar Nov 27, 2024
27ec39e
chore: Make EE plugin on frontend > fix batch operations
JanCizmar Nov 27, 2024
2a14a14
chore: Make EE plugin on frontend > correctly add tasks to batch opes
JanCizmar Nov 27, 2024
2a9aaa8
chore: Make EE plugin on frontend > remove rest of ee references
JanCizmar Nov 28, 2024
a1959f7
chore: Make EE plugin on frontend > remove rest of ee references
JanCizmar Nov 28, 2024
a8c6435
chore: Make EE plugin on frontend > remove rest of ee references
JanCizmar Nov 28, 2024
c0e3258
chore: Make EE plugin on frontend > remove rest of ee references
JanCizmar Nov 28, 2024
b84feba
chore: Make EE plugin on frontend > remove rest of ee references
JanCizmar Nov 28, 2024
cfb5abd
chore: Make EE plugin on frontend > link instead of copy
JanCizmar Nov 28, 2024
8e6dbe0
chore: Make EE plugin on frontend > fix build
JanCizmar Nov 28, 2024
4ce08e0
chore: Make EE plugin on frontend > fix build
JanCizmar Nov 28, 2024
bb0e32a
chore: Make EE plugin on frontend > fix build
JanCizmar Nov 28, 2024
7f0f332
chore: Make EE plugin on frontend > fix build
JanCizmar Nov 28, 2024
2a357b2
chore: Make EE removable on backend > it builds and runs with ee dir
JanCizmar Nov 29, 2024
a418fb4
chore: Works without EE
JanCizmar Nov 29, 2024
31bdcd2
chore: Move Content storage and content delivery
JanCizmar Nov 29, 2024
9d00670
chore: User menu items as plugin
JanCizmar Nov 29, 2024
ad280dd
chore: Project menu with plugin
JanCizmar Nov 29, 2024
4276b0c
chore: Project menu with plugin > Works without ee
JanCizmar Nov 29, 2024
9f55dd7
chore: Administration menu items as plugin
JanCizmar Dec 2, 2024
d6d467c
chore: Fix user menu test
JanCizmar Dec 3, 2024
c511300
chore: Fix user menu test
JanCizmar Dec 3, 2024
a24dd10
chore: Backend buildable without ee & tests
JanCizmar Dec 3, 2024
b8b1250
feat: restrict ee imports to `tg.ee`
stepan662 Dec 5, 2024
e4e4e3f
feat: restrict ee imports to `tg.ee`
stepan662 Dec 5, 2024
076620e
feat: restrict ee imports to `tg.ee`
stepan662 Dec 5, 2024
2e91bac
feat: restrict ee imports to `tg.ee`
stepan662 Dec 5, 2024
299b31c
feat: restrict ee imports to `tg.ee`
stepan662 Dec 5, 2024
4d029ae
feat: restrict ee imports to `tg.ee`
stepan662 Dec 5, 2024
e896142
feat: restrict ee imports to `tg.ee`
stepan662 Dec 5, 2024
faf73a9
fix: batch operations typed
stepan662 Dec 5, 2024
5330251
chore: fix tsconfig
stepan662 Dec 5, 2024
75a8887
chore: drop "plugin" naming
stepan662 Dec 6, 2024
167cbb8
chore: drop "plugin" naming
stepan662 Dec 6, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading