Skip to content

Commit

Permalink
Update chen to get memory and performance improvements (#149)
Browse files Browse the repository at this point in the history
* Update chen to get memory and performance improvements

Signed-off-by: Prabhu Subramanian <prabhu@appthreat.com>

* Update scala version

Signed-off-by: Prabhu Subramanian <prabhu@appthreat.com>

* Added endpoints test

Signed-off-by: Prabhu Subramanian <prabhu@appthreat.com>

---------

Signed-off-by: Prabhu Subramanian <prabhu@appthreat.com>
  • Loading branch information
prabhu authored Jul 7, 2024
1 parent 5aea43f commit 590489d
Show file tree
Hide file tree
Showing 11 changed files with 44 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/containers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: '21.x'
node-version: '22.x'
- name: Delete `.rustup` directory
run: rm -rf /home/runner/.rustup # to save disk space
if: runner.os == 'Linux'
Expand Down
11 changes: 8 additions & 3 deletions .github/workflows/nodejstests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
matrix:
os: [ubuntu-latest, macos-latest]
java-version: ['21', '22']
node-version: ['21.x']
node-version: ['20.x', '22.x']
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -51,10 +51,15 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
python-version: '3.12'
- name: Install sbt
run: brew install sbt
if: runner.os == 'macOS'
- name: Install ubuntu packages
run: |
sudo apt update -y
sudo apt install -y zlib1g php-zip
if: runner.os == 'Linux'
- run: |
sbt stage assembly createDistribution
cd wrapper/nodejs
Expand All @@ -75,7 +80,7 @@ jobs:
strategy:
matrix:
java-version: ['21', '22']
node-version: ['21.x']
node-version: ['22.x']
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/npm-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ jobs:
java-version: '21'
- name: Release
run: |
sudo apt update -y
sudo apt install -y zlib1g php-zip
sbt scalafmtCheck stage assembly createDistribution
sha512sum target/atom.zip > target/atom.zip.sha512
npm config set //npm.pkg.github.com/:_authToken=$GITHUB_TOKEN
Expand Down
20 changes: 17 additions & 3 deletions .github/workflows/repotests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: '21.x'
node-version: '22.x'
- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
Expand All @@ -75,12 +75,17 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
python-version: '3.12'
- name: Install sbt
run: brew install sbt
if: runner.os == 'macOS'
- run: |
sbt stage astGenDlTask
python -m pip install atom-tools
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
JAVA_TOOL_OPTIONS: "-Dfile.encoding=UTF-8"
- run: |
./atom.sh --remove-atom -o /tmp/java.atom -l java $GITHUB_WORKSPACE/repotests/shiftleft-java-example -Dlog4j.configurationFile=log4j2.xml
./atom.sh --remove-atom -o /tmp/juice.atom -l js $GITHUB_WORKSPACE/repotests/juice-shop -Dlog4j.configurationFile=log4j2.xml
./atom.sh --remove-atom -o /tmp/ts.atom -l js $GITHUB_WORKSPACE/repotests/shiftleft-ts-example -Dlog4j.configurationFile=log4j2.xml
Expand All @@ -98,11 +103,20 @@ jobs:
./atom.sh usages --remove-atom -o /tmp/java3.atom -l java $GITHUB_WORKSPACE/repotests/shiftleft-java-example -Dlog4j.configurationFile=log4j2.xml --slice-outfile /tmp/java.usages.json
# ./atom.sh usages --remove-atom -o /tmp/juice3.atom -l js $GITHUB_WORKSPACE/repotests/juice-shop -Dlog4j.configurationFile=log4j2.xml --slice-outfile /tmp/juice.usages.json
./atom.sh usages --remove-atom -o /tmp/ts3.atom -l js $GITHUB_WORKSPACE/repotests/shiftleft-ts-example -Dlog4j.configurationFile=log4j2.xml --slice-outfile /tmp/ts.usages.json
./atom.sh usages --remove-atom -o /tmp/py3.atom -l python $GITHUB_WORKSPACE/repotests/DjanGoat -Dlog4j.configurationFile=log4j2.xml --slice-outfile /tmp/py.usages.json
./atom.sh usages --extract-endpoints --remove-atom -o /tmp/py3.atom -l python $GITHUB_WORKSPACE/repotests/DjanGoat -Dlog4j.configurationFile=log4j2.xml --slice-outfile /tmp/py.usages.json
python -m json.tool $GITHUB_WORKSPACE/repotests/DjanGoat/openapi.generated.json
./atom.sh usages --remove-atom -o /tmp/py4.atom -l python $GITHUB_WORKSPACE/repotests/django-DefectDojo -Dlog4j.configurationFile=log4j2.xml --slice-outfile /tmp/py4.usages.json
./atom.sh usages --remove-atom -o /tmp/c3.atom -l c $GITHUB_WORKSPACE/repotests/libexpat -Dlog4j.configurationFile=log4j2.xml --slice-outfile /tmp/c.usages.json
./atom.sh --remove-atom -o /tmp/java-sec-code.atom -l java $GITHUB_WORKSPACE/repotests/java-sec-code -Dlog4j.configurationFile=log4j2.xml -x --export-dir gml_exports
if: runner.os != 'Windows'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
JAVA_TOOL_OPTIONS: "-Dfile.encoding=UTF-8"
- run: |
.\atom.bat usages --extract-endpoints --remove-atom -o $env:GITHUB_WORKSPACE\\repotests\\DjanGoat\\py3.atom -l python $env:GITHUB_WORKSPACE\\repotests\\DjanGoat --slice-outfile $env:GITHUB_WORKSPACE\\repotests\\DjanGoat\\py.usages.json
python -m json.tool $env:GITHUB_WORKSPACE\\repotests\\DjanGoat\\openapi.generated.json
if: runner.os == 'Windows'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
JAVA_TOOL_OPTIONS: "-Dfile.encoding=UTF-8"
Expand Down
6 changes: 3 additions & 3 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name := "atom"
ThisBuild / organization := "io.appthreat"
ThisBuild / version := "2.0.15"
ThisBuild / scalaVersion := "3.4.1"
ThisBuild / version := "2.0.16"
ThisBuild / scalaVersion := "3.4.2"

val chenVersion = "2.0.11"
val chenVersion = "2.1.2"

lazy val atom = Projects.atom

Expand Down
5 changes: 3 additions & 2 deletions ci/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,11 @@ RUN set -e; \
esac; \
echo -e "[nodejs]\nname=nodejs\nstream=20\nprofiles=\nstate=enabled\n" > /etc/dnf/modules.d/nodejs.module \
&& microdnf install -y gcc git-core php php-cli php-curl php-zip php-bcmath php-json php-pear php-mbstring php-devel make \
python3.11 python3.11-devel python3.11-pip \
python3.12 python3.12-devel python3.12-pip \
wget bash glibc-common glibc-all-langpacks java-21-openjdk-headless \
pcre2 findutils which tar gzip zip unzip sudo nodejs \
&& alternatives --install /usr/bin/python3 python /usr/bin/python3.11 1 \
&& alternatives --install /usr/bin/python3 python /usr/bin/python3.12 10 \
&& alternatives --install /usr/bin/python3 python3 /usr/bin/python3.12 10 \
&& python3 --version \
&& node --version \
&& python3 -m pip install --upgrade pip poetry atom-tools \
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/atom",
"issueTracker": "https://github.com/AppThreat/atom/issues",
"name": "atom",
"version": "2.0.15",
"version": "2.0.16",
"description": "Atom is a novel intermediate representation for next-generation code analysis.",
"applicationCategory": "code-analysis",
"keywords": [
Expand Down
2 changes: 1 addition & 1 deletion lib/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
org.eclipse.cdt jars were downloaded from

https://download.eclipse.org/tools/cdt/releases/11.5/cdt-11.5.0/plugins/
https://download.eclipse.org/tools/cdt/releases/11.6/cdt-11.6.1/plugins/
Binary file not shown.
12 changes: 6 additions & 6 deletions wrapper/nodejs/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions wrapper/nodejs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@appthreat/atom",
"version": "2.0.15",
"version": "2.0.16",
"description": "Create atom (⚛) representation for your application, packages and libraries",
"exports": "./index.js",
"type": "module",
Expand All @@ -10,7 +10,7 @@
},
"dependencies": {
"@babel/parser": "^7.24.7",
"typescript": "^5.5.2",
"typescript": "^5.5.3",
"yargs": "^17.7.2"
},
"devDependencies": {
Expand Down

0 comments on commit 590489d

Please sign in to comment.