Skip to content

other/sync-wrapper #51

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 134 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
134 commits
Select commit Hold shift + click to select a range
3032649
Update checkmarx-ast-cli.version (#763)
cx-ben-alvo Sep 23, 2024
ed9e9ae
Update Vorpal Name to ASCA(AST-65647) (#759)
cx-miryam-foifer Sep 23, 2024
92e48ee
[create-pull-request] automated change (#764)
OrShamirCM Sep 23, 2024
434fbfe
Update checkmarx-ast-cli binaries with 2.3.0 (#766)
cx-pedro-lopes Oct 8, 2024
8ad519d
[create-pull-request] automated change (#771)
OrShamirCM Oct 8, 2024
c6981d2
Update checkmarx-ast-cli binaries with 2.3.1 (#773)
cx-pedro-lopes Oct 21, 2024
01d2099
[create-pull-request] automated change (#774)
OrShamirCM Oct 21, 2024
ee9da85
Update checkmarx-ast-cli binaries with 2.3.3 (#776)
cx-pedro-lopes Nov 4, 2024
8870716
[create-pull-request] automated change (#779)
OrShamirCM Nov 4, 2024
eda3bf6
Update Node version ( AST-72890) (#780)
cx-sarah-chen Nov 11, 2024
07bf2bf
Add AST Scan (#783)
amacedoo Nov 11, 2024
446b514
Update checkmarx-ast-cli binaries with 2.3.5 (#784)
cx-pedro-lopes Nov 18, 2024
ed28b72
[create-pull-request] automated change (#785)
OrShamirCM Nov 18, 2024
8636201
delete git lfs
BenAlvo1 Sep 17, 2024
dbde9c1
check
BenAlvo1 Sep 17, 2024
5d21bac
implement CxInstaller.ts
BenAlvo1 Sep 18, 2024
f18cbe2
implement CxInstaller
BenAlvo1 Sep 18, 2024
70896df
check linter
BenAlvo1 Sep 18, 2024
d119074
fix build errors
BenAlvo1 Sep 18, 2024
941b876
check
BenAlvo1 Sep 18, 2024
c820b4b
linter
BenAlvo1 Sep 18, 2024
9a7d999
linter
BenAlvo1 Sep 18, 2024
0d6736b
linter
BenAlvo1 Sep 18, 2024
4955363
check
BenAlvo1 Sep 18, 2024
16dd3ba
fix download address
BenAlvo1 Sep 18, 2024
cbed05b
check
BenAlvo1 Sep 18, 2024
5a39c5f
fix
BenAlvo1 Sep 18, 2024
16f120d
fix console.error
BenAlvo1 Sep 18, 2024
ce29d03
close file
BenAlvo1 Sep 18, 2024
0127653
check
BenAlvo1 Sep 18, 2024
6dcd31a
check
BenAlvo1 Sep 18, 2024
137ba8e
check
BenAlvo1 Sep 18, 2024
4cfa921
fixing
BenAlvo1 Sep 19, 2024
ae35e16
refactor
BenAlvo1 Sep 22, 2024
1154bd7
add logs to check
BenAlvo1 Sep 22, 2024
191e010
check
BenAlvo1 Sep 22, 2024
91a42a3
check
BenAlvo1 Sep 22, 2024
7989121
check
BenAlvo1 Sep 22, 2024
4ea64c8
add logs
BenAlvo1 Sep 22, 2024
17c57f0
try add semaphore
BenAlvo1 Sep 22, 2024
3589e70
Update executable path
BenAlvo1 Sep 22, 2024
59b31f1
fix exec path config
BenAlvo1 Sep 22, 2024
813f4ac
download zip to tmp dir
BenAlvo1 Sep 22, 2024
7278271
check chmod location
BenAlvo1 Sep 22, 2024
cce52ab
add check.txt to resource
BenAlvo1 Sep 22, 2024
0a0bb62
check
BenAlvo1 Sep 22, 2024
8f667c2
remove download cli script
BenAlvo1 Sep 22, 2024
3fc30fa
refactor
BenAlvo1 Sep 22, 2024
d2d4cd4
refactor
BenAlvo1 Sep 22, 2024
6617877
update package.json
BenAlvo1 Sep 22, 2024
f0c0f7e
upgrade to node 16
BenAlvo1 Sep 22, 2024
056f0c3
refactor
BenAlvo1 Sep 22, 2024
106c992
add delete zip file after extracted
BenAlvo1 Sep 23, 2024
4dc6d3e
optimize dependencies
BenAlvo1 Sep 23, 2024
0d53422
remove unessecary dependency
BenAlvo1 Sep 23, 2024
faf444c
fix
BenAlvo1 Sep 23, 2024
8781a0a
re trigger scan
BenAlvo1 Sep 23, 2024
e850c22
retrigger cx scan
BenAlvo1 Sep 23, 2024
1e7bc84
update cliDefaultVersion to 2.2.6
BenAlvo1 Sep 23, 2024
079cbd8
revert jest.config.js changes
BenAlvo1 Sep 23, 2024
44d50de
revert test package.json data changes
BenAlvo1 Sep 23, 2024
9f56f1a
added README.md to resource directory
BenAlvo1 Sep 23, 2024
bc49577
create resource dir if not exists
BenAlvo1 Sep 23, 2024
2baa423
check
BenAlvo1 Sep 23, 2024
875051b
fix
BenAlvo1 Sep 23, 2024
81063ab
set cli version
BenAlvo1 Sep 23, 2024
4830ef0
include version file in package
BenAlvo1 Sep 23, 2024
b7521a7
check
BenAlvo1 Sep 23, 2024
36cc32c
Update update-cli.yml
BenAlvo1 Sep 23, 2024
aebede7
update github actions
BenAlvo1 Sep 23, 2024
ddbe723
fix package.json
BenAlvo1 Sep 23, 2024
6aec7d2
delete enter
BenAlvo1 Sep 23, 2024
507e4ab
add commit sha
BenAlvo1 Sep 24, 2024
0e29919
Update update-cli.yml
BenAlvo1 Sep 24, 2024
73d02a9
added singleton and factory design patterns to CxWrapper
BenAlvo1 Sep 24, 2024
26f46cc
delete unused set/get config
BenAlvo1 Sep 24, 2024
52e1399
refactor
BenAlvo1 Sep 24, 2024
b31a7e8
remove uneeded semaphore from CxInstaller.ts
BenAlvo1 Sep 24, 2024
e5bf9c7
remove semaphore import
BenAlvo1 Sep 24, 2024
6e69b68
added private and public to CxInstaller functions
BenAlvo1 Sep 24, 2024
3b0311d
make CxWrapper constructor private
BenAlvo1 Sep 24, 2024
feb72f8
added "multiple singleton" - one for each different scan configuratio…
BenAlvo1 Sep 24, 2024
01263d0
fix linter
BenAlvo1 Sep 24, 2024
74f1344
resolve conversations
BenAlvo1 Sep 24, 2024
b541284
delete unecessery clone
BenAlvo1 Sep 24, 2024
8c3ddbb
add comment
BenAlvo1 Sep 24, 2024
ba24745
fix linter
BenAlvo1 Sep 24, 2024
4c0632b
revert delete checkExecutableExists
BenAlvo1 Sep 24, 2024
f0c3cb7
make CxWrapperFactory.ts interface and object
BenAlvo1 Sep 24, 2024
49b1bd0
[create-pull-request] automated change (#16)
OrShamirCM Sep 30, 2024
38d8d0e
[create-pull-request] automated change (#18)
OrShamirCM Oct 1, 2024
3310a07
Revert "[create-pull-request] automated change (#18)"
cx-ben-alvo Oct 1, 2024
642bcfe
[create-pull-request] automated change (#20)
OrShamirCM Oct 1, 2024
3e9f9d3
add getVersionFilePath
BenAlvo1 Oct 6, 2024
a51342b
[create-pull-request] automated change (#22)
OrShamirCM Oct 6, 2024
f812c41
Revert "[create-pull-request] automated change (#22)"
cx-ben-alvo Oct 6, 2024
1b57b61
change to version 1.0.0
BenAlvo1 Oct 6, 2024
c87d2ba
chnage to version 1.0.0
BenAlvo1 Oct 6, 2024
1fa465f
[create-pull-request] automated change (#24)
OrShamirCM Oct 6, 2024
1093c2c
[create-pull-request] automated change (#26)
OrShamirCM Oct 7, 2024
c07ae49
change test execution to be synchronized
BenAlvo1 Nov 10, 2024
a432599
add cliInstalledVersion
BenAlvo1 Nov 10, 2024
16f6b87
add proxy support
BenAlvo1 Nov 10, 2024
76ec28c
implemented httpClient and Client interface. Added arm support for li…
BenAlvo1 Nov 10, 2024
bbcf2d2
refactor getArchitecture
BenAlvo1 Nov 10, 2024
7fa9038
refactor
BenAlvo1 Nov 10, 2024
5c69e44
add tupe to client feild in CxInstaller.ts
BenAlvo1 Nov 10, 2024
426a667
remove unnecessary log
BenAlvo1 Nov 10, 2024
f93cc72
refactor
BenAlvo1 Nov 11, 2024
d94bc85
Added unit tests
BenAlvo1 Nov 11, 2024
0c4d05a
update test
BenAlvo1 Nov 11, 2024
f67154f
fix tests
BenAlvo1 Nov 11, 2024
1470e8d
added astClient
BenAlvo1 Nov 11, 2024
c191e98
[create-pull-request] automated change (#29)
OrShamirCM Nov 12, 2024
3380a49
upgrade cli version
BenAlvo1 Nov 13, 2024
69feb73
comment vorpal tests
BenAlvo1 Nov 13, 2024
af14e53
comment vorpal test
BenAlvo1 Nov 13, 2024
5b0f46d
upgrade to node 20
BenAlvo1 Nov 13, 2024
e46ff3d
fix cxInstaller tests
BenAlvo1 Nov 13, 2024
4a41c65
decrease branches coverage
BenAlvo1 Nov 13, 2024
cf6d1b1
upgrade
cx-sarah-chen Nov 7, 2024
e21a720
Revert "[create-pull-request] automated change (#29)"
cx-ben-alvo Nov 13, 2024
51c0eb6
upgrade cli to 2.3.4
BenAlvo1 Nov 14, 2024
b9aa7c0
[create-pull-request] automated change (#32)
OrShamirCM Nov 14, 2024
d0ec359
[create-pull-request] automated change (#33)
OrShamirCM Nov 14, 2024
3e3d0b0
Update checkmarx-ast-cli to 2.3.5
cx-ben-alvo Nov 18, 2024
a06d27c
[create-pull-request] automated change (#35)
OrShamirCM Nov 18, 2024
c8c1622
[create-pull-request] automated change (#37)
OrShamirCM Nov 18, 2024
19ebf17
Revert "[create-pull-request] automated change (#37)"
cx-ben-alvo Nov 18, 2024
1c3b83a
[create-pull-request] automated change (#39)
OrShamirCM Nov 18, 2024
893ba26
Revert "[create-pull-request] automated change (#39)"
cx-ben-alvo Nov 18, 2024
18831fa
[create-pull-request] automated change (#41)
OrShamirCM Nov 18, 2024
6dacceb
[create-pull-request] automated change (#42)
OrShamirCM Nov 18, 2024
5fc8202
uncomment asca tests
BenAlvo1 Nov 26, 2024
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
3 changes: 0 additions & 3 deletions .gitattributes

This file was deleted.

32 changes: 0 additions & 32 deletions .github/scripts/update_cli.sh

This file was deleted.

25 changes: 25 additions & 0 deletions .github/workflows/ast-scan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Checkmarx One Scan
on:
workflow_dispatch:
pull_request:
push:
branches:
- main
schedule:
- cron: '00 7 * * *' # Every day at 07:00

jobs:
cx-scan:
name: Checkmarx One Scan
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Checkmarx One CLI Action
uses: checkmarx/ast-github-action@03a90e7253dadd7e2fff55f5dfbce647b39040a1 # v.2.0.37
with:
base_uri: ${{ secrets.AST_RND_SCANS_BASE_URI }}
cx_tenant: ${{ secrets.AST_RND_SCANS_TENANT }}
cx_client_id: ${{ secrets.AST_RND_SCANS_CLIENT_ID }}
cx_client_secret: ${{ secrets.AST_RND_SCANS_CLIENT_SECRET }}
additional_params: --tags phoenix --threshold "sca-critical=1;sca-high=1;sca-medium=1;sca-low=1;sast-critical=1;sast-high=1;sast-medium=1;sast-low=1;iac-security-critical=1;iac-security-high=1;iac-security-medium=1;iac-security-low=1"
30 changes: 2 additions & 28 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,43 +6,17 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
lfs: true

- name: Install Git LFS
run: |
sudo apt-get update
sudo apt-get install git-lfs
git lfs install

- name: Use Node.js 14
- name: Use Node.js 22.11.0
uses: actions/[email protected]
with:
node-version: 14
node-version: 22.11.0
registry-url: https://npm.pkg.github.com/
- run: npm ci
- name: Code Linting
run: npm run lint
- run: npm run build --if-present

- name: Check existence of cx-linux binary
run: |
if [ ! -f "src/main/wrapper/resources/cx-linux" ]; then
echo "cx-linux binary does not exist"; exit 1;
fi

- name: Check existence of cx.exe binary
run: |
if [ ! -f "src/main/wrapper/resources/cx.exe" ]; then
echo "cx.exe binary does not exist"; exit 1;
fi

- name: Check existence of cx-mac binary
run: |
if [ ! -f "src/main/wrapper/resources/cx-mac" ]; then
echo "cx-mac binary does not exist"; exit 1;
fi

- name: Run tests
env:
CX_CLIENT_ID: ${{ secrets.CX_CLIENT_ID}}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/delete-packages-and-releases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ jobs:

echo "Deleting all npm packages whose name ends with '-${{inputs.tag}}.0'"

VERSION_IDS=($(curl -L -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ secrets.PERSONAL_ACCESS_TOKEN }}" -H "X-GitHub-Api-Version: 2022-11-28" https://api.github.com/orgs/CheckmarxDev/packages/npm/ast-cli-javascript-wrapper/versions | jq '.[]|select(.name | contains("-${{inputs.tag}}.0"))|.id'))
VERSION_IDS=($(curl -L -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ secrets.PERSONAL_ACCESS_TOKEN }}" -H "X-GitHub-Api-Version: 2022-11-28" https://api.github.com/orgs/CheckmarxDev/packages/npm/ast-cli-javascript-wrapper-runtime-cli/versions | jq '.[]|select(.name | contains("-${{inputs.tag}}.0"))|.id'))

for versionId in "${VERSION_IDS[@]}"
do
echo "Deleting version $versionId..."
curl -L -X DELETE -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ secrets.PERSONAL_ACCESS_TOKEN }}" -H "X-GitHub-Api-Version: 2022-11-28" "https://api.github.com/orgs/CheckmarxDev/packages/npm/ast-cli-javascript-wrapper/versions/$versionId"
curl -L -X DELETE -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ secrets.PERSONAL_ACCESS_TOKEN }}" -H "X-GitHub-Api-Version: 2022-11-28" "https://api.github.com/orgs/CheckmarxDev/packages/npm/ast-cli-javascript-wrapper-runtime-cli/versions/$versionId"
echo "Version $versionId deleted successfully!"
done

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ on:

jobs:
nightly:
uses: CheckmarxDev/ast-cli-javascript-wrapper/.github/workflows/release.yml@main
uses: CheckmarxDev/ast-cli-javascript-wrapper-runtime-cli/.github/workflows/release.yml@main
secrets: inherit
13 changes: 2 additions & 11 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ permissions:

jobs:
delete:
uses: CheckmarxDev/ast-cli-javascript-wrapper/.github/workflows/delete-packages-and-releases.yml@main
uses: CheckmarxDev/ast-cli-javascript-wrapper-runtime-cli/.github/workflows/delete-packages-and-releases.yml@main
with:
tag: ${{ inputs.jsTag }}
secrets: inherit
Expand All @@ -58,7 +58,6 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
lfs: true # Ensure LFS files are checked out

# GIT CONFIGURATION
- run: |
Expand All @@ -68,7 +67,7 @@ jobs:
# SETUP NODE
- uses: actions/[email protected]
with:
node-version: 14
node-version: 22.11.0
registry-url: https://npm.pkg.github.com/

# GET TAG NAME
Expand All @@ -80,14 +79,6 @@ jobs:
echo "TAG_NAME=$(npm version patch --no-git-tag-version)" >> $GITHUB_ENV
fi

# DOWNLOAD CLI IF IT IS A DEV VERSION AND A CLI TAG WAS PROVIDED
- name: Download cli with tag ${{ inputs.cliTag }}
if: inputs.dev == true && inputs.cliTag != ''
run: |
# Update binaries
chmod +x ./.github/scripts/update_cli.sh
./.github/scripts/update_cli.sh ${{ inputs.cliTag }}

# RUN NPM INSTALL AND BUILD
- name: NPM ci and build
run: |
Expand Down
58 changes: 26 additions & 32 deletions .github/workflows/update-cli.yml
Original file line number Diff line number Diff line change
@@ -1,59 +1,53 @@
name: Update checkmarx ast cli
name: Update Checkmarx AST CLI

on:
workflow_dispatch:
inputs:
new_cli_version:
description: 'New CLI version (optional)'
required: false
schedule:
- cron: '0 0 * * *'

jobs:
update-checkmarx-cli:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
lfs: true

- name: Install Git LFS
run: |
sudo apt-get update
sudo apt-get install git-lfs
git lfs install

- name: Configure Git user
run: |
git config --global user.name github-actions
git config --global user.email [email protected]

# Fetch the latest Checkmarx AST CLI version
- name: Get Latest Checkmarx API version
id: checkmarx-ast-cli
run: |
echo ::set-output name=release_tag::$(curl -sL https://api.github.com/repos/Checkmarx/ast-cli/releases/latest | jq -r ".tag_name")
echo ::set-output name=current_tag::$(<checkmarx-ast-cli.version)
if [ "${{ github.event.inputs.new_cli_version }}" ]; then
LATEST_VERSION=${{ github.event.inputs.new_cli_version }}
else
LATEST_VERSION=$(curl -sL https://api.github.com/repos/Checkmarx/ast-cli/releases/latest | jq -r ".tag_name")
fi
CURRENT_VERSION=$(<checkmarx-ast-cli.version)
echo ::set-output name=release_tag::$LATEST_VERSION
echo ::set-output name=current_tag::$CURRENT_VERSION

- name: Update Checkmarx cli version
# Update the version file if the latest version differs
- name: Update Checkmarx CLI version in version file
if: steps.checkmarx-ast-cli.outputs.current_tag != steps.checkmarx-ast-cli.outputs.release_tag
env:
RELEASE_TAG: ${{ steps.checkmarx-ast-cli.outputs.release_tag }}
run: |
# Update current release
echo ${{ steps.checkmarx-ast-cli.outputs.release_tag }} > checkmarx-ast-cli.version

- name: Download latest cli and update branch
if: steps.checkmarx-ast-cli.outputs.current_tag != steps.checkmarx-ast-cli.outputs.release_tag
run: |
# Update binaries
chmod +x ./.github/scripts/update_cli.sh
./.github/scripts/update_cli.sh ${{ steps.checkmarx-ast-cli.outputs.release_tag }}

- name: Track large files with Git LFS
# Update the TypeScript file's cliDefaultVersion field
- name: Update cliDefaultVersion in CxInstaller.ts
if: steps.checkmarx-ast-cli.outputs.current_tag != steps.checkmarx-ast-cli.outputs.release_tag
env:
NEW_CLI_VERSION: ${{ steps.checkmarx-ast-cli.outputs.release_tag }}
run: |
git lfs track "src/main/wrapper/resources/cx-linux"
git lfs track "src/main/wrapper/resources/cx.exe"
git lfs track "src/main/wrapper/resources/cx-mac"
git add .gitattributes
git add src/main/wrapper/resources/cx-linux src/main/wrapper/resources/cx.exe src/main/wrapper/resources/cx-mac
git commit -m "Track Checkmarx CLI binaries with Git LFS"
FILE_PATH="src/main/osinstaller/CxInstaller.ts"
# Ensure that 'cliDefaultVersion' is updated correctly
sed -i "s/\(cliDefaultVersion = '\)[^']*\(';\)/\1${NEW_CLI_VERSION}\2/" $FILE_PATH

# Create a Pull Request with the version changes
- name: Create Pull Request
if: steps.checkmarx-ast-cli.outputs.current_tag != steps.checkmarx-ast-cli.outputs.release_tag
uses: peter-evans/create-pull-request@c5a7806660adbe173f04e3e038b0ccdcd758773c #v6
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<img src="./logo.png" alt="Logo" width="80" height="80">
</a>

<h3 align="center">AST-CLI-JAVASCRIPT-WRAPPER</h3>
<h3 align="center">AST-CLI-JAVASCRIPT-WRAPPER-RUNTIME-CLI</h3>

<!-- TABLE OF CONTENTS -->
<details open="open">
Expand Down Expand Up @@ -40,7 +40,7 @@ Add the following dependency:

```
"dependencies": {
"@checkmarxdev/ast-cli-javascript-wrapper": "{version}"
"@checkmarxdev/ast-cli-javascript-wrapper-runtime-cli": "{version}"
}
```

Expand Down Expand Up @@ -86,7 +86,7 @@ setx PATH_TO_EXECUTABLE {value}

Checkmarx - AST Integrations Team

CxProject Link: [https://github.com/CheckmarxDev/ast-cli-javascript-wrapper](https://github.com/CheckmarxDev/ast-cli-javascript-wrapper)
CxProject Link: [https://github.com/CheckmarxDev/ast-cli-javascript-wrapper-runtime-cli](https://github.com/CheckmarxDev/ast-cli-javascript-wrapper-runtime-cli)


© 2021 Checkmarx Ltd. All Rights Reserved.
2 changes: 1 addition & 1 deletion checkmarx-ast-cli.version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.2.6
2.3.5
2 changes: 1 addition & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ module.exports = {
collectCoverageFrom: ['**/*.{ts,tsx}', '!**/*.d.ts', '!**/node_modules/**'],
coverageThreshold: {
"global": {
"branches": 65,
"branches": 60,
"functions": 80,
"lines": 80,
"statements": 80
Expand Down
Loading