Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
run: sbt '++ ${{ matrix.scala }}' githubWorkflowCheck

- name: Start databases
run: docker compose up -d mysql postgres
run: docker compose up -d

- name: Build project
run: sbt '++ ${{ matrix.scala }}' -Dslick.testkit-config=test-dbs/testkit-github.conf test
Expand Down
2 changes: 2 additions & 0 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ libraryDependencies += "com.mysql" % "mysql-connector-j" % "9.3.0"

libraryDependencies += "org.slf4j" % "slf4j-simple" % "2.0.17" % "test"

libraryDependencies += "com.oracle.database.jdbc.debug" % "ojdbc8_g" % "21.6.0.0.1" % Test

Comment on lines +30 to +31
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

LGTM! Consider verifying the Oracle JDBC driver version.

The Oracle JDBC debug driver dependency is correctly added with test scope, following the existing pattern for other database drivers. The debug variant (ojdbc8_g) is appropriate for testing environments.


🌐 Web query:

What is the latest version of Oracle JDBC driver ojdbc8_g and are there any known security vulnerabilities in version 21.6.0.0.1?

💡 Result:

The latest version of the Oracle JDBC driver ojdbc8_g is 21.16.0.0, released on November 26, 2024. (mvnrepository.com)

Regarding version 21.6.0.0.1, released on June 14, 2022, there are no publicly disclosed security vulnerabilities associated with this specific version. However, it's important to note that this version is relatively old, and using outdated software can expose your system to potential security risks. For enhanced security and access to the latest features, it's recommended to upgrade to the most recent version of the Oracle JDBC driver.

Citations:


Upgrade Oracle JDBC Driver to Latest Version

The Oracle JDBC debug driver dependency is correctly added with test scope. However, version 21.6.0.0.1 is outdated—no known vulnerabilities have been disclosed, but upgrading ensures you benefit from security patches and new features.

• File: build.sbt
Lines: 30–31
Current:

- libraryDependencies += "com.oracle.database.jdbc.debug" % "ojdbc8_g" % "21.6.0.0.1" % Test
+ libraryDependencies += "com.oracle.database.jdbc.debug" % "ojdbc8_g" % "21.16.0.0"   % Test

References:

  • Latest ojdbc8_g version is 21.16.0.0 (released Nov 26, 2024). [1]
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
libraryDependencies += "com.oracle.database.jdbc.debug" % "ojdbc8_g" % "21.6.0.0.1" % Test
libraryDependencies += "com.oracle.database.jdbc.debug" % "ojdbc8_g" % "21.16.0.0" % Test
🤖 Prompt for AI Agents
In build.sbt around lines 30 to 31, the Oracle JDBC debug driver dependency
version is set to 21.6.0.0.1, which is outdated. Update the version number to
the latest available, 21.16.0.0, to ensure the project benefits from the latest
security patches and features. Replace the existing version string with
"21.16.0.0" while keeping the rest of the dependency declaration unchanged.

(Compile / doc / scalacOptions) ++= Seq("-groups", "-implicits")

scalacOptions ++= Seq("-feature", "-deprecation", "-Xsource:3")
Expand Down
2 changes: 1 addition & 1 deletion ci.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ inThisBuild(List(
githubWorkflowScalaVersions := githubWorkflowScalaVersions.value.map(_.replaceFirst("\\d+$", "x")),
githubWorkflowTargetTags ++= Seq("v*"),
githubWorkflowBuild := Seq(
WorkflowStep.Run(List("docker compose up -d mysql postgres"), name = Some("Start databases")),
WorkflowStep.Run(List("docker compose up -d"), name = Some("Start databases")),
WorkflowStep.Sbt(List("-Dslick.testkit-config=test-dbs/testkit-github.conf", "test"), name = Some("Build project"))
),
githubWorkflowPublishTargetBranches := Seq(RefPredicate.StartsWith(Ref.Tag("v"))),
Expand Down
6 changes: 6 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,9 @@ services:
MYSQL_ALLOW_EMPTY_PASSWORD: "yes"
ports:
- "33060:3306"

oracle:
image: oracleinanutshell/oracle-xe-11g
ports:
- "49160:22"
- "49161:1521"
18 changes: 3 additions & 15 deletions src/test/scala/slick/migration/api/dbs.scala
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@ import java.util.logging.{Level, Logger}

import scala.concurrent.ExecutionContext
import scala.concurrent.ExecutionContext.Implicits.{global => ec}

import slick.dbio.{DBIO, DBIOAction, Effect, NoStream}
import slick.jdbc.GetResult._
import slick.jdbc._
import com.typesafe.slick.testkit.util.{ExternalJdbcTestDB, InternalJdbcTestDB, JdbcTestDB, TestDB}
import org.scalatest.Ignore
import slick.dbio.{DBIO, DBIOAction, Effect, NoStream}
import slick.jdbc.meta.{MColumn, MTable}
import slick.lifted.{AbstractTable, TableQuery}
import slick.model.ForeignKeyAction



object Dialects {
implicit def derby : Dialect[DerbyProfile ] = new DerbyDialect
implicit def h2 : Dialect[H2Profile ] = new H2Dialect
Expand Down Expand Up @@ -108,18 +108,6 @@ class PostgresTest extends DbTest(new ExternalJdbcTestDB("postgres") {
override def columnDefaultFormat(s: String) = s"'$s'::character varying"
}

// copied from slick-testkit

// To test on Oracle:
// * Install Oracle DB
// - manually from https://www.oracle.com/technetwork/database/database-technologies/express-edition/downloads/index.html
// - or using Docker image: oracleinanutshell/oracle-xe-11g
// * Correct connection config in '<project root>/test-dbs/testkit.conf' according to your DB config
// * Download Oracle JDBC driver from https://www.oracle.com/technetwork/database/application-development/jdbc/downloads/index.html
// and put it into '<project root>/lib' directory
// * Remove '@Ignore' below
// * Run 'sbt testOnly *OracleTest'
@Ignore
class OracleTest extends DbTest(new ExternalJdbcTestDB("oracle") {
override val profile: OracleProfile.type = OracleProfile
import profile.api.actionBasedSQLInterpolation
Expand Down
4 changes: 2 additions & 2 deletions test-dbs/testkit.conf
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ mysql {
}

oracle {
enabled = false
enabled = true
driver=oracle.jdbc.OracleDriver
baseURL = "jdbc:oracle:thin:@//localhost:1521/xe"
baseURL = "jdbc:oracle:thin:@//localhost:49161/xe"
testDB = ""
admindb = ""
adminConn {
Expand Down
Loading