Skip to content

Commit

Permalink
Upgraded Joern and CPG and using new diff graph API (#256)
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidBakerEffendi authored Jul 3, 2024
1 parent 2b886c2 commit 5c97e7f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down Expand Up @@ -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())
Expand All @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions project/Versions.scala
Original file line number Diff line number Diff line change
@@ -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"
Expand Down

0 comments on commit 5c97e7f

Please sign in to comment.