Skip to content

#750 Increase the size of pramen_table varchar column.#751

Merged
yruslan merged 3 commits into
mainfrom
feature/750-increase-pramen-table-size
May 20, 2026
Merged

#750 Increase the size of pramen_table varchar column.#751
yruslan merged 3 commits into
mainfrom
feature/750-increase-pramen-table-size

Conversation

@yruslan
Copy link
Copy Markdown
Collaborator

@yruslan yruslan commented May 20, 2026

Summary by CodeRabbit

  • New Features

    • Extended support for longer watcher/table names across bookkeeping, journal, schema and offset areas.
  • Chores

    • Database schema version bumped and existing databases auto-migrated to accommodate expanded name fields.
    • Build tool updated to a newer version.

Review Change Stack

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 20, 2026

Warning

Rate limit exceeded

@yruslan has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 48 minutes and 16 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 7e3a3b2f-4501-4126-85ba-8cd95d68d400

📥 Commits

Reviewing files that changed from the base of the PR and between 037cfe6 and 8e7a3da.

📒 Files selected for processing (1)
  • pramen/core/src/main/scala/za/co/absa/pramen/core/rdb/PramenDb.scala

Walkthrough

This PR widens watcher table name columns (128→255, offset 256→600), adds a PramenDb migration to alter existing columns and increments MODEL_VERSION to 12, updates Slick imports, and applies a small type-pattern change plus an sbt version bump.

Changes

Watcher Table Name Column Extension & Migration

Layer / File(s) Summary
Schema table column definitions
pramen/core/src/main/scala/za/co/absa/pramen/core/bookkeeper/model/BookkeepingTable.scala, pramen/core/src/main/scala/za/co/absa/pramen/core/bookkeeper/model/MetadataTable.scala, pramen/core/src/main/scala/za/co/absa/pramen/core/bookkeeper/model/SchemaTable.scala, pramen/core/src/main/scala/za/co/absa/pramen/core/bookkeeper/model/OffsetTable.scala, pramen/core/src/main/scala/za/co/absa/pramen/core/journal/model/JournalTable.scala
Five Slick table models increase pramenTableName length constraints: bookkeeping, journal, metadata, and schema from 128→255; offset from 256→600.
Database migration and version increment
pramen/core/src/main/scala/za/co/absa/pramen/core/rdb/PramenDb.scala
Adds dbVersion < 12 migration that issues profile-specific ALTER TABLE statements via a new private alterColumn helper, updates Slick imports, and increments MODEL_VERSION from 11→12.

Type Pattern and Build Tooling

Layer / File(s) Summary
Type pattern adjustment and build tooling
pramen/core/src/main/scala/za/co/absa/pramen/core/ExternalChannelFactoryReflect.scala, pramen/project/build.properties
ExternalChannelFactoryReflect.fromConfig pattern match uses ExternalChannelFactoryV2[T @unchecked]. sbt.version updated from 1.11.61.12.11.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Suggested reviewers

  • jozefbakus

Poem

🐰
I hopped through schemas, stretching each name,
From tiny 128s to a grander frame,
Migrations hummed softly, version twelve in sight,
Build tools updated, and the types sleep tight,
A rabbit’s small cheer for a database bright.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: increasing the size of the pramen_table varchar column across multiple database table definitions and applying a schema migration.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/750-increase-pramen-table-size

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

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
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

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@pramen/core/src/main/scala/za/co/absa/pramen/core/rdb/PramenDb.scala`:
- Around line 170-176: The alterColumn method currently builds
PostgreSQL-specific SQL ("ALTER COLUMN ... TYPE ...") which breaks other
engines; update alterColumn in PramenDb to branch on the active slickProfile (or
getProfile()) and emit engine-appropriate DDL: for Postgres/H2 keep "ALTER TABLE
... ALTER COLUMN ... TYPE ...", for MySQL/Oracle use "ALTER TABLE ... MODIFY
COLUMN ...", for SQL Server use "ALTER TABLE ... ALTER COLUMN ..." (without
TYPE), and for SQLite either skip with a clear warning or implement a safe
migrate-by-recreate flow; ensure you still execute the resulting statement via
slickDb.run(sqlu"...").execute() and use slickProfile.quoteIdentifier for
identifiers in each branch.

In `@pramen/project/build.properties`:
- Line 16: Update the sbt.version property value from 1.12.11 to 1.12.10 in the
build properties so the project uses the stable sbt release; locate the
sbt.version entry (the key "sbt.version") and change its value to "1.12.10",
then run a quick build/test to confirm no regressions.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 9d88e4ee-65c5-472e-bbb6-cda4b97e4afe

📥 Commits

Reviewing files that changed from the base of the PR and between f609839 and b0eeec0.

📒 Files selected for processing (8)
  • pramen/core/src/main/scala/za/co/absa/pramen/core/ExternalChannelFactoryReflect.scala
  • pramen/core/src/main/scala/za/co/absa/pramen/core/bookkeeper/model/BookkeepingTable.scala
  • pramen/core/src/main/scala/za/co/absa/pramen/core/bookkeeper/model/MetadataTable.scala
  • pramen/core/src/main/scala/za/co/absa/pramen/core/bookkeeper/model/OffsetTable.scala
  • pramen/core/src/main/scala/za/co/absa/pramen/core/bookkeeper/model/SchemaTable.scala
  • pramen/core/src/main/scala/za/co/absa/pramen/core/journal/model/JournalTable.scala
  • pramen/core/src/main/scala/za/co/absa/pramen/core/rdb/PramenDb.scala
  • pramen/project/build.properties

Comment thread pramen/core/src/main/scala/za/co/absa/pramen/core/rdb/PramenDb.scala Outdated
#

sbt.version=1.11.6
sbt.version=1.12.11
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🌐 Web query:

What is the latest stable version of sbt (Scala Build Tool) and are there any known issues with sbt version 1.12.11?

💡 Result:

Latest stable version of sbt (as of 2026-05-20): sbt 1.12.10. [1][2] Known issues with sbt 1.12.11: 1) The sbt project announced sbt 1.12.11 and its headline change was rolling back an “eviction error in Test configuration” because it broke Scala Native builds. [3] 2) No specific widely-documented security advisories or release-blocking bugs for sbt 1.12.11 were found in the sources I checked. However, sbt 1.12.7 (and earlier affected versions) had a Windows command-injection issue (CVE-2026-32948) fixed in sbt 1.12.7/1.12.8 depending on branch; this means you should ensure your sbt is at least at a version that includes that fix rather than relying on 1.12.11 alone. [4][5][6] 3) Separately, there is a known regression in sbt 1.12.6 where a specific sbt plugin configuration (sbt-site 1.4.1) could cause resolution to hang; this is not about 1.12.11, but it’s an example of known issues around nearby 1.12.x versions. [7] If you want, tell me your OS (Windows/Linux/macOS) and whether you use sbt “source dependencies” (VCS/project refs). I can map those facts to the most relevant advisory/upgrade guidance for your exact risk profile.

Citations:


Consider using sbt 1.12.10 instead of 1.12.11.

As of May 2026, sbt 1.12.10 is the latest stable release, while 1.12.11 appears to be a newer post-stable version. While 1.12.11 does exist and includes a rollback of an eviction error change that broke Scala Native builds, using a non-stable version may introduce unexpected issues. If Scala Native compatibility is not a concern for this project, 1.12.10 is the safer choice.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pramen/project/build.properties` at line 16, Update the sbt.version property
value from 1.12.11 to 1.12.10 in the build properties so the project uses the
stable sbt release; locate the sbt.version entry (the key "sbt.version") and
change its value to "1.12.10", then run a quick build/test to confirm no
regressions.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 20, 2026

Unit Test Coverage

Overall Project 76.99% -0.37% 🍏
Files changed 28.13%

Module Coverage
pramen:core Jacoco Report 78% -0.4%
Files
Module File Coverage
pramen:core Jacoco Report JournalTable.scala 99.74% 🍏
BookkeepingTable.scala 99.44% 🍏
OffsetTable.scala 99.4% 🍏
MetadataTable.scala 99.22% 🍏
SchemaTable.scala 98.77% 🍏
ExternalChannelFactoryReflect.scala 89.17% -0.19% 🍏
PramenDb.scala 41.38% -27.68%

Copy link
Copy Markdown
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

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@pramen/core/src/main/scala/za/co/absa/pramen/core/rdb/PramenDb.scala`:
- Around line 174-194: The MySQL and SQL Server branches in the slickProfile
match (cases for MySQLProfile and SQLServerProfile | HsqldbProfile in
PramenDb.scala) only use #$columnType and therefore drop NOT NULL constraints
for non-Option Slick columns; update the SQL in those branches to append " NOT
NULL" (e.g. change ALTER TABLE ... MODIFY COLUMN #$quotedColumnName #$columnType
to ALTER TABLE ... MODIFY COLUMN #$quotedColumnName #$columnType NOT NULL and
likewise ALTER TABLE ... ALTER COLUMN #$quotedColumnName #$columnType to ...
#$columnType NOT NULL) so the DDL preserves column nullability for the affected
columns declared as column[String] in the Slick tables, leaving other profile
branches unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 635e95c9-5230-49dd-b705-17788a5a4b8d

📥 Commits

Reviewing files that changed from the base of the PR and between b0eeec0 and 037cfe6.

📒 Files selected for processing (1)
  • pramen/core/src/main/scala/za/co/absa/pramen/core/rdb/PramenDb.scala

@yruslan yruslan merged commit 98c77eb into main May 20, 2026
7 checks passed
@yruslan yruslan deleted the feature/750-increase-pramen-table-size branch May 20, 2026 13:02
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.

1 participant