From 0d0085c028c0c1a148c78a4461bac9a13cf10df6 Mon Sep 17 00:00:00 2001 From: David Baker Effendi Date: Wed, 3 Jul 2024 15:51:45 +0200 Subject: [PATCH] Upgraded Joern and CPG and using new diff graph API --- .../plume/oss/passes/PlumeConcurrentWriterPass.scala | 3 ++- .../plume/oss/testfixtures/PlumeDriverFixture.scala | 8 ++++---- project/Versions.scala | 4 ++-- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/astcreator/src/main/scala/com/github/plume/oss/passes/PlumeConcurrentWriterPass.scala b/astcreator/src/main/scala/com/github/plume/oss/passes/PlumeConcurrentWriterPass.scala index a1b2ebee..c82eba25 100644 --- a/astcreator/src/main/scala/com/github/plume/oss/passes/PlumeConcurrentWriterPass.scala +++ b/astcreator/src/main/scala/com/github/plume/oss/passes/PlumeConcurrentWriterPass.scala @@ -2,6 +2,7 @@ package com.github.plume.oss.passes import com.github.plume.oss.drivers.IDriver import io.shiftleft.SerializedCpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.utils.ExecutionContextProvider import overflowdb.BatchedUpdate.DiffGraphBuilder @@ -38,7 +39,7 @@ abstract class PlumeConcurrentWriterPass[T <: AnyRef](driver: IDriver) { if (completionQueue.size < producerQueueCapacity && partIter.hasNext) { val next = partIter.next() completionQueue.append(Future.apply { - val builder = new DiffGraphBuilder + val builder = Cpg.newDiffGraphBuilder runOnPart(builder, next.asInstanceOf[T]) val builtGraph = builder.build() driver.bulkTx(builtGraph) diff --git a/drivers/base/src/test/scala/com/github/plume/oss/testfixtures/PlumeDriverFixture.scala b/drivers/base/src/test/scala/com/github/plume/oss/testfixtures/PlumeDriverFixture.scala index c9aaf917..c35c8cd1 100644 --- a/drivers/base/src/test/scala/com/github/plume/oss/testfixtures/PlumeDriverFixture.scala +++ b/drivers/base/src/test/scala/com/github/plume/oss/testfixtures/PlumeDriverFixture.scala @@ -4,7 +4,7 @@ import com.github.plume.oss.drivers.IDriver import io.shiftleft.codepropertygraph.generated.NodeTypes.* import io.shiftleft.codepropertygraph.generated.PropertyNames.* import io.shiftleft.codepropertygraph.generated.nodes.* -import io.shiftleft.codepropertygraph.generated.{DispatchTypes, EdgeTypes} +import io.shiftleft.codepropertygraph.generated.{Cpg, DispatchTypes, EdgeTypes} import org.scalatest.matchers.should.Matchers import org.scalatest.wordspec.AnyWordSpec import org.scalatest.{BeforeAndAfter, BeforeAndAfterAll} @@ -41,7 +41,7 @@ class PlumeDriverFixture(val driver: IDriver) "overflowdb.BatchedUpdate.DiffGraph based changes" should { "should reflect node additions in bulk transactions" in { - val diffGraph = new DiffGraphBuilder + val diffGraph = Cpg.newDiffGraphBuilder // Create some nodes diffGraph.addNode(nodeToNodeCreate(m1)).addNode(nodeToNodeCreate(b1)) driver.bulkTx(diffGraph.build()) @@ -54,8 +54,8 @@ class PlumeDriverFixture(val driver: IDriver) } "should reflect edge additions in bulk transactions" in { - val diffGraph1 = new DiffGraphBuilder - val diffGraph2 = new DiffGraphBuilder + val diffGraph1 = Cpg.newDiffGraphBuilder + val diffGraph2 = Cpg.newDiffGraphBuilder // Create some nodes diffGraph1.addNode(nodeToNodeCreate(m1)).addNode(b1) driver.bulkTx(diffGraph1) diff --git a/project/Versions.scala b/project/Versions.scala index ff45368d..768a0499 100644 --- a/project/Versions.scala +++ b/project/Versions.scala @@ -1,8 +1,8 @@ object Versions { // SAST - val codePropertyGraph = "1.6.14" - val joern = "2.0.421" + val codePropertyGraph = "1.6.16" + val joern = "2.0.433" // Drivers val tinkerGraph = "3.4.11"