Skip to content

Commit

Permalink
Update packages (#91)
Browse files Browse the repository at this point in the history
Signed-off-by: Prabhu Subramanian <[email protected]>
  • Loading branch information
prabhu authored Nov 16, 2024
1 parent 8e574fa commit 0612499
Show file tree
Hide file tree
Showing 28 changed files with 1,635 additions and 1,676 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/containers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ on:
workflow_dispatch: # allow to manually trigger this workflow
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: false

env:
REGISTRY: ghcr.io
IMAGE_NAME: appthreat/chen-platform
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ on:
push:
branches: [main]
tags: ["*"]
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: false
jobs:
test:
runs-on: ubuntu-latest
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
name: pr
on: pull_request
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: false
jobs:
pr-tests:
runs-on: ${{ matrix.os }}
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ on:
push:
tags:
- 'v*'
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: false
jobs:
release:
if: github.repository_owner == 'appthreat'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/win_compat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: windows-latest
strategy:
matrix:
python-version: ['3.10','3.11','3.12']
python-version: ['3.10','3.11','3.12','3.13']
with-science: ["--download", "--download --with-science"]
fail-fast: false

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ chennai> help
This error is mostly due to missing python .so (linux), .dll (windows) or .dylib (mac) file. Ensure the environment variables below are set correctly.
- SCALAPY_PYTHON_LIBRARY - Use values such as python3.10, python3.11 based on the version installed. On Windows, there are no dots. python312
- SCALAPY_PYTHON_LIBRARY - Use values such as python3.10, python3.11 based on the version installed. On Windows, there are no dots. python313
- JAVA_TOOL_OPTIONS - jna.library.path must be set to the python lib directory
- SCALAPY_PYTHON_PROGRAMNAME - Path to Python executable in case of virtual environments (Usually not required)
Expand Down
4 changes: 2 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name := "chen"
ThisBuild / organization := "io.appthreat"
ThisBuild / version := "2.1.9"
ThisBuild / scalaVersion := "3.5.1"
ThisBuild / version := "2.2.0"
ThisBuild / scalaVersion := "3.5.2"

val cpgVersion = "1.0.0"

Expand Down
9 changes: 4 additions & 5 deletions chenpy/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,11 +179,10 @@ def install_py_modules(pack="database"):
)
with Progress(transient=True) as progress:
conda_install_script = """conda create --name chenpy-local python=3.12 -y
conda install -n chenpy-local conda-libmamba-solver -y
conda install -n chenpy-local -c conda-forge networkx --solver=libmamba -y
conda install -n chenpy-local -c pytorch pytorch torchtext cpuonly --solver=libmamba -y
conda install -n chenpy-local -c conda-forge numpy packageurl-python nbconvert jupyter_core jupyter_client notebook --solver=libmamba -y
conda install -n chenpy-local -c conda-forge oras-py==0.1.26 httpx websockets orjson rich appdirs psutil gitpython --solver=libmamba -y"""
conda install -n chenpy-local -c conda-forge networkx -y
conda install -n chenpy-local -c pytorch pytorch torchtext cpuonly -y
conda install -n chenpy-local -c conda-forge numpy packageurl-python nbconvert jupyter_core jupyter_client notebook -y
conda install -n chenpy-local -c conda-forge oras-py==0.1.26 httpx websockets orjson rich appdirs psutil gitpython -y"""
for line in conda_install_script.split("\n"):
if line.strip():
task = progress.add_task(line, start=False, total=100)
Expand Down
10 changes: 5 additions & 5 deletions ci/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@ LABEL maintainer="appthreat" \
org.opencontainers.image.authors="Team AppThreat <[email protected]>" \
org.opencontainers.image.source="https://github.com/appthreat/chen" \
org.opencontainers.image.url="https://github.com/appthreat/chen" \
org.opencontainers.image.version="2.1.x" \
org.opencontainers.image.version="2.2.x" \
org.opencontainers.image.vendor="appthreat" \
org.opencontainers.image.licenses="Apache-2.0" \
org.opencontainers.image.title="chen" \
org.opencontainers.image.description="Container image for AppThreat chen code analysis platform" \
org.opencontainers.docker.cmd="docker run --rm -v /tmp:/tmp -v $HOME:$HOME -v $(pwd):/app:rw -it ghcr.io/appthreat/chen chennai"

ARG JAVA_VERSION=23-graalce
ARG JAVA_VERSION=23.0.1-tem
ARG MAVEN_VERSION=3.9.9
ARG GRADLE_VERSION=8.10.1
ARG GRADLE_VERSION=8.11

ENV JAVA_VERSION=$JAVA_VERSION \
MAVEN_VERSION=$MAVEN_VERSION \
Expand Down Expand Up @@ -64,10 +64,10 @@ RUN set -e; \
&& rm -rf /opt/miniconda3/miniconda.sh \
&& ln -s /opt/miniconda3/etc/profile.d/conda.sh /etc/profile.d/conda.sh \
&& echo ". /opt/miniconda3/etc/profile.d/conda.sh" >> ~/.bashrc \
&& conda install python=3.12 -y \
&& conda config --set solver classic \
&& conda update -n base -c defaults conda -y \
&& conda config --add channels conda-forge \
&& conda install -n base conda-libmamba-solver -y \
&& conda config --set solver libmamba \
&& conda init bash \
&& bash -c /opt/conda-install.sh \
&& curl -LO https://repo.almalinux.org/almalinux/9/CRB/${ARCH_NAME}/os/Packages/graphviz-devel-2.44.0-26.el9.${ARCH_NAME}.rpm \
Expand Down
2 changes: 1 addition & 1 deletion codemeta.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"downloadUrl": "https://github.com/AppThreat/chen",
"issueTracker": "https://github.com/AppThreat/chen/issues",
"name": "chen",
"version": "2.1.9",
"version": "2.2.0",
"description": "Code Hierarchy Exploration Net (chen) is an advanced exploration toolkit for your application source code and its dependency hierarchy.",
"applicationCategory": "code-analysis",
"keywords": [
Expand Down
6 changes: 3 additions & 3 deletions console/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name := "console"
enablePlugins(JavaAppPackaging)

val ScoptVersion = "4.1.0"
val CaskVersion = "0.9.4"
val CaskVersion = "0.10.1"
val CirceVersion = "0.14.10"
val ZeroturnaroundVersion = "1.17"

Expand All @@ -24,13 +24,13 @@ libraryDependencies ++= Seq(
"io.circe" %% "circe-generic" % CirceVersion,
"io.circe" %% "circe-parser" % CirceVersion,
"org.zeroturnaround" % "zt-zip" % ZeroturnaroundVersion,
"com.lihaoyi" %% "os-lib" % "0.10.7",
"com.lihaoyi" %% "os-lib" % "0.11.3",
"com.lihaoyi" %% "pprint" % "0.9.0",
"com.lihaoyi" %% "cask" % CaskVersion,
"dev.scalapy" %% "scalapy-core" % "0.5.3",
"org.scala-lang.modules" % "scala-asm" % "9.7.0-scala-2",
"org.scalatest" %% "scalatest" % Versions.scalatest % Test,
"org.scala-lang" %% "scala3-compiler" % "3.5.1"
"org.scala-lang" %% "scala3-compiler" % "3.5.2"
)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,17 +49,17 @@ object Path:
val method = cfgNode.method
sinkCode = method.fullName
caption = if srcNode.code != "this" then s"Source: ${srcNode.code}" else ""
if srcTags.nonEmpty then caption += s"\nSource Tags: ${srcTags}"
caption += s"\nSink: ${sinkCode}\n"
if sinkTags.nonEmpty then caption += s"Sink Tags: ${sinkTags}\n"
var hasCheckLike: Boolean = false;
if srcTags.nonEmpty then caption += s"\nSource Tags: $srcTags"
caption += s"\nSink: $sinkCode\n"
if sinkTags.nonEmpty then caption += s"Sink Tags: $sinkTags\n"
var hasCheckLike: Boolean = false
val tableRows = ArrayBuffer[Array[String]]()
val addedPaths = Set[String]()
path.elements.foreach { astNode =>
val nodeType = astNode.getClass.getSimpleName
val lineNumber = astNode.lineNumber.getOrElse("").toString
val fileName = astNode.file.name.headOption.getOrElse("").replace("<unknown>", "")
var fileLocation = s"${fileName}#${lineNumber}"
var fileLocation = s"$fileName#$lineNumber"
var tags: String = tagAsString(astNode.tag)
if fileLocation == "#" then fileLocation = "N/A"
astNode match
Expand Down Expand Up @@ -96,7 +96,7 @@ object Path:
then
tags = tagAsString(identifier.inCall.head.tag)
if !addedPaths.contains(
s"${fileName}#${lineNumber}"
s"$fileName#$lineNumber"
) && identifier.inCall.nonEmpty
then
tableRows += Array[String](
Expand Down Expand Up @@ -185,13 +185,13 @@ object Path:
)
end match
if isCheckLike(tags) then hasCheckLike = true
addedPaths += s"${fileName}#${lineNumber}"
addedPaths += s"$fileName#$lineNumber"
}
try
if hasCheckLike then caption = s"This flow has mitigations in place.\n$caption"
printFlows(tableRows, caption)
catch
case exc: Exception =>
case _: Exception =>
caption

private def addEmphasis(str: String, isCheckLike: Boolean): String =
Expand All @@ -217,7 +217,7 @@ object Path:
val trow: Array[String] = row.tail
if !trow(3).startsWith("<operator") && trow(3) != "<empty>" && trow(3) != "RET" then
val tagsStr: String = if trow(4).nonEmpty then s"Tags: ${trow(4)}" else ""
val methodStr = s"${trow(1)}\n${tagsStr}"
val methodStr = s"${trow(1)}\n$tagsStr"
table.add_row(
simplifyFilePath(trow(0)),
methodStr.stripMargin,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,10 @@ class SourceToStartingPoints(src: StoredNode) extends RecursiveTask[List[CfgNode

val usagesInOtherClasses = cpg.method.flatMap { m =>
m.fieldAccess
.where(_.argument(1).isIdentifier.typeFullNameExact(typeDecl.fullName))
.or(
_.argument(1).isIdentifier.typeFullNameExact(typeDecl.fullName),
_.argument(1).isTypeRef.typeFullNameExact(typeDecl.fullName)
)
.where { x =>
astNode match
case identifier: Identifier =>
Expand Down
16 changes: 8 additions & 8 deletions meta.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% set version = "2.1.9" %}
{% set version = "2.2.0" %}

package:
name: chen
Expand All @@ -18,17 +18,17 @@ requirements:
- pip
- poetry
run:
- python>=3.10,<3.13
- conda-forge::httpx>=0.27.0
- conda-forge::websockets>=12.0
- conda-forge::orjson>=3.10.1,<4.0.0
- conda-forge::rich>=13.7.1,<14.0.0
- python>=3.10,<3.14
- conda-forge::httpx>=0.27.2
- conda-forge::websockets>=14.1
- conda-forge::orjson>=3.10.11,<4.0.0
- conda-forge::rich>=13.9.4,<14.0.0
- conda-forge::oras-py==0.1.26
- conda-forge::appdirs>=1.4.4,<2.0.0
- conda-forge::psutil>=5.9.8,<6.0.0
- conda-forge::psutil>=6.1.0,<7.0.0
- conda-forge::packageurl-python>=0.11.2,<0.12.0
- conda-forge::gitpython>=3.1.43,<4.0.0
- conda-forge::networkx>=3.3
- conda-forge::networkx>=3.4.2
build:
include_recipe: False
pin_depends: record
Expand Down
2 changes: 1 addition & 1 deletion platform/frontends/c2cpg/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ libraryDependencies ++= Seq(
ExclusionRule(organization = "org.eclipse.platform", name = "org.eclipse.jface"),
ExclusionRule(organization = "org.eclipse.platform", name = "org.eclipse.jface.text")
),
"org.jline" % "jline" % "3.26.3",
"org.jline" % "jline" % "3.27.1",
"org.scalatest" %% "scalatest" % Versions.scalatest % Test
)

Expand Down
2 changes: 1 addition & 1 deletion platform/frontends/javasrc2cpg/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ libraryDependencies ++= Seq(
"io.appthreat" %% "cpg2" % Versions.cpg,
"com.github.javaparser" % "javaparser-symbol-solver-core" % "3.26.2",
"org.scalatest" %% "scalatest" % Versions.scalatest % Test,
"org.projectlombok" % "lombok" % "1.18.34",
"org.projectlombok" % "lombok" % "1.18.36",
"org.scala-lang.modules" %% "scala-parallel-collections" % "1.0.4",
"org.scala-lang.modules" %% "scala-parser-combinators" % "2.4.0",
"net.lingala.zip4j" % "zip4j" % "2.11.5"
Expand Down
16 changes: 8 additions & 8 deletions platform/frontends/jimple2cpg/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ name := "jimple2cpg"
dependsOn(Projects.dataflowengineoss, Projects.x2cpg % "compile->compile;test->test")

libraryDependencies ++= Seq(
"io.appthreat" %% "cpg2" % Versions.cpg,
"org.soot-oss" % "soot" % "4.5.0",
"org.scala-lang.modules" % "scala-asm" % "9.7.0-scala-2",
"org.ow2.asm" % "asm" % "9.7",
"org.ow2.asm" % "asm-analysis" % "9.7",
"org.ow2.asm" % "asm-util" % "9.7",
"org.ow2.asm" % "asm-tree" % "9.7",
"org.scalatest" %% "scalatest" % Versions.scalatest % Test
"io.appthreat" %% "cpg2" % Versions.cpg,
"org.soot-oss" % "soot" % "4.5.0",
"org.scala-lang.modules" % "scala-asm" % "9.7.0-scala-2",
"org.ow2.asm" % "asm" % "9.7.1",
"org.ow2.asm" % "asm-analysis" % "9.7.1",
"org.ow2.asm" % "asm-util" % "9.7.1",
"org.ow2.asm" % "asm-tree" % "9.7.1",
"org.scalatest" %% "scalatest" % Versions.scalatest % Test
)

enablePlugins(JavaAppPackaging, LauncherJarPlugin)
Expand Down
2 changes: 1 addition & 1 deletion platform/src/universal/schema-extender/build.sbt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name := "schema-extender"

ThisBuild / scalaVersion := "3.5.1"
ThisBuild / scalaVersion := "3.5.2"

val cpgVersion = IO.read(file("cpg-version"))

Expand Down
Loading

0 comments on commit 0612499

Please sign in to comment.