Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

cyyynthia
Copy link
Collaborator

@cyyynthia cyyynthia commented Jun 11, 2025

  • Minor changes to Gradle config scripts
  • Remove Kapt where possible (it's old, and to be replaced by ksp once Hibernate supports it)
  • Enable strict JSR 305 for better integration with NotNull / Nullable annotation from 3p libraries (including Spring)
  • Uses JPA annotations instead of Kotlin's, fixing issues with Hibernate bytecode enhancements
    • 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...
  • Added a custom Ktlint rule to make sure this doesn't happen again
  • Upgraded Apache POI and misc libs

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features
    • Introduced a custom Ktlint rule to enforce correct usage of @Transient annotations in entity classes.
    • Added a new module for Ktlint integration and custom linting rules.
  • Bug Fixes
    • Improved null-safety in various tests and runtime checks.
    • Enhanced annotation handling for entity fields to ensure correct persistence behavior.
  • Refactor
    • Updated annotation targets for several custom annotations to improve compatibility.
    • Simplified and clarified build configurations, toolchain settings, and dependency scopes.
    • Refined annotation access in reflection to rely on Java field annotations.
  • Chores
    • Upgraded dependencies, including Hibernate and Apache POI.
    • Added Ktlint checks to CI workflows and project dependencies.
    • Improved .editorconfig and Gradle settings for consistency and linting support.
    • Refactored GitHub Actions workflows to use reusable composite actions and upgraded action versions.
    • Updated Java version to 21 across build configurations.
  • Tests
    • Added and updated tests for new Ktlint rules and improved test setups with Spring Boot context where needed.
    • Enhanced test mocks and assertions for better null-safety and stability.
    • Introduced a stub for licensing client to control external calls during tests.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jun 11, 2025

Walkthrough

This update introduces a custom Ktlint rule set to enforce the usage of jakarta.persistence.Transient instead of Kotlin's native @Transient in JPA entities, with new Gradle and settings files for the ktlint module. Numerous build scripts and entity classes are refactored for annotation consistency, Java toolchain configuration, and dependency management. Several test classes are annotated for Spring Boot context loading, and assertion utilities are enhanced for improved test expressiveness.

Changes

File(s) / Group Change Summary
.editorconfig Set root, fixed pattern syntax, added warnings, updated indentation and ktlint rule configs.
.github/workflows/test.yml, .github/workflows/reportIntermittentTests.yml Replaced explicit Java/Node setup and caching with custom environment setup action; upgraded checkout action versions; changed backend build to non-parallel compilation; added ktlint test to matrix; switched cache compression to zstd; replaced artifact upload/download with custom actions.
.github/actions/setup-env/action.yaml, .github/actions/upload-backend-build/action.yaml, .github/actions/download-backend-build/action.yaml Added new composite GitHub Actions for environment setup, backend build upload, and backend build download with zstd compression.
settings.gradle Upgraded plugin and library versions; added commonsLang library; included :ktlint project.
gradle.properties Upgraded Hibernate version; removed org.gradle.parallel property.
backend/ktlint/... (all new files) Added ktlint module with Gradle config, custom rules provider, JakartaTransientInEntities rule, service registration, and tests.
backend/api/build.gradle, backend/app/build.gradle, backend/data/build.gradle, backend/development/build.gradle, backend/misc/build.gradle, backend/security/build.gradle, backend/testing/build.gradle, ee/backend/app/build.gradle, ee/backend/tests/build.gradle Replaced Kotlin JVM toolchain with explicit Java 21 toolchain; added ktlint dependency; enforced strict nullability in Kotlin compiler options; updated annotation processor usage; adjusted dependency scopes.
backend/app/src/main/resources/application.yaml Removed Hibernate enhancer properties.
backend/data/src/main/kotlin/io/tolgee/activity/annotation/ActivityDescribingProp.kt, ActivityIgnoredProp.kt, ActivityLoggedProp.kt Changed annotation targets from PROPERTY to FIELD.
backend/data/src/main/kotlin/io/tolgee/activity/annotation/ActivityEntityDescribingPaths.kt, ActivityLoggedEntity.kt, ActivityReturnsExistence.kt Simplified @Target annotation syntax.
backend/data/src/main/kotlin/io/tolgee/activity/EntityDescriptionProvider.kt, activity/iterceptor/InterceptedEventsManager.kt Rewrote annotation detection logic to use Java field reflection on KProperty instances.
backend/data/src/main/kotlin/io/tolgee/model/... (various entity/model files) Removed @Column(insertable = false, updatable = false) annotations on transient properties; ensured use of Jakarta @Transient; simplified validation annotations by removing @field: prefix.
backend/data/src/main/kotlin/io/tolgee/service/security/ApiKeyService.kt Removed unused transaction manager parameter; simplified exception handling.
backend/data/src/main/kotlin/io/tolgee/service/machineTranslation/MtBatchTranslator.kt Removed safe call operator on guaranteed non-null provider.
backend/data/src/main/kotlin/io/tolgee/security/ratelimit/RateLimitService.kt Added fail-fast behavior on cache initialization failure.
backend/data/src/main/kotlin/io/tolgee/pubSub/RedisPubSubReceiver.kt Added null check before sending websocket message.
backend/data/src/main/kotlin/io/tolgee/pubSub/RedisPubSubReceiverConfiguration.kt Changed direct property assignment to setter method call for connection factory.
backend/testing/src/main/kotlin/io/tolgee/fixtures/assert.kt Added satisfies extension function to AssertJ's AbstractAssert.
backend/testing/src/main/kotlin/io/tolgee/fixtures/scopeAssert.kt Updated lambda syntax for assertion.
backend/app/src/test/..., backend/data/src/test/..., ee/backend/tests/src/test/... (various test files) Added @SpringBootTest annotations; added non-null assertions; imported new satisfies extension; refactored mocking and test setups for clarity and strictness.
backend/app/src/test/kotlin/io/tolgee/api/v2/controllers/PatControllerTest.kt Updated assertions to use tokenHash; improved test clarity by adding assertions and correcting test data.
backend/data/src/test/kotlin/io/tolgee/service/machineTranslation/MtBatchTranslatorTest.kt Refactored bean mocking with helper function for cleaner and more concise test setup.
ee/backend/tests/src/test/kotlin/io/tolgee/ee/stubs/TolgeeCloudLicencingClientStub.kt Added stub class to control remote usage reporting enabling/disabling in tests.
ee/backend/tests/src/test/kotlin/io/tolgee/ee/selfHostedLimitsAndReporting/* (various) Injected TolgeeCloudLicencingClientStub and controlled reporting enablement in usage reporting tests.

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
Loading

Possibly related PRs

Suggested labels

enhancement

Poem

(\(\
( -.-) Hop, hop, a rule is bornβ€”
O_(")(") Ktlint checks from dusk till dawn!
No more Kotlin @Transient in JPA’s lair,
Jakarta’s the way, with strict nulls to spare.
Spring tests bloom, beans in a rowβ€”
This bunny’s code garden continues to grow!
πŸ‡βœ¨

✨ Finishing Touches
  • πŸ“ Generate Docstrings

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.

❀️ Share
πŸͺ§ Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need 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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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: Transient encodedKey is fine – maybe mark it as val

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 set

or 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 clear

Using 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
Keeping org.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 custom CacheInitializationException) 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 clear

If httpEntity.body unexpectedly becomes null, the test will throw a bare KotlinNullPointerException, 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 prevents convertAndSend NPEs.
Minor optimization: instantiate jacksonObjectMapper() 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 construct

Blindly 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 using requireNotNull (or assertNotNull 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 with requireNotNull.

-      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 new HttpHeaders

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 after block() to keep the stub self-contained

Stubbing block()!!.token requires the extra !! and makes the chain brittle. You can stub block() to return a non-null AccessToken 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 body

As 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

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between 6aa0994 and ee93fc0.

πŸ“’ 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
Including AnnotationTarget.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 that hibernate-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 the ecosystem enum unquoted. Please update your verification script as follows and re-run (ensure gh 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 usage

Removing the @Column annotation means the flag will never be written to / read from DB, so isNew() will always return the default value unless some service layer sets new = true before persisting.
If this assignment is forgotten, the entity may be treated as β€œexisting” and save() 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 toolchain

Switching 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 changes

Apache 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 mapped

With @Transient only, the ignored 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 consistent

Dropping @Column(insertable = false, updatable = false) means Hibernate will no longer be aware of any token column that might still exist in the database.

  1. If the column is still present, it will silently be left unused (which is usually fine but worth documenting).
  2. 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 | head

Length 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 xml

Length of output: 169


Confirm JPA removal of token column
Ran searches across Kotlin/Java/SQL/XML and found no references to token 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 JPA
backend/data/src/main/kotlin/io/tolgee/model/StandardAuditModel.kt (1)

29-31: disableActivityLogging removed from persistence layer – double-check auditing logic

Marking 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: Use annotationProcessor for Spring config processor
Switching from kapt to annotationProcessor for the configuration processor aligns with the removal of Kapt.

backend/app/build.gradle (4)

35-37: Link annotationProcessor to compileOnly
Extending compileOnly from annotationProcessor 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: Use annotationProcessor for Spring configuration processor
This replaces prior Kapt usage and leverages the standard Java annotation processing mechanism.

backend/data/build.gradle (8)

35-35: Add ktlint configuration
Declaring a dedicated ktlint config sets up Kotlin style checksβ€”ensure it’s integrated into CI.


40-42: Extend compileOnly from annotationProcessor
This makes annotation processor dependencies visible during compilation.


52-52: Apply Kotlin Kapt plugin
Using apply 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: Use annotationProcessor for Spring config processor
Replacing the Kapt dependency for Spring’s config processor with annotationProcessor 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 empty enhancement {} 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 correct

Switching 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; using setConnectionFactory prevents reflective write warnings. Looks good.

backend/data/src/main/kotlin/io/tolgee/model/UserAccount.kt (1)

175-177: πŸ‘ Making disableActivityLogging purely transient is correct

Removing 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’s kotlin.jvm.Transient to jakarta.persistence.Transient aligns with JPA bytecode enhancement and ensures the field is excluded from persistence.


107-108: Apply @Transient to disableActivityLogging
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
Importing jakarta.persistence.Transient here matches the change in other entities and ensures consistency across the module.


80-81: Apply @Transient to disableActivityLogging
Marking this flag with JPA’s @Transient correctly excludes it from database mapping, replacing the former column constraints.

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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 in decodeKey error handling

The two adjacent catch blocks that both return null can be consolidated with runCatching 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 duplicate catch blocks.
β€’ Uses split 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 mock RestTemplate 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

  1. mockAny is never used outside this block – no need to keep a reference.
  2. any<Class<Any>>() is fragile and will fail if the exchange overload changes; match only the parameters you care about.
  3. 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 API

The inline helper is declared as an extension on KClass<T> but never uses this; 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

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between ee93fc0 and 7add2b7.

πŸ“’ 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 good

Dropping the explicit this. qualifier is idiomatic Kotlin and has no functional impact.
No additional issues spotted in the save method.

backend/app/src/test/kotlin/io/tolgee/api/v2/controllers/PatControllerTest.kt (2)

87-99: Correctly migrated checks to tokenHash

Good catch aligning the test with the new persistence model: checking tokenHash instead of the transient token guarantees we’re validating what is actually stored.


104-118: Validation of β€œnever-expires” regeneration looks solid

Asserting 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 boilerplate

Consolidating bean registration through mockIntoAppContext keeps the test readable and maintainable. πŸ‘

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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 the chatPostMessageRequests 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. different classes, webEnvironment, or properties 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-level params shadow variable

params is introduced only to capture the argument of postHog.capture, and it is rewritten exactly once.
Prefer an immutable val populated inside argThat 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: Shadowed it hampers readability

Inside the satisfies { … } block the nested waitFor { … } lambda re-uses the shorthand it, 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 consistency

As 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

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between 996ec84 and 8455723.

πŸ“’ 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 flakiness

Cutting 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.

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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 consistent

Most catalog entries use the 3-arg form (library(alias, group, name).version("x.y")).
The new assertJCore 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 job

The backend-build stage archives only selected modules.
Because ktlint isn’t among them, the later ./gradlew ktlint:test in backend-test
triggers a fresh compile, elongating CI.

Either:

  1. Add :ktlint:build to the build matrix so its classes are in the tarball, or
  2. 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/@MockBeans.
This keeps the test intent intact while noticeably reducing start-up time.

πŸ“œ Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between 8455723 and 08813b7.

πŸ“’ 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 from 24.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 ordering

The 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 ensure backend/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 implementation

Implementation 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-codes MyEntity – tests lock-in a bug

The 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' || true

Length 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" || true

Length of output: 411


Keep the @SpringBootTest import

The 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.

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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-less longValueExact() when converting JSON numbers

id arrives from the JSON assertion API as a BigDecimal.
Using toLong() will silently truncate a non-integral value, whereas longValueExact() (or Kotlin’s toLongExact()) 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 second id usage

For 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

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between 08813b7 and 9de661a.

πŸ“’ 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 good

The 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 appropriate

The 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 helper

The added import is necessary for the new requestFilename check (lines 53-57) and keeps style consistent across tests.

@cyyynthia
Copy link
Collaborator Author

PR's ready! CI fails, but:

  • NPM is having an outage as I'm writing this, so it fails but was all green in previous runs (https://status.npmjs.org/incidents/dn5mcp85737y)
  • ee-test actually succeeds when considering the retry result, but it flags the original failure in the first run
  • Synk may be failing due to the ongoing npm outage perhaps, was green in previous runs

Additional notes:

  • Task collectExternalDependenciesForSentry gets stuck annoyingly often, happened several times in runs for this PR
  • I've seen the error that happened in the last run of ee-test (https://github.com/tolgee/tolgee-platform/runs/43997854855#r39) multiple times, intermittently. Might be worth investigating as that's a source of flaky tests

@cyyynthia cyyynthia requested a review from JanCizmar June 12, 2025 19:29
Copy link
Contributor

@coderabbitai coderabbitai bot left a 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 issue

Use $HOME instead of ~ in upload-artifact paths
The actions/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 in ScheduledUsageReportingTest

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 risk

As 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 – check AbstractSpringTest

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 different webEnvironment 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 predicate

We now list 9 explicit tasks that must honour SKIP_SERVER_BUILD, recently adding compileJava and kaptGenerateStubsKotlin.
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

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between f0b56df and d1262b8.

πŸ“’ 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 stack

The upgrade itself looks fine, but Hibernate minor releases occasionally change byte-code enhancement internals. Please make sure:

  1. hibernate.version overrides in sub-modules were removed (you already propagate via ext – good),
  2. no run-time warnings such as β€œEnhancement failed – class already transformed” appear during the test suite,
  3. 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: Upgrade actions/checkout to v4 across all jobs
Using actions/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 with upload-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: Include ktlint:test in the backend test matrix
Good catchβ€”adding tests for the new ktlint module ensures code-style checks are validated in CI.


116-116: Upgrade cache actions to actions/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 of tar --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: Upgrade actions/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 the setup-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 on upload-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
Uniform tar --zstd usage in both intermittent and main flows reduces cognitive overhead.

Also applies to: 129-129, 204-204, 208-208

@cyyynthia
Copy link
Collaborator Author

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 :)

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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
Inputs java, node, and npm-cache are defined with string defaults. You can improve clarity by adding type: 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 leverage actions/setup-node@v4’s built-in cache: 'npm' option to handle caching uniformly.

πŸ“œ Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between d1262b8 and d95e1a3.

πŸ“’ 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 pinning java-version: 21 (Temurin). Confirm that all modules, plugins, and CI steps are fully compatible with Java 21. If you need LTS stability, consider using 17 or exposing the version as an input.


29-33: Verify Node.js version availability
Using node-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.

cyyynthia added 19 commits June 16, 2025 09:20
you know you've made a really stupid mistake when ai can actually pick it up
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 🀷
@cyyynthia cyyynthia force-pushed the cynthia/gradle-hibernate branch from d95e1a3 to a2a7e36 Compare June 16, 2025 07:29
@cyyynthia cyyynthia changed the title chore: small gradle config improvements, Hibernate fixes chore: Hibernate enhancer, gradle config improvements, GHA refactor Jun 16, 2025
@cyyynthia cyyynthia changed the title chore: Hibernate enhancer, gradle config improvements, GHA refactor chore: Hibernate enhancer, Gradle config & GHA improvements Jun 16, 2025
Copy link
Contributor

@coderabbitai coderabbitai bot left a 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. Confirm tar --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

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between d95e1a3 and a2a7e36.

πŸ“’ 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 via upload-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 added ktlint:test to the backend-test matrix, but there’s also a dedicated backend-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 both node_modules.tar.zst and cypress_cache.tar.zst is correct for later reuse in E2E jobs.

@cyyynthia
Copy link
Collaborator Author

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... πŸ˜…

@cyyynthia cyyynthia requested a review from JanCizmar June 16, 2025 08:02
@JanCizmar
Copy link
Contributor

This is brutal, Cynthia, thanks a lot! πŸš€πŸŽ‰

@JanCizmar JanCizmar merged commit 5ba27cd into main Jun 16, 2025
124 of 130 checks passed
@JanCizmar JanCizmar deleted the cynthia/gradle-hibernate branch June 16, 2025 15:02
@coderabbitai coderabbitai bot mentioned this pull request Oct 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants