-
-
Notifications
You must be signed in to change notification settings - Fork 305
chore: Hibernate enhancer, Gradle config & GHA improvements #3126
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
Conversation
WalkthroughThis update introduces a custom Ktlint rule set to enforce the usage of Changes
Sequence Diagram(s)sequenceDiagram
participant Developer
participant Ktlint CLI
participant TolgeeRulesProvider
participant JakartaTransientInEntities
Developer->>Ktlint CLI: Run ktlint on codebase
Ktlint CLI->>TolgeeRulesProvider: Discover rule set providers
TolgeeRulesProvider-->>Ktlint CLI: Provide JakartaTransientInEntities rule
Ktlint CLI->>JakartaTransientInEntities: Analyze Kotlin files
JakartaTransientInEntities->>Ktlint CLI: Emit lint warnings if Kotlin @Transient used in JPA entity
Possibly related PRs
Suggested labels
Poem
β¨ Finishing Touches
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. πͺ§ TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. 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 using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 5
π§Ή Nitpick comments (11)
backend/data/src/main/kotlin/io/tolgee/model/ApiKey.kt (1)
55-56
: TransientencodedKey
is fine β maybe mark it asval
encodedKey
is now non-persistent, which makes sense.
Because the value is computed and not stored, consider declaring it as:@Transient var encodedKey: String? = null private setor even
val
with a custom getter if itβs never reassigned, reducing accidental mutations.ee/backend/tests/src/test/kotlin/io/tolgee/ee/api/v2/controllers/EeSubscriptionUsageControllerTest.kt (1)
99-100
: Prefer explicit null assertion over!!
to keep test failure messages clearUsing
body!!
will throw an NPE without context if the mock is mis-configured.
A more expressive alternative:val body = this.captor.allValues.single().body assertNotNull(body) { "Captured request body should not be null" } body!!.let { assertThatJson(it) { node("licenseKey").isEqualTo("mock") } }backend/data/build.gradle (1)
20-21
: Retain Kapt for Hibernate enhancements
Keepingorg.jetbrains.kotlin.kapt
due to HHH-15376 is necessary; consider marking this with a TODO to revisit once KSP support arrives.backend/data/src/main/kotlin/io/tolgee/security/ratelimit/RateLimitService.kt (1)
36-39
: Use a more specific exception type for fail-fast cache initialization
RuntimeException
is very broad.IllegalStateException
(or a customCacheInitializationException
) communicates the failure context better and is the conventional choice for βservice cannot startβ scenarios.- ?: throw RuntimeException("Could not initialize cache!") + ?: throw IllegalStateException("Rate-limit cache '${Caches.RATE_LIMITS}' not found β service cannot start")backend/data/src/test/kotlin/io/tolgee/unit/cachePurging/CloudflareContentStorageConfigCachePurgingTest.kt (1)
88-90
: Avoid!!
in tests to keep failure diagnostics clearIf
httpEntity.body
unexpectedly becomes null, the test will throw a bareKotlinNullPointerException
, masking the intent. Consider an explicit assertion instead:- assertThatJson(httpEntity.body!!) { + assertThat(httpEntity.body).isNotNull + assertThatJson(httpEntity.body) {backend/data/src/main/kotlin/io/tolgee/pubSub/RedisPubSubReceiver.kt (1)
18-21
: Good null-safety guard; consider reusing the ObjectMapperπ Skipping publish when
message
is null preventsconvertAndSend
NPEs.
Minor optimization: instantiatejacksonObjectMapper()
once (e.g., companion object) to avoid cost per message.companion object { private val mapper = jacksonObjectMapper() } fun receiveWebsocketMessage(message: String) { val data = mapper.readValue(message, RedisWebsocketEventWrapper::class.java) ... }backend/app/src/test/kotlin/io/tolgee/api/v2/controllers/translations/v2TranslationsController/TranslationsControllerHistoryTest.kt (1)
117-123
: Replace!!
with a safer null-handling constructBlindly asserting non-null with
!!
hides the reason when the value is unexpectedly null and turns the failure into an NPE with no context.
In test code you can get a much clearer message by usingrequireNotNull
(orassertNotNull
from JUnit) and fail fast with an explicit explanation.- performProjectAuthGet("/translations/${translation!!.id}/history").andPrettyPrint.andAssertThatJson { + val translationId = requireNotNull(translation?.id) { "Translation should exist in DB" } + performProjectAuthGet("/translations/$translationId/history").andPrettyPrint.andAssertThatJson {ee/backend/tests/src/test/kotlin/io/tolgee/ee/WebhookAutomationTest.kt (1)
113-118
: Avoid!!
when verifying webhook signature
httpEntity.body!!
will explode with an NPE if the body is null β precisely the situation you want the test to report gracefully.
Prefer an explicit assertion first (so the failure message is meaningful) or unwrap withrequireNotNull
.- httpEntity.body!!, + requireNotNull(httpEntity.body) { "Webhook body is unexpectedly null" },ee/backend/tests/src/test/kotlin/io/tolgee/ee/selfHostedLimitsAndReporting/CreditLimitTest.kt (1)
118-122
: Use the predefined constant instead of allocating newHttpHeaders
HttpHeaders.EMPTY
is a reusable singleton and avoids an unnecessary allocation each time the helper is called.- HttpHeaders(), + HttpHeaders.EMPTY,backend/data/src/test/kotlin/io/tolgee/unit/cachePurging/AzureContentStorageConfigCachePurgingTest.kt (2)
56-58
: Remove double bang afterblock()
to keep the stub self-containedStubbing
block()!!.token
requires the extra!!
and makes the chain brittle. You can stubblock()
to return a non-nullAccessToken
instead and drop the assertion:- whenever(credentialMck.getToken(any()).block()!!.token).thenReturn("token") + val accessToken = mock<AccessToken> { on { token } doReturn "token" } + whenever(credentialMck.getToken(any()).block()).thenReturn(accessToken)This keeps the test failure message focused on the stub, not an NPE.
68-71
: Prefer explicit assertion over!!
for request bodyAs with other tests, using
assertThatJson
already needs a non-null body; assert it first instead of!!
so you get a clear failure:- assertThatJson(httpEntity.body!!) { + val body = requireNotNull(httpEntity.body) { "Request body was null" } + assertThatJson(body) {
π Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
π Files selected for processing (29)
backend/api/build.gradle
(1 hunks)backend/app/build.gradle
(3 hunks)backend/app/src/test/kotlin/io/tolgee/api/v2/controllers/translations/v2TranslationsController/TranslationsControllerHistoryTest.kt
(1 hunks)backend/data/build.gradle
(7 hunks)backend/data/src/main/kotlin/io/tolgee/activity/annotation/ActivityLoggedProp.kt
(1 hunks)backend/data/src/main/kotlin/io/tolgee/model/ApiKey.kt
(1 hunks)backend/data/src/main/kotlin/io/tolgee/model/Organization.kt
(1 hunks)backend/data/src/main/kotlin/io/tolgee/model/Pat.kt
(1 hunks)backend/data/src/main/kotlin/io/tolgee/model/Project.kt
(1 hunks)backend/data/src/main/kotlin/io/tolgee/model/StandardAuditModel.kt
(1 hunks)backend/data/src/main/kotlin/io/tolgee/model/UserAccount.kt
(1 hunks)backend/data/src/main/kotlin/io/tolgee/model/activity/ActivityRevision.kt
(1 hunks)backend/data/src/main/kotlin/io/tolgee/model/dataImport/ImportLanguage.kt
(1 hunks)backend/data/src/main/kotlin/io/tolgee/model/keyBigMeta/KeysDistance.kt
(1 hunks)backend/data/src/main/kotlin/io/tolgee/pubSub/RedisPubSubReceiver.kt
(1 hunks)backend/data/src/main/kotlin/io/tolgee/pubSub/RedisPubSubReceiverConfiguration.kt
(1 hunks)backend/data/src/main/kotlin/io/tolgee/security/ratelimit/RateLimitService.kt
(1 hunks)backend/data/src/test/kotlin/io/tolgee/unit/cachePurging/AzureContentStorageConfigCachePurgingTest.kt
(2 hunks)backend/data/src/test/kotlin/io/tolgee/unit/cachePurging/CloudflareContentStorageConfigCachePurgingTest.kt
(1 hunks)backend/development/build.gradle
(1 hunks)backend/misc/build.gradle
(1 hunks)backend/security/build.gradle
(1 hunks)backend/testing/build.gradle
(2 hunks)ee/backend/app/build.gradle
(2 hunks)ee/backend/tests/build.gradle
(1 hunks)ee/backend/tests/src/test/kotlin/io/tolgee/ee/WebhookAutomationTest.kt
(1 hunks)ee/backend/tests/src/test/kotlin/io/tolgee/ee/api/v2/controllers/EeSubscriptionUsageControllerTest.kt
(1 hunks)ee/backend/tests/src/test/kotlin/io/tolgee/ee/selfHostedLimitsAndReporting/CreditLimitTest.kt
(2 hunks)gradle.properties
(1 hunks)
π§° Additional context used
𧬠Code Graph Analysis (1)
backend/app/src/test/kotlin/io/tolgee/api/v2/controllers/translations/v2TranslationsController/TranslationsControllerHistoryTest.kt (1)
backend/testing/src/main/kotlin/io/tolgee/fixtures/ProjectAuthRequestPerformer.kt (1)
performProjectAuthGet
(36-36)
β° Context from checks skipped due to timeout of 90000ms (3)
- GitHub Check: Frontend static check πͺ²
- GitHub Check: Build backend ποΈ
- GitHub Check: Build frontend ποΈ
π Additional comments (34)
backend/data/src/main/kotlin/io/tolgee/activity/annotation/ActivityLoggedProp.kt (1)
7-7
: Approve expanded annotation targets
IncludingAnnotationTarget.VALUE_PARAMETER
properly enables@ActivityLoggedProp
on method parameters in addition to properties. No issues detected.gradle.properties (1)
5-5
:β Verification inconclusive
Verify Hibernate version bump and check for vulnerabilities.
Ensure thathibernate-core:6.5.3.Final
is published in Maven Central, compatible with your other dependencies, and free of known security advisories. Run the following script to confirm:
π Script executed:
#!/bin/bash # 1. Verify artifact existence in Maven Central if [[ $(curl -s -o /dev/null -w "%{http_code}" \ "https://repo1.maven.org/maven2/org/hibernate/hibernate-core/6.5.3.Final/hibernate-core-6.5.3.Final.pom") != "200" ]]; then echo "ERROR: hibernate-core:6.5.3.Final not found in Maven Central" exit 1 fi # 2. Check for recent security advisories via GitHub CLI gh api graphql -f query=' { securityVulnerabilities(first: 5, ecosystem: "MAVEN", package: "org.hibernate:hibernate-core") { nodes { advisory { summary severity publishedAt } vulnerableVersionRange firstPatchedVersion { identifier } } } }'Length of output: 966
Update GraphQL query in verification script
The artifact
hibernate-core:6.5.3.Final
is available in Maven Central, but the GitHub GraphQL query must pass theecosystem
enum unquoted. Please update your verification script as follows and re-run (ensuregh
is authenticated):#!/bin/bash # 1. Verify artifact exists in Maven Central if [[ $(curl -s -o /dev/null -w "%{http_code}" \ "https://repo1.maven.org/maven2/org/hibernate/hibernate-core/6.5.3.Final/hibernate-core-6.5.3.Final.pom") != "200" ]]; then echo "ERROR: hibernate-core:6.5.3.Final not found in Maven Central" exit 1 fi # 2. Check for recent security advisories via GitHub GraphQL gh api graphql -f query=' { securityVulnerabilities(first: 5, ecosystem: MAVEN, package: "org.hibernate:hibernate-core") { nodes { advisory { summary severity publishedAt } vulnerableVersionRange firstPatchedVersion { identifier } } } }'Run this updated script and review any returned advisories to ensure there are no known vulnerabilities.
backend/data/src/main/kotlin/io/tolgee/model/keyBigMeta/KeysDistance.kt (1)
72-73
:new
flag is now purely transient β double-check lifecycle usageRemoving the
@Column
annotation means the flag will never be written to / read from DB, soisNew()
will always return the default value unless some service layer setsnew = true
before persisting.
If this assignment is forgotten, the entity may be treated as βexistingβ andsave()
may result in an update instead of an insert.Please verify callers or consider a helper constructor/factory which sets the flag explicitly.
backend/api/build.gradle (1)
32-37
: π Explicit Java 21 toolchainSwitching to
java { toolchain { β¦ } }
is the preferred, Gradle-native way. Nice clean-up.ee/backend/app/build.gradle (1)
100-100
: POI 5.4.0 upgrade β check transitive dependency changesApache POI 5.4.0 bumps commons-compress and xmlbeans. Verify this doesnβt conflict with the versions already constrained by Spring Bootβs BOM.
backend/data/src/main/kotlin/io/tolgee/model/dataImport/ImportLanguage.kt (1)
38-39
: Behaviour change:ignored
no longer mappedWith
@Transient
only, theignored
flag will not survive a session flush.
Ensure that all logic expecting this flag runs in the same persistence context, or persist its state elsewhere.backend/data/src/main/kotlin/io/tolgee/model/Pat.kt (1)
38-39
:β Verification inconclusive
token
is now completely ignored by JPA β confirm DB schema & queries stay consistentDropping
@Column(insertable = false, updatable = false)
means Hibernate will no longer be aware of anytoken
column that might still exist in the database.
- If the column is still present, it will silently be left unused (which is usually fine but worth documenting).
- Any JPQL/SQL that referenced
p.token
will now fail at runtime.Consider running a quick search to ensure no JPQL/Criteria/API queries refer to
token
:If nothing turns up, weβre safe; otherwise either keep the column mapping (with
insertable=false, updatable=false
) or refactor the queries.
π Script executed:
#!/bin/bash # Look for usages of Pat.token in JPQL or criteria builders rg -n $'\btoken\b' --type kotlin --type java | headLength of output: 53
π Script executed:
#!/bin/bash # Check for JPQL @Query annotations referencing token rg -n '@Query.*token' --type kotlin --type java # Check for any code accessing Pat.token rg -n 'p\.token' --type kotlin --type java # Search database migration/config files for token references rg -n 'token' --type sql --type yml --type xmlLength of output: 169
Confirm JPA removal of
token
column
Ran searches across Kotlin/Java/SQL/XML and found no references totoken
in code or migrations. Before approving, please manually verify:
- No JPQL/Criteria queries reference
token
- No DB migration or changelog files (SQL, YAML, XML) still use the
token
column- Documentation/changelog is updated to note that
token
is now ignored by JPAbackend/data/src/main/kotlin/io/tolgee/model/StandardAuditModel.kt (1)
29-31
:disableActivityLogging
removed from persistence layer β double-check auditing logicMarking the flag as
@Transient
prevents any value loaded from β or written to β the DB.
If other components rely on the column to be present (e.g., native SQL that disables audit triggers), behaviour will change silently.Search for raw SQL referencing
disable_activity_logging
to confirm nothing relies on the column.backend/development/build.gradle (2)
40-44
: Consistent Java 21 toolchain configuration applied
This replaces any previous Kotlin DSL toolchain with the standard Java toolchain API, ensuring all Java compilation uses JDK 21.
46-50
: Enforced strict nullability with JSR-305
Adding-Xjsr305=strict
improves JavaβKotlin interop by treating third-party nullability annotations as non-null by default.backend/misc/build.gradle (2)
25-29
: Java toolchain updated to JDK 21
Switching to the Java toolchain API ensures this module compiles consistently with Java 21.
31-35
: Strict JSR-305 nullability enforcement enabled
The compiler now treats JSR-305 annotations as strict, catching more potential null-safety issues at compile time.backend/testing/build.gradle (3)
46-50
: Java 21 toolchain configuration
Configuring the Java toolchain here guarantees test compilation runs on JDK 21 as well.
52-56
: Apply strict JSR-305 nullability in testing
Using-Xjsr305=strict
in test modules helps surface null-safety gaps earlier.
80-80
: UseannotationProcessor
for Spring config processor
Switching from kapt toannotationProcessor
for the configuration processor aligns with the removal of Kapt.backend/app/build.gradle (4)
35-37
: LinkannotationProcessor
tocompileOnly
ExtendingcompileOnly
fromannotationProcessor
ensures processor deps are available at compile time.
69-73
: Configured Java 21 toolchain
Explicitly targeting JDK 21 via the Java toolchain avoids reliance on the Kotlin DSL.
75-79
: Add strict JSR-305 compiler flag
Applying-Xjsr305=strict
globally promotes safer null handling across the module.
95-95
: UseannotationProcessor
for Spring configuration processor
This replaces prior Kapt usage and leverages the standard Java annotation processing mechanism.backend/data/build.gradle (8)
35-35
: Addktlint
configuration
Declaring a dedicatedktlint
config sets up Kotlin style checksβensure itβs integrated into CI.
40-42
: ExtendcompileOnly
fromannotationProcessor
This makes annotation processor dependencies visible during compilation.
52-52
: Apply Kotlin Kapt plugin
Usingapply plugin: "kotlin-kapt"
aligns with the plugins block entry and enables Kapt where still required.
83-87
: Configure Java 21 toolchain
Explicit Java toolchain ensures consistent JDK 21 usage across all compile tasks.
89-93
: Enforce strict JSR-305 nullability
Applying-Xjsr305=strict
tightens null-safety checks when interacting with Java libraries.
109-109
: UseannotationProcessor
for Spring config processor
Replacing the Kapt dependency for Springβs config processor withannotationProcessor
reduces Kapt usage to only where required.
186-187
: Upgrade Apache POI to 5.4.0
The POI bump aligns with other modulesβconfirm there are no breaking changes in spreadsheet handling or dependencies.
263-265
: Enable Hibernate bytecode enhancement
The emptyenhancement {}
block activates default enhancement behavior (lazy loading, dirty tracking).backend/data/src/main/kotlin/io/tolgee/model/activity/ActivityRevision.kt (1)
3-3
: Import addition looks correctSwitching to
jakarta.persistence.Transient
keeps the entity Jakarta-compatible and removes the redundant@Column
mapping. No issues spotted.backend/data/src/main/kotlin/io/tolgee/pubSub/RedisPubSubReceiverConfiguration.kt (1)
54-55
: Setter call is required on recent Spring Data
connectionFactory
is now a read-only property; usingsetConnectionFactory
prevents reflective write warnings. Looks good.backend/data/src/main/kotlin/io/tolgee/model/UserAccount.kt (1)
175-177
: π MakingdisableActivityLogging
purely transient is correctRemoving the
@Column
mapping eliminates accidental persistence and aligns with its intended runtime-only purpose. No further action needed.backend/data/src/main/kotlin/io/tolgee/model/Project.kt (2)
27-27
: Standardize JPA Transient import
Switching from Kotlinβskotlin.jvm.Transient
tojakarta.persistence.Transient
aligns with JPA bytecode enhancement and ensures the field is excluded from persistence.
107-108
: Apply@Transient
todisableActivityLogging
The JPA@Transient
annotation correctly marks this property as non-persistent and replaces the removed column mapping.backend/data/src/main/kotlin/io/tolgee/model/Organization.kt (2)
23-23
: Standardize JPA Transient import
Importingjakarta.persistence.Transient
here matches the change in other entities and ensures consistency across the module.
80-81
: Apply@Transient
todisableActivityLogging
Marking this flag with JPAβs@Transient
correctly excludes it from database mapping, replacing the former column constraints.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
π§Ή Nitpick comments (4)
backend/data/src/main/kotlin/io/tolgee/service/security/ApiKeyService.kt (1)
179-187
: Minor optimisation opportunity indecodeKey
error handlingThe two adjacent
catch
blocks that both returnnull
can be consolidated withrunCatching
for slightly cleaner code and to avoid duplicate branches:- return try { - val decoded = BaseEncoding.base32().omitPadding().lowerCase().decode(raw).decodeToString() - val (projectId, key) = decoded.split("_".toRegex(), 2) - DecodedApiKey(projectId.toLong(), key) - } catch (_: IllegalArgumentException) { - null - } catch (_: IndexOutOfBoundsException) { - null + return runCatching { + val decoded = BaseEncoding.base32().omitPadding().lowerCase().decode(raw).decodeToString() + val (projectId, key) = decoded.split('_', limit = 2) + DecodedApiKey(projectId.toLong(), key) + }.getOrNull()Benefits:
β’ Removes duplicatecatch
blocks.
β’ Usessplit
with a Char delimiter to avoid regex overhead.
Purely cosmeticβtake or leave as you see fit.ee/backend/tests/src/test/kotlin/io/tolgee/ee/selfHostedLimitsAndReporting/KeyCountLimitTest.kt (2)
31-33
: Drop redundant@Autowired
to avoid bean-duplication confusion
@MockBean
already places a mockRestTemplate
into the Spring context and autowires it.
Keeping@Autowired
here is superfluous and can trip IDE inspections.- @Autowired - @MockBean - private lateinit var restTemplate: RestTemplate + @MockBean + private lateinit var restTemplate: RestTemplate
34-40
: Tighten the mock setup & remove unreachable objects
mockAny
is never used outside this block β no need to keep a reference.any<Class<Any>>()
is fragile and will fail if theexchange
overload changes; match only the parameters you care about.- Prefer explicit
HttpMethod
matcher to document intent.- val mockAny = mock<Any>() - val mockResp = mock<ResponseEntity<Any>>() - whenever(restTemplate.exchange(any<String>(), any(), any(), any<Class<Any>>())).thenReturn(mockResp) - whenever(mockResp.body).thenReturn(mockAny) + val mockResp: ResponseEntity<Any> = mock() + whenever( + restTemplate.exchange( + any<String>(), + any(), // HttpMethod + any(), // HttpEntity + any<Class<Any>>() + ) + ).thenReturn(mockResp) + whenever(mockResp.body).thenReturn(mock())backend/data/src/test/kotlin/io/tolgee/service/machineTranslation/MtBatchTranslatorTest.kt (1)
248-252
: Extension helper ignores its receiver β simplify the APIThe inline helper is declared as an extension on
KClass<T>
but never usesthis
; the receiver is redundant:inline fun <reified T : Any> mockIntoAppContext(appContext: ApplicationContext): T { val mock = mock<T>() whenever(appContext.getBean(T::class.java)).thenReturn(mock) return mock }Usage would then be:
val entityManagerMock = mockIntoAppContext<EntityManager>(appContextMock)This removes cognitive overhead and keeps the type inference clear.
π Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
π Files selected for processing (9)
backend/app/src/main/resources/application.yaml
(0 hunks)backend/app/src/test/kotlin/io/tolgee/api/v2/controllers/ApiKeyControllerTest.kt
(0 hunks)backend/app/src/test/kotlin/io/tolgee/api/v2/controllers/PatControllerTest.kt
(4 hunks)backend/data/src/main/kotlin/io/tolgee/model/ApiKey.kt
(2 hunks)backend/data/src/main/kotlin/io/tolgee/model/Pat.kt
(2 hunks)backend/data/src/main/kotlin/io/tolgee/service/machineTranslation/MtBatchTranslator.kt
(1 hunks)backend/data/src/main/kotlin/io/tolgee/service/security/ApiKeyService.kt
(2 hunks)backend/data/src/test/kotlin/io/tolgee/service/machineTranslation/MtBatchTranslatorTest.kt
(6 hunks)ee/backend/tests/src/test/kotlin/io/tolgee/ee/selfHostedLimitsAndReporting/KeyCountLimitTest.kt
(2 hunks)
π€ Files with no reviewable changes (2)
- backend/app/src/test/kotlin/io/tolgee/api/v2/controllers/ApiKeyControllerTest.kt
- backend/app/src/main/resources/application.yaml
π§ Files skipped from review as they are similar to previous changes (2)
- backend/data/src/main/kotlin/io/tolgee/model/ApiKey.kt
- backend/data/src/main/kotlin/io/tolgee/model/Pat.kt
β° Context from checks skipped due to timeout of 90000ms (4)
- GitHub Check: Frontend static check πͺ²
- GitHub Check: Ktlint πͺ²
- GitHub Check: Build frontend ποΈ
- GitHub Check: Build backend ποΈ
π Additional comments (5)
backend/data/src/main/kotlin/io/tolgee/service/security/ApiKeyService.kt (1)
158-169
: Return statement change looks goodDropping the explicit
this.
qualifier is idiomatic Kotlin and has no functional impact.
No additional issues spotted in thesave
method.backend/app/src/test/kotlin/io/tolgee/api/v2/controllers/PatControllerTest.kt (2)
87-99
: Correctly migrated checks totokenHash
Good catch aligning the test with the new persistence model: checking
tokenHash
instead of the transienttoken
guarantees weβre validating what is actually stored.
104-118
: Validation of βnever-expiresβ regeneration looks solidAsserting the PAT had
expiresAt == null
before regeneration and verifying the hash changes afterwards accurately covers the regression surface introduced by the model refactor.backend/data/src/main/kotlin/io/tolgee/service/machineTranslation/MtBatchTranslator.kt (1)
169-173
: Safe-call removed β ensure all providers are registered
provider?.getMetadata(...)
βprovider.getMetadata(...)
assumes the bean is always present.
Good for null-safety, but missing beans will now throw immediately. Please double-check:
- All
MtServiceType.*.providerClass
values are registered as Spring beans in every profile.- Tests cover the negative scenario (e.g. unknown provider) or the call site guards against it.
No change required if this guarantee already holds.
backend/data/src/test/kotlin/io/tolgee/service/machineTranslation/MtBatchTranslatorTest.kt (1)
155-158
: Nice! Centralised mocking markedly reduces boilerplateConsolidating bean registration through
mockIntoAppContext
keeps the test readable and maintainable. π
backend/app/src/test/kotlin/io/tolgee/api/v2/controllers/PatControllerTest.kt
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
π§Ή Nitpick comments (8)
ee/backend/tests/src/test/kotlin/io/tolgee/ee/slack/SlackWithBatchOperationTest.kt (1)
96-97
: Assertion moved outside polling block can miss late updates
chatUpdateRequests
could still be populated a moment after thechatPostMessageRequests
count hits 3. By asserting immediately afterwards the test would pass even if an update sneaks in a few milliseconds later.Safer pattern:
waitForNotThrowing(timeout = 20_000) { mockedSlackClient.chatPostMessageRequests.assert.hasSize(3) -} - -mockedSlackClient.chatUpdateRequests.assert.hasSize(0) + mockedSlackClient.chatUpdateRequests.assert.hasSize(0) +}This keeps both conditions under the same polling guard and eliminates a potential race.
ee/backend/tests/src/test/kotlin/io/tolgee/ee/service/slack/SavedSlackMessageServiceTest.kt (1)
14-17
: Consider avoiding duplicate@SpringBootTest
inheritance
AbstractSpringTest
already brings up the Spring context in several other test classes.
If that base class is itself annotated with@SpringBootTest
, adding the annotation here is redundant and increases the risk of configuration drift (e.g. differentclasses
,webEnvironment
, orproperties
attributes later).
Double-check the annotation stack and delete the local one if the parent already covers it.backend/app/src/test/kotlin/io/tolgee/activity/ActivityLogTest.kt (3)
29-36
: Duplication of@SpringBootTest
β verify necessity
ProjectAuthControllerTest
is commonly used in the code-base without an explicit@SpringBootTest
; if its super-class (or a meta-annotation) already provides the context, this local annotation is superfluous and may slow the suite.
Remove it unless the test really needs a different setup than its siblings.
144-157
: Nit: avoid a mutable top-levelparams
shadow variable
params
is introduced only to capture the argument ofpostHog.capture
, and it is rewritten exactly once.
Prefer an immutableval
populated insideargThat
to drop the extra mutability and reduce race-condition risk when tests run in parallel.-var params: Map<String, Any?> = emptyMap() +lateinit var params: Map<String, Any?> ... argThat { - params = this + params = this // lateinit ensures assignment before use true }
239-245
: Shadowedit
hampers readabilityInside the
satisfies { β¦ }
block the nestedwaitFor { β¦ }
lambda re-uses the shorthandit
, shadowing the outer BigDecimal parameter.
Using named parameters clarifies intent and prevents accidental misuse.-node("id").isNumber.satisfies { - waitFor(pollTime = 2000) { - val job = batchJobService.findJobDto(it.toLong()) - job?.status?.completed == true - } -} +node("id").isNumber.satisfies { idValue -> + waitFor(pollTime = 2000) { + val job = batchJobService.findJobDto(idValue.toLong()) + job?.status?.completed == true + } +}backend/data/src/main/kotlin/io/tolgee/activity/annotation/ActivityIgnoredProp.kt (1)
6-7
: Consider adding explicit retention for clarity
AnnotationRetention.RUNTIME
is the default, but declaring it explicitly makes the intent unambiguous and prevents future surprises if projectβwide defaults are ever modified.@Target(AnnotationTarget.FIELD) +@Retention(AnnotationRetention.RUNTIME) annotation class ActivityIgnoredProp
backend/data/src/main/kotlin/io/tolgee/activity/annotation/ActivityLoggedProp.kt (1)
7-10
: Explicitly declare retention for consistencyAs with
ActivityIgnoredProp
, consider being explicit about runtime retention. This keeps all activity annotations consistent and self-documenting.@Target(AnnotationTarget.FIELD) +@Retention(AnnotationRetention.RUNTIME) annotation class ActivityLoggedProp( val modificationProvider: KClass<out PropChangesProvider> = DefaultPropChangesProvider::class, )
backend/data/src/main/kotlin/io/tolgee/activity/EntityDescriptionProvider.kt (1)
11-15
: Unused import?
kotlin.reflect.full.superclasses
is still imported but no longer referenced in this file after the refactor. Remove it to avoid misleading readers.
π Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
π Files selected for processing (12)
backend/app/src/test/kotlin/io/tolgee/activity/ActivityLogTest.kt
(4 hunks)backend/data/src/main/kotlin/io/tolgee/activity/EntityDescriptionProvider.kt
(2 hunks)backend/data/src/main/kotlin/io/tolgee/activity/annotation/ActivityDescribingProp.kt
(1 hunks)backend/data/src/main/kotlin/io/tolgee/activity/annotation/ActivityEntityDescribingPaths.kt
(1 hunks)backend/data/src/main/kotlin/io/tolgee/activity/annotation/ActivityIgnoredProp.kt
(1 hunks)backend/data/src/main/kotlin/io/tolgee/activity/annotation/ActivityLoggedProp.kt
(1 hunks)backend/data/src/main/kotlin/io/tolgee/activity/annotation/ActivityReturnsExistence.kt
(1 hunks)backend/data/src/main/kotlin/io/tolgee/activity/iterceptor/InterceptedEventsManager.kt
(1 hunks)backend/data/src/main/kotlin/io/tolgee/model/translation/Translation.kt
(2 hunks)ee/backend/tests/src/test/kotlin/io/tolgee/ee/api/v2/controllers/task/TaskControllerActivityTest.kt
(0 hunks)ee/backend/tests/src/test/kotlin/io/tolgee/ee/service/slack/SavedSlackMessageServiceTest.kt
(1 hunks)ee/backend/tests/src/test/kotlin/io/tolgee/ee/slack/SlackWithBatchOperationTest.kt
(1 hunks)
π€ Files with no reviewable changes (1)
- ee/backend/tests/src/test/kotlin/io/tolgee/ee/api/v2/controllers/task/TaskControllerActivityTest.kt
β Files skipped from review due to trivial changes (4)
- backend/data/src/main/kotlin/io/tolgee/activity/annotation/ActivityDescribingProp.kt
- backend/data/src/main/kotlin/io/tolgee/activity/annotation/ActivityEntityDescribingPaths.kt
- backend/data/src/main/kotlin/io/tolgee/activity/annotation/ActivityReturnsExistence.kt
- backend/data/src/main/kotlin/io/tolgee/model/translation/Translation.kt
β° Context from checks skipped due to timeout of 90000ms (4)
- GitHub Check: Ktlint πͺ²
- GitHub Check: Frontend static check πͺ²
- GitHub Check: Build frontend ποΈ
- GitHub Check: Build backend ποΈ
π Additional comments (1)
ee/backend/tests/src/test/kotlin/io/tolgee/ee/slack/SlackWithBatchOperationTest.kt (1)
92-94
: Reduced timeout may re-introduce test flakinessCutting the wait window from 120 s to 20 s leaves little head-room for CI nodes under heavy load. If the batch runner or Slack mock is a bit slower, the assertion can start failing spuriously.
Consider restoring a more generous timeout (e.g. 60 s) or extracting it into a constant that can be tuned centrally for all slow-running environments.
backend/data/src/main/kotlin/io/tolgee/activity/EntityDescriptionProvider.kt
Show resolved
Hide resolved
backend/data/src/main/kotlin/io/tolgee/activity/iterceptor/InterceptedEventsManager.kt
Outdated
Show resolved
Hide resolved
backend/data/src/main/kotlin/io/tolgee/activity/iterceptor/InterceptedEventsManager.kt
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
π§Ή Nitpick comments (3)
settings.gradle (1)
54-55
: Keep version-catalog declaration style consistentMost catalog entries use the 3-arg form (
library(alias, group, name).version("x.y")
).
The newassertJCore
entry switches to the single-string notation:library('assertJCore', 'org.assertj:assertj-core:3.27.3')Consider aligning with the prevailing style for readability and easy version bumps:
-library('assertJCore', 'org.assertj:assertj-core:3.27.3') +library('assertJCore', 'org.assertj', 'assertj-core').version('3.27.3').github/workflows/test.yml (1)
83-84
:ktlint:test
may re-compile sources already built in the previous jobThe
backend-build
stage archives only selected modules.
Becausektlint
isnβt among them, the later./gradlew ktlint:test
inbackend-test
triggers a fresh compile, elongating CI.Either:
- Add
:ktlint:build
to the build matrix so its classes are in the tarball, or- Accept the small compile hit (itβs <5 s locally).
No action required if the time budget is acceptable.
backend/app/src/test/kotlin/io/tolgee/api/v2/controllers/batch/BatchJobManagementControllerCancellationTest.kt (1)
38-39
: Consider narrowing the@SpringBootTest
scope to speed up the test suite.Loading the full application context can add several seconds per test class.
If this test only needs MVC + DB beans, you can trim the footprint, e.g.:@SpringBootTest( classes = [BatchJobManagementController::class], webEnvironment = SpringBootTest.WebEnvironment.MOCK )or even replace it with
@WebMvcTest(...)
plus the required@Import
/@MockBean
s.
This keeps the test intent intact while noticeably reducing start-up time.
π Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
π Files selected for processing (24)
.editorconfig
(1 hunks).github/workflows/test.yml
(1 hunks)backend/api/build.gradle
(2 hunks)backend/app/build.gradle
(4 hunks)backend/app/src/test/kotlin/io/tolgee/api/v2/controllers/batch/BatchJobManagementControllerCancellationTest.kt
(1 hunks)backend/data/build.gradle
(8 hunks)backend/data/src/main/kotlin/io/tolgee/activity/EntityDescriptionProvider.kt
(2 hunks)backend/data/src/main/kotlin/io/tolgee/activity/annotation/ActivityLoggedEntity.kt
(1 hunks)backend/data/src/main/kotlin/io/tolgee/activity/iterceptor/InterceptedEventsManager.kt
(3 hunks)backend/development/build.gradle
(2 hunks)backend/ktlint/build.gradle
(1 hunks)backend/ktlint/settings.gradle
(1 hunks)backend/ktlint/src/main/kotlin/io/tolgee/testing/ktlint/TolgeeRulesProvider.kt
(1 hunks)backend/ktlint/src/main/kotlin/io/tolgee/testing/ktlint/rules/JakartaTransientInEntities.kt
(1 hunks)backend/ktlint/src/main/resources/META-INF/services/com.pinterest.ktlint.cli.ruleset.core.api.RuleSetProviderV3
(1 hunks)backend/ktlint/src/test/kotlin/io/tolgee/testing/ktlint/JakartaTransientInEntitiesTest.kt
(1 hunks)backend/misc/build.gradle
(1 hunks)backend/security/build.gradle
(2 hunks)backend/testing/build.gradle
(3 hunks)backend/testing/src/main/kotlin/io/tolgee/fixtures/scopeAssert.kt
(1 hunks)ee/backend/app/build.gradle
(1 hunks)ee/backend/tests/build.gradle
(1 hunks)ee/backend/tests/src/test/kotlin/io/tolgee/ee/WebhookAutomationTest.kt
(3 hunks)settings.gradle
(3 hunks)
β Files skipped from review due to trivial changes (6)
- backend/ktlint/settings.gradle
- backend/ktlint/src/main/resources/META-INF/services/com.pinterest.ktlint.cli.ruleset.core.api.RuleSetProviderV3
- backend/data/src/main/kotlin/io/tolgee/activity/annotation/ActivityLoggedEntity.kt
- backend/testing/src/main/kotlin/io/tolgee/fixtures/scopeAssert.kt
- backend/ktlint/build.gradle
- .editorconfig
π§ Files skipped from review as they are similar to previous changes (12)
- backend/api/build.gradle
- ee/backend/tests/src/test/kotlin/io/tolgee/ee/WebhookAutomationTest.kt
- backend/security/build.gradle
- ee/backend/app/build.gradle
- backend/testing/build.gradle
- ee/backend/tests/build.gradle
- backend/data/src/main/kotlin/io/tolgee/activity/iterceptor/InterceptedEventsManager.kt
- backend/app/build.gradle
- backend/data/build.gradle
- backend/development/build.gradle
- backend/misc/build.gradle
- backend/data/src/main/kotlin/io/tolgee/activity/EntityDescriptionProvider.kt
π Additional comments (5)
settings.gradle (2)
64-65
: Verify transitive-dependency impact of the libraries-bom jump
googleCloud
BOM leaps from24.0.0
β26.61.0
β a 2-year gap.
Although BOMs are meant to stay compatible, many artifacts upgraded major versions in that time. Please run the build with--refresh-dependencies
and scan for:
- Removed/relocated modules (e.g.
google-cloud-*
renames)- Breaking API changes surfaced in compilation errors.
This avoids surprises in downstream modules.
126-129
: Double-check module include orderingThe new module is tacked onto the bottom of the
include
list.
ktlint
produces a standalone JAR and does not depend on other backend projects, so ordering is safe.
Just ensurebackend/ktlint/build.gradle
has:tasks.named('jar').configure { archiveBaseName = 'tolgee-ktlint-rules' }so that consuming modules can use the published artifact instead of recompiling it.
backend/ktlint/src/main/kotlin/io/tolgee/testing/ktlint/TolgeeRulesProvider.kt (1)
24-34
: Minimal, correct provider implementationImplementation follows the Ktlint ΒΉΒΉ API β rule-set id, provider, and service-loader wiring look good. π
backend/ktlint/src/test/kotlin/io/tolgee/testing/ktlint/JakartaTransientInEntitiesTest.kt (1)
24-42
: Error message hard-codesMyEntity
β tests lock-in a bugThe rule currently emits the string βUnexpected Kotlin-native @transient in MyEntity β¦β.
Tests assert this exact literal, making the rule appear correct even when run on
User
,Project
, β¦ classes.Prefer a dynamic or generic message β see next comment on the rule itself β and
update tests accordingly to avoid false confidence.backend/app/src/test/kotlin/io/tolgee/api/v2/controllers/batch/BatchJobManagementControllerCancellationTest.kt (1)
33-33
:β Incorrect review comment
Check whether the base test class already pulls in
@SpringBootTest
.If
ProjectAuthControllerTest
(or any meta-annotation it uses) is already annotated with@SpringBootTest
, this additional import is redundant and may confuse future readers about which configuration actually drives the context load.
π Script executed:
#!/bin/bash # Verify whether ProjectAuthControllerTest already carries @SpringBootTest rg -n $'class ProjectAuthControllerTest' -A 5 | rg '@SpringBootTest' || trueLength of output: 74
Letβs locate the
ProjectAuthControllerTest
file and check it directly for@SpringBootTest
.
π Script executed:
#!/bin/bash # Find the file containing ProjectAuthControllerTest file=$(rg -l "class ProjectAuthControllerTest" --glob "*.kt") echo "Found file: $file" # Check if that file declares @SpringBootTest rg -n "@SpringBootTest" "$file" || trueLength of output: 411
Keep the
@SpringBootTest
importThe base test class (
backend/testing/src/main/kotlin/io/tolgee/ProjectAuthControllerTest.kt
) does not declare@SpringBootTest
(nor use a meta-annotation that does), so the import in
backend/app/src/test/kotlin/io/tolgee/api/v2/controllers/batch/BatchJobManagementControllerCancellationTest.kt
is required.Likely an incorrect or invalid review comment.
backend/ktlint/src/main/kotlin/io/tolgee/testing/ktlint/rules/JakartaTransientInEntities.kt
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
π§Ή Nitpick comments (3)
backend/app/src/test/kotlin/io/tolgee/api/v2/controllers/v2KeyController/KeyControllerCreationTest.kt (2)
289-291
: Prefer loss-lesslongValueExact()
when converting JSON numbers
id
arrives from the JSON assertion API as aBigDecimal
.
UsingtoLong()
will silently truncate a non-integral value, whereaslongValueExact()
(or KotlinβstoLongExact()
) will throw if the value cannot be represented exactly β safer and self-documenting.- node("id").isNumber.satisfies { it -> - bigMetaService.getCloseKeyIds(it.toLong()).assert.hasSize(1) + node("id").isNumber.satisfies { idNum -> + bigMetaService.getCloseKeyIds(idNum.longValueExact()).assert.hasSize(1) }
306-311
: Same precision concern for the secondid
usageFor consistency with the previous suggestion and to avoid silent truncation:
- node("id").isNumber.satisfies { id -> - executeInNewTransaction { - val key = keyService.get(id.toLong()) + node("id").isNumber.satisfies { idNum -> + executeInNewTransaction { + val key = keyService.get(idNum.longValueExact()) key.translations.find { it.language.tag == "en" }!!.state.assert.isEqualTo(TranslationState.REVIEWED) } }backend/app/src/test/kotlin/io/tolgee/api/v2/controllers/v2ImageUploadController/V2ImageUploadControllerTest.kt (1)
53-57
: Minor readability tweak for lambda parameter
it
is okay, but naming the lambda argument makes the intent clearer and avoids nested-it
confusion.- node("requestFilename").isString.satisfies { - val file = fileStorage.fileExists("uploadedImages/" + it).assert.isTrue() - fileStorage.readFile("uploadedImages/" + it) + node("requestFilename").isString.satisfies { filename -> + val file = fileStorage.fileExists("uploadedImages/$filename").assert.isTrue() + fileStorage.readFile("uploadedImages/$filename") .size.assert.isCloseTo(5538, Offset.offset(500)) }
π Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
π Files selected for processing (19)
backend/api/build.gradle
(2 hunks)backend/app/build.gradle
(4 hunks)backend/app/src/test/kotlin/io/tolgee/activity/ActivityLogTest.kt
(4 hunks)backend/app/src/test/kotlin/io/tolgee/api/v2/controllers/translations/v2TranslationsController/TranslationsControllerCursorTest.kt
(1 hunks)backend/app/src/test/kotlin/io/tolgee/api/v2/controllers/translations/v2TranslationsController/TranslationsControllerModificationTest.kt
(1 hunks)backend/app/src/test/kotlin/io/tolgee/api/v2/controllers/v2ImageUploadController/V2ImageUploadControllerTest.kt
(1 hunks)backend/app/src/test/kotlin/io/tolgee/api/v2/controllers/v2KeyController/KeyControllerCreationTest.kt
(1 hunks)backend/app/src/test/kotlin/io/tolgee/initialUserCreation/LegacyMigrationTest.kt
(1 hunks)backend/data/src/main/kotlin/io/tolgee/model/Organization.kt
(1 hunks)backend/data/src/main/kotlin/io/tolgee/model/Pat.kt
(2 hunks)backend/data/src/main/kotlin/io/tolgee/model/Project.kt
(1 hunks)backend/data/src/main/kotlin/io/tolgee/model/StandardAuditModel.kt
(1 hunks)backend/data/src/main/kotlin/io/tolgee/model/UserAccount.kt
(1 hunks)backend/data/src/main/kotlin/io/tolgee/model/activity/ActivityRevision.kt
(1 hunks)backend/data/src/main/kotlin/io/tolgee/model/dataImport/ImportLanguage.kt
(1 hunks)backend/data/src/main/kotlin/io/tolgee/model/keyBigMeta/KeysDistance.kt
(1 hunks)backend/testing/src/main/kotlin/io/tolgee/fixtures/assert.kt
(1 hunks)backend/testing/src/main/kotlin/io/tolgee/fixtures/statusExpectations.kt
(1 hunks)settings.gradle
(2 hunks)
β Files skipped from review due to trivial changes (4)
- backend/app/src/test/kotlin/io/tolgee/api/v2/controllers/translations/v2TranslationsController/TranslationsControllerCursorTest.kt
- backend/app/src/test/kotlin/io/tolgee/initialUserCreation/LegacyMigrationTest.kt
- backend/testing/src/main/kotlin/io/tolgee/fixtures/assert.kt
- backend/testing/src/main/kotlin/io/tolgee/fixtures/statusExpectations.kt
π§ Files skipped from review as they are similar to previous changes (12)
- backend/data/src/main/kotlin/io/tolgee/model/activity/ActivityRevision.kt
- backend/data/src/main/kotlin/io/tolgee/model/Project.kt
- backend/data/src/main/kotlin/io/tolgee/model/UserAccount.kt
- backend/data/src/main/kotlin/io/tolgee/model/Organization.kt
- backend/data/src/main/kotlin/io/tolgee/model/keyBigMeta/KeysDistance.kt
- backend/data/src/main/kotlin/io/tolgee/model/StandardAuditModel.kt
- backend/api/build.gradle
- settings.gradle
- backend/data/src/main/kotlin/io/tolgee/model/dataImport/ImportLanguage.kt
- backend/app/build.gradle
- backend/app/src/test/kotlin/io/tolgee/activity/ActivityLogTest.kt
- backend/data/src/main/kotlin/io/tolgee/model/Pat.kt
β° Context from checks skipped due to timeout of 90000ms (3)
- GitHub Check: Build backend ποΈ
- GitHub Check: Build frontend ποΈ
- GitHub Check: Frontend static check πͺ²
π Additional comments (3)
backend/app/src/test/kotlin/io/tolgee/api/v2/controllers/v2KeyController/KeyControllerCreationTest.kt (1)
18-18
: New helper import looks goodThe dedicated
satisfies
extension brings the AssertJ-style assertions closer to the JSON DSL and is actually used below, so there is no risk of an unused-import warning.backend/app/src/test/kotlin/io/tolgee/api/v2/controllers/translations/v2TranslationsController/TranslationsControllerModificationTest.kt (1)
13-13
: Import addition is appropriateThe new
satisfies
helper is used later in the test suite (e.g., at line 207) and keeps assertion code terse. No further action needed.backend/app/src/test/kotlin/io/tolgee/api/v2/controllers/v2ImageUploadController/V2ImageUploadControllerTest.kt (1)
14-14
: Good adoption of the common assertion helperThe added import is necessary for the new
requestFilename
check (lines 53-57) and keeps style consistent across tests.
PR's ready! CI fails, but:
Additional notes:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
π Outside diff range comments (1)
.github/actions/upload-backend-build/action.yaml (1)
20-35
:β οΈ Potential issueUse
$HOME
instead of~
inupload-artifact
paths
Theactions/upload-artifact
input does not expand~
; switch to$HOME
or${{ runner.home }}
to reliably reference the home directory.- path: | - ~/backend-api.tar.zst - ~/backend-app.tar.zst - ~/backend-data.tar.zst - ~/backend-misc.tar.zst - ~/backend-security.tar.zst - ~/backend-testing.tar.zst - ~/backend-ktlint.tar.zst - ~/backend-development.tar.zst - ~/ee-backend-app.tar.zst - ~/ee-backend-tests.tar.zst + path: | + $HOME/backend-api.tar.zst + $HOME/backend-app.tar.zst + $HOME/backend-data.tar.zst + $HOME/backend-misc.tar.zst + $HOME/backend-security.tar.zst + $HOME/backend-testing.tar.zst + $HOME/backend-ktlint.tar.zst + $HOME/backend-development.tar.zst + $HOME/ee-backend-app.tar.zst + $HOME/ee-backend-tests.tar.zst
β»οΈ Duplicate comments (2)
ee/backend/tests/src/test/kotlin/io/tolgee/ee/selfHostedLimitsAndReporting/SeatUsageReportingTest.kt (1)
29-31
: Same global-state concern as inScheduledUsageReportingTest
disableStub
is enabled but never cleared afterwards, so later tests may observe side-effects.Either reset the flag in an
@AfterEach
block or mark the test class with@DirtiesContext
to rebuild the Spring context.Also applies to: 47-48
ee/backend/tests/src/test/kotlin/io/tolgee/ee/selfHostedLimitsAndReporting/KeyUsageReportingTest.kt (1)
37-39
: Global mutable flag β flakiness riskAs with the other two tests, remember to restore
disableStub
after the test completes to keep execution order independent.Also applies to: 131-132
π§Ή Nitpick comments (3)
ee/backend/tests/src/test/kotlin/io/tolgee/ee/service/slack/SlackConfigServiceTest.kt (1)
12-15
:@SpringBootTest
may be redundant / expensive β checkAbstractSpringTest
AbstractSpringTest
in this codebase is already annotated with@SpringBootTest
(and some extra context configuration).
Adding the annotation again at the subclass level is harmless but unnecessary and makes the intent harder to read.
Unless you need a differentwebEnvironment
or property set here, consider removing the duplicate.-@SpringBootTest class SlackConfigServiceTest : AbstractSpringTest() {
This will shave a few milliseconds off the test discovery phase and keeps annotation pollution low.
build.gradle (1)
151-159
: Task-skipping logic starting to get brittle β centralise the predicateWe now list 9 explicit tasks that must honour
SKIP_SERVER_BUILD
, recently addingcompileJava
andkaptGenerateStubsKotlin
.
Every time a new code-gen or compilation task appears we repeat this dance.Consider declaring a single helper and applying it by type:
def shouldRun = { System.getenv("SKIP_SERVER_BUILD") != "true" } tasks.configureEach { onlyIf(shouldRun) }β¦or at least using
tasks.matching { it.name in [...] }
to avoid copy-paste.
This will reduce maintenance as Gradle / plugins evolve..github/actions/upload-backend-build/action.yaml (1)
6-18
: Replace hard-coded tar commands with a loop and use$HOME
Relying on~
may not expand in all contexts, and duplicating similar lines hurts maintainability.- run: | - tar --zstd -cf ~/backend-api.tar.zst ./backend/api/build - tar --zstd -cf ~/backend-app.tar.zst ./backend/app/build - tar --zstd -cf ~/backend-data.tar.zst ./backend/data/build - tar --zstd -cf ~/backend-misc.tar.zst ./backend/misc/build - tar --zstd -cf ~/backend-security.tar.zst ./backend/security/build - tar --zstd -cf ~/backend-testing.tar.zst ./backend/testing/build - tar --zstd -cf ~/backend-ktlint.tar.zst ./backend/ktlint/build - tar --zstd -cf ~/backend-development.tar.zst ./backend/development/build - tar --zstd -cf ~/ee-backend-app.tar.zst ./ee/backend/app/build - tar --zstd -cf ~/ee-backend-tests.tar.zst ./ee/backend/tests/build + run: | + for module in api app data misc security testing ktlint development; do + tar --zstd -cf $HOME/backend-$module.tar.zst ./backend/$module/build + done + tar --zstd -cf $HOME/ee-backend-app.tar.zst ./ee/backend/app/build + tar --zstd -cf $HOME/ee-backend-tests.tar.zst ./ee/backend/tests/build
π Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
π Files selected for processing (15)
.github/actions/download-backend-build/action.yaml
(1 hunks).github/actions/setup-env/action.yaml
(1 hunks).github/actions/upload-backend-build/action.yaml
(1 hunks).github/workflows/reportIntermittentTests.yml
(7 hunks).github/workflows/test.yml
(9 hunks).java-version
(1 hunks)build.gradle
(1 hunks)ee/backend/tests/src/test/kotlin/io/tolgee/ee/EeLicensingMockRequestUtil.kt
(1 hunks)ee/backend/tests/src/test/kotlin/io/tolgee/ee/selfHostedLimitsAndReporting/KeyUsageReportingTest.kt
(3 hunks)ee/backend/tests/src/test/kotlin/io/tolgee/ee/selfHostedLimitsAndReporting/ScheduledUsageReportingTest.kt
(3 hunks)ee/backend/tests/src/test/kotlin/io/tolgee/ee/selfHostedLimitsAndReporting/SeatUsageReportingTest.kt
(3 hunks)ee/backend/tests/src/test/kotlin/io/tolgee/ee/service/slack/SlackConfigServiceTest.kt
(1 hunks)ee/backend/tests/src/test/kotlin/io/tolgee/ee/stubs/TolgeeCloudLicencingClientStub.kt
(1 hunks)gradle.properties
(1 hunks)settings.gradle
(3 hunks)
β Files skipped from review due to trivial changes (4)
- .java-version
- ee/backend/tests/src/test/kotlin/io/tolgee/ee/EeLicensingMockRequestUtil.kt
- .github/actions/setup-env/action.yaml
- .github/actions/download-backend-build/action.yaml
π§ Files skipped from review as they are similar to previous changes (1)
- settings.gradle
π§° Additional context used
πͺ actionlint (1.7.7)
.github/workflows/reportIntermittentTests.yml
15-15: description is required in metadata of "Setup environment" action at "/home/jailuser/git/.github/actions/setup-env/action.yaml"
(action)
21-21: description is required in metadata of "Upload backend build" action at "/home/jailuser/git/.github/actions/upload-backend-build/action.yaml"
(action)
48-48: description is required in metadata of "Download backend build" action at "/home/jailuser/git/.github/actions/download-backend-build/action.yaml"
(action)
.github/workflows/test.yml
17-17: description is required in metadata of "Setup environment" action at "/home/jailuser/git/.github/actions/setup-env/action.yaml"
(action)
29-29: description is required in metadata of "Upload backend build" action at "/home/jailuser/git/.github/actions/upload-backend-build/action.yaml"
(action)
113-113: description is required in metadata of "Download backend build" action at "/home/jailuser/git/.github/actions/download-backend-build/action.yaml"
(action)
β° Context from checks skipped due to timeout of 90000ms (4)
- GitHub Check: Frontend static check πͺ²
- GitHub Check: Ktlint πͺ²
- GitHub Check: Build backend ποΈ
- GitHub Check: Build frontend ποΈ
π Additional comments (14)
gradle.properties (1)
5-5
: Confirm compatibility of Hibernate 6.5.3.Final with the rest of the stackThe upgrade itself looks fine, but Hibernate minor releases occasionally change byte-code enhancement internals. Please make sure:
hibernate.version
overrides in sub-modules were removed (you already propagate viaext
β good),- no run-time warnings such as βEnhancement failed β class already transformedβ appear during the test suite,
- generated Liquibase diff still works (column length changes have bitten us before).
If CI is flaky right now, consider running
./gradlew :server-app:integrationTest
locally once to be safe..github/workflows/test.yml (7)
14-14
: Upgradeactions/checkout
to v4 across all jobs
Usingactions/checkout@v4
consistently ensures you benefit from the latest performance and security improvements.Also applies to: 50-50, 107-107, 183-183, 210-210, 260-260, 289-289
16-17
: Centralize environment setup with composite action
Calling./.github/actions/setup-env
replaces scattered Java/Node/Gradle steps and reduces duplication.Also applies to: 52-53, 109-110, 185-186, 328-329
π§° Tools
πͺ actionlint (1.7.7)
17-17: description is required in metadata of "Setup environment" action at "/home/jailuser/git/.github/actions/setup-env/action.yaml"
(action)
26-26
: Simplify backend build invocation
Switching to./gradlew classes jar bootJar
without generating per-module archives aligns with the new upload action.
28-29
: Adopt custom composite actions for artifact handling
Replacing manual tar commands withupload-backend-build
/download-backend-build
improves DRYness and clarity.Also applies to: 56-56
π§° Tools
πͺ actionlint (1.7.7)
29-29: description is required in metadata of "Upload backend build" action at "/home/jailuser/git/.github/actions/upload-backend-build/action.yaml"
(action)
47-47
: Includektlint:test
in the backend test matrix
Good catchβadding tests for the newktlint
module ensures code-style checks are validated in CI.
116-116
: Upgrade cache actions toactions/cache@v4
Moving Node.js cache steps to v4 enhances stability and speeds up dependency fetching.Also applies to: 189-189, 217-217, 268-268, 297-297
135-135
: Standardize Zstandard compression in E2E steps
Consistent use oftar --zstd
for caching and artifacts aligns with upstream changes.Also applies to: 143-143, 308-308, 312-312
.github/workflows/reportIntermittentTests.yml (6)
12-12
: Upgradeactions/checkout
to v4 across all jobs
Ensuring all checkout steps use the latest version improves consistency and security.Also applies to: 42-42, 93-93, 185-185
14-15
: Adopt composite environment setup
Replacing inline Java/Node/Gradle installs with thesetup-env
composite action reduces maintenance overhead.Also applies to: 44-45, 95-97, 161-162
π§° Tools
πͺ actionlint (1.7.7)
15-15: description is required in metadata of "Setup environment" action at "/home/jailuser/git/.github/actions/setup-env/action.yaml"
(action)
18-18
: Simplify backend build step
Running./gradlew classes jar bootJar
here matches the pattern in the main test workflow.
20-21
: Use custom upload action for backend artifacts
Standardizing onupload-backend-build
makes artifact handling uniform.π§° Tools
πͺ actionlint (1.7.7)
21-21: description is required in metadata of "Upload backend build" action at "/home/jailuser/git/.github/actions/upload-backend-build/action.yaml"
(action)
48-49
: Use custom download action for backend artifacts
Centralizes and consolidates artifact extraction logic.Also applies to: 105-106
π§° Tools
πͺ actionlint (1.7.7)
48-48: description is required in metadata of "Download backend build" action at "/home/jailuser/git/.github/actions/download-backend-build/action.yaml"
(action)
121-121
: Standardize Zstandard compression across workflows
Uniformtar --zstd
usage in both intermittent and main flows reduces cognitive overhead.Also applies to: 129-129, 204-204, 208-208
...sts/src/test/kotlin/io/tolgee/ee/selfHostedLimitsAndReporting/ScheduledUsageReportingTest.kt
Show resolved
Hide resolved
ee/backend/tests/src/test/kotlin/io/tolgee/ee/stubs/TolgeeCloudLicencingClientStub.kt
Outdated
Show resolved
Hide resolved
From just this single run, it seems that running tests is a bit less flaky than it used to be; fingers crossed it's actually the case and we'll see fewer false negatives in the future :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
π§Ή Nitpick comments (3)
.github/actions/setup-env/action.yaml (3)
4-13
: Consider declaring boolean input types
Inputsjava
,node
, andnpm-cache
are defined with string defaults. You can improve clarity by addingtype: boolean
so GitHub Actions will parse them natively as booleans.
25-28
: Add caching for Gradle dependencies
This action sets up Gradle but doesnβt cache its dependency directory (~/.gradle
). To speed up builds, mirror the Node cache step with Gradle, for example:- name: Cache Gradle dependencies uses: actions/cache@v4 with: path: ~/.gradle/caches key: cache-gradle-${{ runner.os }}-${{ hashFiles('**/*.gradle*') }} restore-keys: cache-gradle-${{ runner.os }}-
35-42
: Improve cross-OS npm cache path
~/.npm
expands on Linux/macOS but not Windows. Either use${{ env.HOME }}/.npm
or leverageactions/setup-node@v4
βs built-incache: 'npm'
option to handle caching uniformly.
π Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
π Files selected for processing (9)
.github/actions/download-backend-build/action.yaml
(1 hunks).github/actions/setup-env/action.yaml
(1 hunks).github/actions/upload-backend-build/action.yaml
(1 hunks).github/workflows/reportIntermittentTests.yml
(6 hunks).github/workflows/test.yml
(8 hunks)ee/backend/tests/src/test/kotlin/io/tolgee/ee/selfHostedLimitsAndReporting/KeyUsageReportingTest.kt
(4 hunks)ee/backend/tests/src/test/kotlin/io/tolgee/ee/selfHostedLimitsAndReporting/ScheduledUsageReportingTest.kt
(6 hunks)ee/backend/tests/src/test/kotlin/io/tolgee/ee/selfHostedLimitsAndReporting/SeatUsageReportingTest.kt
(3 hunks)ee/backend/tests/src/test/kotlin/io/tolgee/ee/stubs/TolgeeCloudLicencingClientStub.kt
(1 hunks)
π§ Files skipped from review as they are similar to previous changes (8)
- .github/actions/upload-backend-build/action.yaml
- ee/backend/tests/src/test/kotlin/io/tolgee/ee/selfHostedLimitsAndReporting/SeatUsageReportingTest.kt
- ee/backend/tests/src/test/kotlin/io/tolgee/ee/selfHostedLimitsAndReporting/KeyUsageReportingTest.kt
- ee/backend/tests/src/test/kotlin/io/tolgee/ee/selfHostedLimitsAndReporting/ScheduledUsageReportingTest.kt
- .github/actions/download-backend-build/action.yaml
- .github/workflows/reportIntermittentTests.yml
- .github/workflows/test.yml
- ee/backend/tests/src/test/kotlin/io/tolgee/ee/stubs/TolgeeCloudLicencingClientStub.kt
β° Context from checks skipped due to timeout of 90000ms (4)
- GitHub Check: Ktlint πͺ²
- GitHub Check: Frontend static check πͺ²
- GitHub Check: Build frontend ποΈ
- GitHub Check: Build backend ποΈ
π Additional comments (2)
.github/actions/setup-env/action.yaml (2)
18-23
: Verify Java version requirement
You're pinningjava-version: 21
(Temurin). Confirm that all modules, plugins, and CI steps are fully compatible with Java 21. If you need LTS stability, consider using17
or exposing the version as an input.
29-33
: Verify Node.js version availability
Usingnode-version: 22
may not be supported on all GitHub runners (current stable/LTS is 20). Ensure v22 is available or pin a version range that matches your requirements.
this seems a lot more stable and reliable when heavy magic from Hibernate & friends is involved
none are actually useful, besides pleasing IntelliJ Spring introspection. Uses Kotlin reflection again, but that's not very useful as we don't have inherited logged properties anywhere. Future proofing I guess...
β¦ad of api might cause the thing to build slightly faster, might not. but it's more robust π€·
backend/ktlint/src/test/kotlin/io/tolgee/testing/ktlint/JakartaTransientInEntitiesTest.kt
Outdated
Show resolved
Hide resolved
backend/ktlint/src/test/kotlin/io/tolgee/testing/ktlint/JakartaTransientInEntitiesTest.kt
Outdated
Show resolved
Hide resolved
backend/ktlint/src/test/kotlin/io/tolgee/testing/ktlint/JakartaTransientInEntitiesTest.kt
Outdated
Show resolved
Hide resolved
d95e1a3
to
a2a7e36
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
π§Ή Nitpick comments (1)
.github/workflows/test.yml (1)
131-132
: Switched cache extraction to zstd
Changing from gzip to zstd should speed up (de)compression. Confirmtar --zstd
is supported on the runners and consider adding-C
for explicit extraction paths.Also applies to: 139-140
π Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
π Files selected for processing (78)
.editorconfig
(1 hunks).github/actions/download-backend-build/action.yaml
(1 hunks).github/actions/setup-env/action.yaml
(1 hunks).github/actions/upload-backend-build/action.yaml
(1 hunks).github/workflows/reportIntermittentTests.yml
(6 hunks).github/workflows/test.yml
(8 hunks).java-version
(1 hunks)backend/api/build.gradle
(2 hunks)backend/app/build.gradle
(4 hunks)backend/app/src/main/resources/application.yaml
(0 hunks)backend/app/src/test/kotlin/io/tolgee/activity/ActivityLogTest.kt
(4 hunks)backend/app/src/test/kotlin/io/tolgee/api/v2/controllers/ApiKeyControllerTest.kt
(0 hunks)backend/app/src/test/kotlin/io/tolgee/api/v2/controllers/PatControllerTest.kt
(4 hunks)backend/app/src/test/kotlin/io/tolgee/api/v2/controllers/batch/BatchJobManagementControllerCancellationTest.kt
(1 hunks)backend/app/src/test/kotlin/io/tolgee/api/v2/controllers/translations/v2TranslationsController/TranslationsControllerCursorTest.kt
(1 hunks)backend/app/src/test/kotlin/io/tolgee/api/v2/controllers/translations/v2TranslationsController/TranslationsControllerHistoryTest.kt
(1 hunks)backend/app/src/test/kotlin/io/tolgee/api/v2/controllers/translations/v2TranslationsController/TranslationsControllerModificationTest.kt
(1 hunks)backend/app/src/test/kotlin/io/tolgee/api/v2/controllers/v2ImageUploadController/V2ImageUploadControllerTest.kt
(1 hunks)backend/app/src/test/kotlin/io/tolgee/api/v2/controllers/v2KeyController/KeyControllerCreationTest.kt
(1 hunks)backend/app/src/test/kotlin/io/tolgee/initialUserCreation/LegacyMigrationTest.kt
(1 hunks)backend/data/build.gradle
(8 hunks)backend/data/src/main/kotlin/io/tolgee/activity/EntityDescriptionProvider.kt
(2 hunks)backend/data/src/main/kotlin/io/tolgee/activity/annotation/ActivityDescribingProp.kt
(1 hunks)backend/data/src/main/kotlin/io/tolgee/activity/annotation/ActivityEntityDescribingPaths.kt
(1 hunks)backend/data/src/main/kotlin/io/tolgee/activity/annotation/ActivityIgnoredProp.kt
(1 hunks)backend/data/src/main/kotlin/io/tolgee/activity/annotation/ActivityLoggedEntity.kt
(1 hunks)backend/data/src/main/kotlin/io/tolgee/activity/annotation/ActivityLoggedProp.kt
(1 hunks)backend/data/src/main/kotlin/io/tolgee/activity/annotation/ActivityReturnsExistence.kt
(1 hunks)backend/data/src/main/kotlin/io/tolgee/activity/iterceptor/InterceptedEventsManager.kt
(2 hunks)backend/data/src/main/kotlin/io/tolgee/model/ApiKey.kt
(2 hunks)backend/data/src/main/kotlin/io/tolgee/model/Organization.kt
(1 hunks)backend/data/src/main/kotlin/io/tolgee/model/Pat.kt
(2 hunks)backend/data/src/main/kotlin/io/tolgee/model/Project.kt
(1 hunks)backend/data/src/main/kotlin/io/tolgee/model/StandardAuditModel.kt
(1 hunks)backend/data/src/main/kotlin/io/tolgee/model/UserAccount.kt
(1 hunks)backend/data/src/main/kotlin/io/tolgee/model/activity/ActivityRevision.kt
(1 hunks)backend/data/src/main/kotlin/io/tolgee/model/dataImport/ImportLanguage.kt
(1 hunks)backend/data/src/main/kotlin/io/tolgee/model/glossary/Glossary.kt
(1 hunks)backend/data/src/main/kotlin/io/tolgee/model/keyBigMeta/KeysDistance.kt
(1 hunks)backend/data/src/main/kotlin/io/tolgee/model/translation/Translation.kt
(2 hunks)backend/data/src/main/kotlin/io/tolgee/pubSub/RedisPubSubReceiver.kt
(1 hunks)backend/data/src/main/kotlin/io/tolgee/pubSub/RedisPubSubReceiverConfiguration.kt
(1 hunks)backend/data/src/main/kotlin/io/tolgee/security/ratelimit/RateLimitService.kt
(1 hunks)backend/data/src/main/kotlin/io/tolgee/service/machineTranslation/MtBatchTranslator.kt
(1 hunks)backend/data/src/main/kotlin/io/tolgee/service/security/ApiKeyService.kt
(2 hunks)backend/data/src/test/kotlin/io/tolgee/service/machineTranslation/MtBatchTranslatorTest.kt
(6 hunks)backend/data/src/test/kotlin/io/tolgee/unit/cachePurging/AzureContentStorageConfigCachePurgingTest.kt
(2 hunks)backend/data/src/test/kotlin/io/tolgee/unit/cachePurging/CloudflareContentStorageConfigCachePurgingTest.kt
(1 hunks)backend/development/build.gradle
(2 hunks)backend/ktlint/build.gradle
(1 hunks)backend/ktlint/settings.gradle
(1 hunks)backend/ktlint/src/main/kotlin/io/tolgee/testing/ktlint/TolgeeRulesProvider.kt
(1 hunks)backend/ktlint/src/main/kotlin/io/tolgee/testing/ktlint/rules/JakartaTransientInEntities.kt
(1 hunks)backend/ktlint/src/main/resources/META-INF/services/com.pinterest.ktlint.cli.ruleset.core.api.RuleSetProviderV3
(1 hunks)backend/ktlint/src/test/kotlin/io/tolgee/testing/ktlint/JakartaTransientInEntitiesTest.kt
(1 hunks)backend/misc/build.gradle
(1 hunks)backend/security/build.gradle
(2 hunks)backend/testing/build.gradle
(3 hunks)backend/testing/src/main/kotlin/io/tolgee/fixtures/assert.kt
(1 hunks)backend/testing/src/main/kotlin/io/tolgee/fixtures/scopeAssert.kt
(1 hunks)build.gradle
(1 hunks)ee/backend/app/build.gradle
(1 hunks)ee/backend/tests/build.gradle
(1 hunks)ee/backend/tests/src/test/kotlin/io/tolgee/ee/EeLicensingMockRequestUtil.kt
(1 hunks)ee/backend/tests/src/test/kotlin/io/tolgee/ee/WebhookAutomationTest.kt
(3 hunks)ee/backend/tests/src/test/kotlin/io/tolgee/ee/api/v2/controllers/EeSubscriptionUsageControllerTest.kt
(1 hunks)ee/backend/tests/src/test/kotlin/io/tolgee/ee/api/v2/controllers/task/TaskControllerActivityTest.kt
(0 hunks)ee/backend/tests/src/test/kotlin/io/tolgee/ee/selfHostedLimitsAndReporting/CreditLimitTest.kt
(2 hunks)ee/backend/tests/src/test/kotlin/io/tolgee/ee/selfHostedLimitsAndReporting/KeyCountLimitTest.kt
(2 hunks)ee/backend/tests/src/test/kotlin/io/tolgee/ee/selfHostedLimitsAndReporting/KeyUsageReportingTest.kt
(4 hunks)ee/backend/tests/src/test/kotlin/io/tolgee/ee/selfHostedLimitsAndReporting/ScheduledUsageReportingTest.kt
(6 hunks)ee/backend/tests/src/test/kotlin/io/tolgee/ee/selfHostedLimitsAndReporting/SeatUsageReportingTest.kt
(3 hunks)ee/backend/tests/src/test/kotlin/io/tolgee/ee/service/slack/SavedSlackMessageServiceTest.kt
(1 hunks)ee/backend/tests/src/test/kotlin/io/tolgee/ee/service/slack/SlackConfigServiceTest.kt
(1 hunks)ee/backend/tests/src/test/kotlin/io/tolgee/ee/slack/SlackWithBatchOperationTest.kt
(1 hunks)ee/backend/tests/src/test/kotlin/io/tolgee/ee/stubs/TolgeeCloudLicencingClientStub.kt
(1 hunks)gradle.properties
(1 hunks)settings.gradle
(3 hunks)
π€ Files with no reviewable changes (3)
- ee/backend/tests/src/test/kotlin/io/tolgee/ee/api/v2/controllers/task/TaskControllerActivityTest.kt
- backend/app/src/main/resources/application.yaml
- backend/app/src/test/kotlin/io/tolgee/api/v2/controllers/ApiKeyControllerTest.kt
β Files skipped from review due to trivial changes (7)
- backend/app/src/test/kotlin/io/tolgee/api/v2/controllers/translations/v2TranslationsController/TranslationsControllerModificationTest.kt
- backend/app/src/test/kotlin/io/tolgee/api/v2/controllers/translations/v2TranslationsController/TranslationsControllerCursorTest.kt
- ee/backend/tests/src/test/kotlin/io/tolgee/ee/api/v2/controllers/EeSubscriptionUsageControllerTest.kt
- backend/app/src/test/kotlin/io/tolgee/initialUserCreation/LegacyMigrationTest.kt
- backend/app/src/test/kotlin/io/tolgee/api/v2/controllers/v2KeyController/KeyControllerCreationTest.kt
- .github/actions/upload-backend-build/action.yaml
- backend/ktlint/src/main/kotlin/io/tolgee/testing/ktlint/TolgeeRulesProvider.kt
π§ Files skipped from review as they are similar to previous changes (66)
- backend/data/src/main/kotlin/io/tolgee/activity/annotation/ActivityReturnsExistence.kt
- ee/backend/tests/src/test/kotlin/io/tolgee/ee/EeLicensingMockRequestUtil.kt
- backend/data/src/main/kotlin/io/tolgee/activity/annotation/ActivityLoggedEntity.kt
- backend/ktlint/settings.gradle
- ee/backend/tests/src/test/kotlin/io/tolgee/ee/selfHostedLimitsAndReporting/CreditLimitTest.kt
- ee/backend/tests/src/test/kotlin/io/tolgee/ee/WebhookAutomationTest.kt
- backend/data/src/main/kotlin/io/tolgee/model/UserAccount.kt
- backend/data/src/test/kotlin/io/tolgee/unit/cachePurging/CloudflareContentStorageConfigCachePurgingTest.kt
- .java-version
- backend/data/src/test/kotlin/io/tolgee/unit/cachePurging/AzureContentStorageConfigCachePurgingTest.kt
- backend/ktlint/src/main/resources/META-INF/services/com.pinterest.ktlint.cli.ruleset.core.api.RuleSetProviderV3
- backend/data/src/main/kotlin/io/tolgee/model/keyBigMeta/KeysDistance.kt
- backend/data/src/main/kotlin/io/tolgee/pubSub/RedisPubSubReceiver.kt
- backend/data/src/main/kotlin/io/tolgee/pubSub/RedisPubSubReceiverConfiguration.kt
- backend/testing/build.gradle
- backend/misc/build.gradle
- backend/data/src/main/kotlin/io/tolgee/model/dataImport/ImportLanguage.kt
- ee/backend/tests/src/test/kotlin/io/tolgee/ee/service/slack/SavedSlackMessageServiceTest.kt
- backend/data/src/main/kotlin/io/tolgee/activity/annotation/ActivityIgnoredProp.kt
- backend/testing/src/main/kotlin/io/tolgee/fixtures/scopeAssert.kt
- backend/app/src/test/kotlin/io/tolgee/api/v2/controllers/v2ImageUploadController/V2ImageUploadControllerTest.kt
- backend/data/src/main/kotlin/io/tolgee/activity/annotation/ActivityEntityDescribingPaths.kt
- backend/app/src/test/kotlin/io/tolgee/api/v2/controllers/translations/v2TranslationsController/TranslationsControllerHistoryTest.kt
- backend/app/src/test/kotlin/io/tolgee/api/v2/controllers/PatControllerTest.kt
- ee/backend/tests/src/test/kotlin/io/tolgee/ee/service/slack/SlackConfigServiceTest.kt
- backend/data/src/main/kotlin/io/tolgee/activity/annotation/ActivityDescribingProp.kt
- ee/backend/tests/src/test/kotlin/io/tolgee/ee/slack/SlackWithBatchOperationTest.kt
- backend/data/src/main/kotlin/io/tolgee/activity/EntityDescriptionProvider.kt
- backend/data/src/main/kotlin/io/tolgee/security/ratelimit/RateLimitService.kt
- backend/data/src/main/kotlin/io/tolgee/model/StandardAuditModel.kt
- ee/backend/tests/src/test/kotlin/io/tolgee/ee/selfHostedLimitsAndReporting/SeatUsageReportingTest.kt
- backend/app/src/test/kotlin/io/tolgee/api/v2/controllers/batch/BatchJobManagementControllerCancellationTest.kt
- backend/data/src/main/kotlin/io/tolgee/service/security/ApiKeyService.kt
- backend/data/src/main/kotlin/io/tolgee/model/Project.kt
- backend/data/src/main/kotlin/io/tolgee/model/activity/ActivityRevision.kt
- backend/data/src/main/kotlin/io/tolgee/service/machineTranslation/MtBatchTranslator.kt
- ee/backend/app/build.gradle
- backend/security/build.gradle
- backend/data/src/main/kotlin/io/tolgee/model/Organization.kt
- backend/api/build.gradle
- build.gradle
- backend/data/src/main/kotlin/io/tolgee/activity/iterceptor/InterceptedEventsManager.kt
- backend/testing/src/main/kotlin/io/tolgee/fixtures/assert.kt
- backend/data/src/main/kotlin/io/tolgee/model/ApiKey.kt
- backend/data/build.gradle
- .github/actions/setup-env/action.yaml
- backend/data/src/main/kotlin/io/tolgee/activity/annotation/ActivityLoggedProp.kt
- .github/workflows/reportIntermittentTests.yml
- backend/development/build.gradle
- backend/app/build.gradle
- .github/actions/download-backend-build/action.yaml
- backend/ktlint/build.gradle
- ee/backend/tests/src/test/kotlin/io/tolgee/ee/selfHostedLimitsAndReporting/KeyUsageReportingTest.kt
- ee/backend/tests/src/test/kotlin/io/tolgee/ee/stubs/TolgeeCloudLicencingClientStub.kt
- backend/data/src/main/kotlin/io/tolgee/model/translation/Translation.kt
- backend/ktlint/src/test/kotlin/io/tolgee/testing/ktlint/JakartaTransientInEntitiesTest.kt
- settings.gradle
- ee/backend/tests/src/test/kotlin/io/tolgee/ee/selfHostedLimitsAndReporting/KeyCountLimitTest.kt
- backend/ktlint/src/main/kotlin/io/tolgee/testing/ktlint/rules/JakartaTransientInEntities.kt
- gradle.properties
- .editorconfig
- ee/backend/tests/src/test/kotlin/io/tolgee/ee/selfHostedLimitsAndReporting/ScheduledUsageReportingTest.kt
- backend/data/src/main/kotlin/io/tolgee/model/Pat.kt
- backend/data/src/test/kotlin/io/tolgee/service/machineTranslation/MtBatchTranslatorTest.kt
- ee/backend/tests/build.gradle
- backend/app/src/test/kotlin/io/tolgee/activity/ActivityLogTest.kt
β° Context from checks skipped due to timeout of 90000ms (4)
- GitHub Check: Ktlint πͺ²
- GitHub Check: Frontend static check πͺ²
- GitHub Check: Build frontend ποΈ
- GitHub Check: Build backend ποΈ
π Additional comments (7)
.github/workflows/test.yml (7)
14-14
: Upgraded checkout steps to actions/checkout@v4
Consistently pinning to v4 across all jobs ensures youβre using the latest stable major version.Also applies to: 50-51, 109-110, 179-180, 200-201, 249-251, 272-273, 303-304
16-18
: Consolidated environment setup via composite action
Using.github/actions/setup-env
uniformly removes duplication and centralizes environment configuration.Also applies to: 52-56, 111-113, 181-183, 202-205, 274-276, 305-307
26-29
: Use composite action for backend build and upload
Running./gradlew classes jar bootJar
and uploading viaupload-backend-build
simplifies build logic and improves artifact handling.
57-59
: Replaced manual artifact steps with download-backend-build
Using the composite download action for backend build artifacts in both test and e2e jobs streamlines retrieval.Also applies to: 114-116
47-47
: Verify ktlint run in backend-test matrix
Youβve addedktlint:test
to the backend-test matrix, but thereβs also a dedicatedbackend-code-checks
job. Ensure this duplication is intentional and not causing redundant runs.
285-286
: Compressed caches with zstd
Tarballing node_modules and Cypress cache with zstd is a solid performance boost. Verify the composite action handling these remains compatible.Also applies to: 289-290
296-298
: Upload E2E dependencies as artifacts
Storing bothnode_modules.tar.zst
andcypress_cache.tar.zst
is correct for later reuse in E2E jobs.
Some tests remain a bit flaky it seems, and some requests using dummy keys make it to real-world services (e.g. Google Translate). That's likely unwanted... π |
This is brutal, Cynthia, thanks a lot! ππ |
That one is likely to come bite again at some point; not sure if it'd be possible to somehow disallow it using a linter or something as that's very easy to do by mistake...Summary by CodeRabbit
Summary by CodeRabbit
@Transient
annotations in entity classes.