Skip to content

Commit 5fa1516

Browse files
authored
Merge pull request #3865 from mercedes-benz/feature-3864-move-sechub-plugin-vscode-code-tosechub-repo
Add sources of sechub plugin vscode #3864
2 parents 1f4bdcf + e8b0bf9 commit 5fa1516

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+13450
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# SPDX-License-Identifier: MIT
2+
name: SecHub plugin vscode CI
3+
on:
4+
push:
5+
branches:
6+
- 'develop'
7+
- 'hotfix'
8+
- 'main'
9+
- 'master'
10+
paths:
11+
- '.github/workflows/sechub-plugin-vscode-ci.yml'
12+
- 'ide-plugins/vscode/**'
13+
pull_request:
14+
paths:
15+
- '.github/workflows/sechub-plugin-vscode-ci.yml'
16+
- 'ide-plugins/vscode/**'
17+
# enable manual triggering of workflow
18+
workflow_dispatch:
19+
20+
jobs:
21+
build:
22+
runs-on: ubuntu-latest
23+
strategy:
24+
matrix:
25+
node: [ 16, 18 ]
26+
27+
defaults:
28+
run:
29+
working-directory: ide-plugins/vscode
30+
steps:
31+
- uses: actions/checkout@v3
32+
- uses: actions/setup-node@v3
33+
with:
34+
# Matrix test using LTS (Long Term Support) versions
35+
node-version: ${{ matrix.node }}
36+
- run: npm ci
37+
# https://code.visualstudio.com/api/working-with-extensions/continuous-integration#github-actions
38+
39+
- run: xvfb-run -a npm test
40+
if: runner.os == 'Linux'
41+
- run: npm test
42+
if: runner.os != 'Linux'
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
# SPDX-License-Identifier: MIT
2+
name: Release
3+
4+
on:
5+
workflow_dispatch:
6+
inputs:
7+
milestone-number:
8+
description: Milestone number for release
9+
default: 15
10+
required: true
11+
jobs:
12+
release-version:
13+
name: Create releases
14+
runs-on: ubuntu-latest
15+
strategy:
16+
matrix:
17+
node: [ 16, 18 ]
18+
19+
defaults:
20+
run:
21+
working-directory: ide-plugins/vscode
22+
steps:
23+
- name: Checkout master
24+
uses: actions/checkout@v3
25+
with:
26+
ref: master
27+
28+
# Build
29+
- uses: actions/setup-node@v3
30+
with:
31+
# Matrix test using LTS (Long Term Support) versions
32+
node-version: ${{ matrix.node }}
33+
# Takes the package information from the packages-lock.json file
34+
- run: npm ci
35+
# https://code.visualstudio.com/api/working-with-extensions/continuous-integration#github-actions
36+
37+
- run: xvfb-run -a npm test
38+
if: runner.os == 'Linux'
39+
40+
- run: npm test
41+
if: runner.os != 'Linux'
42+
43+
- name: Fetch version from package.json
44+
id: version
45+
uses: notiz-dev/github-action-json-property@release
46+
with:
47+
path: 'package.json'
48+
prop_path: 'version'
49+
# Create local tags, so we can build documentation for this tag...
50+
- name: "Show version: v${{ steps.version.outputs.prop }}"
51+
run: echo v${{ steps.version.outputs.prop }}
52+
53+
# To identifiy parts not in git history and leading to "-dirty-$commitId" markern in documentation
54+
- name: Inspect GIT status
55+
if: always()
56+
run: git status > git-status.txt
57+
58+
# -----------------------------------------
59+
# Upload Build Artifacts
60+
# -----------------------------------------
61+
- name: Archive GIT status
62+
if: always()
63+
uses: actions/upload-artifact@v3
64+
with:
65+
name: git-status.txt
66+
path: git-status.txt
67+
retention-days: 14
68+
69+
- name: Archive plugin package
70+
if: always()
71+
uses: actions/upload-artifact@v3
72+
with:
73+
name: sechub
74+
path: dist/sechub.vsix
75+
retention-days: 14
76+
77+
# ******************************************
78+
# Now let's create a new release
79+
# ******************************************
80+
- name: Create plugin release
81+
id: create_server_release
82+
uses: actions/create-release@v1
83+
env:
84+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
85+
with:
86+
tag_name: v${{ steps.version.outputs.prop }}
87+
commitish: master
88+
release_name: Version v${{ steps.version.outputs.prop }}
89+
body: |
90+
Changes in this Release
91+
- Some minor changes on plugin implementation
92+
93+
For more details please look at [Milestone ${{github.event.inputs.milestone-number}}]( https://github.com/mercedes-benz/foss/milestones/${{github.event.inputs.milestone-number}}?closed=1)
94+
draft: true
95+
prerelease: false
96+
- name: Upload release asset
97+
id: upload-release-asset
98+
uses: actions/upload-release-asset@v1
99+
env:
100+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
101+
with:
102+
upload_url: ${{ steps.create_plugin_release.outputs.upload_url }}
103+
asset_path: ./dist/sechub.vsix
104+
asset_name: sechub.vsix
105+
asset_content_type: application/zip

ide-plugins/vscode/.eslintrc.json

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"root": true,
3+
"parser": "@typescript-eslint/parser",
4+
"parserOptions": {
5+
"ecmaVersion": 6,
6+
"sourceType": "module"
7+
},
8+
"plugins": [
9+
"@typescript-eslint"
10+
],
11+
"rules": {
12+
"@typescript-eslint/naming-convention": "warn",
13+
"@typescript-eslint/semi": "warn",
14+
"curly": "warn",
15+
"eqeqeq": "warn",
16+
"no-throw-literal": "warn",
17+
"semi": "off"
18+
}
19+
}

ide-plugins/vscode/.gitignore

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
node_modules
2+
out
3+
.vscode-test/
4+
!.vscode
5+
6+
# Plugin installation packages
7+
*.vsix
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
// See http://go.microsoft.com/fwlink/?LinkId=827846
3+
// for the documentation about the extensions.json format
4+
"recommendations": [
5+
"dbaeumer.vscode-eslint"
6+
]
7+
}
+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
// A launch configuration that compiles the extension and then opens it inside a new window
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
{
6+
"version": "0.2.0",
7+
"configurations": [
8+
{
9+
"name": "Run Extension",
10+
"type": "extensionHost",
11+
"request": "launch",
12+
"args": [
13+
"--extensionDevelopmentPath=${workspaceFolder}"
14+
],
15+
"outFiles": [
16+
"${workspaceFolder}/out/**/*.js"
17+
],
18+
"preLaunchTask": "${defaultBuildTask}"
19+
},
20+
{
21+
"name": "Extension Tests",
22+
"type": "extensionHost",
23+
"request": "launch",
24+
"args": [
25+
"--extensionDevelopmentPath=${workspaceFolder}",
26+
"--extensionTestsPath=${workspaceFolder}/out/test/suite/index"
27+
],
28+
"outFiles": [
29+
"${workspaceFolder}/out/test/**/*.js"
30+
],
31+
"preLaunchTask": "${defaultBuildTask}"
32+
}
33+
]
34+
}
+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// Place your settings in this file to overwrite default and user settings.
2+
{
3+
"files.exclude": {
4+
"out": false // set this to true to hide the "out" folder with the compiled JS files
5+
},
6+
"search.exclude": {
7+
"out": true // set this to false to include "out" folder in search results
8+
},
9+
// Turn off tsc task auto detection since we have the necessary tasks as npm scripts
10+
"typescript.tsc.autoDetect": "off",
11+
}

ide-plugins/vscode/.vscode/tasks.json

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// See https://go.microsoft.com/fwlink/?LinkId=733558
2+
// for the documentation about the tasks.json format
3+
{
4+
"version": "2.0.0",
5+
"tasks": [
6+
{
7+
"type": "npm",
8+
"script": "watch",
9+
"problemMatcher": "$tsc-watch",
10+
"isBackground": true,
11+
"presentation": {
12+
"reveal": "never"
13+
},
14+
"group": {
15+
"kind": "build",
16+
"isDefault": true
17+
}
18+
}
19+
]
20+
}

ide-plugins/vscode/.vscodeignore

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
.vscode/**
2+
.vscode-test/**
3+
out/test/**
4+
src/**
5+
.gitignore
6+
.yarnrc
7+
other/spdx/**
8+
**/tsconfig.json
9+
**/.eslintrc.json
10+
**/*.map
11+
**/*.ts
+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
Copyright 2021
2+
3+
[sechub-plugin-vscode : 0.1.0]
4+
5+
Phase: RELEASED
6+
Distribution: OPENSOURCE
7+
8+
Components:
9+
10+
11+
Licenses:

ide-plugins/vscode/CHANGELOG.md

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<!-- SPDX-License-Identifier: MIT --->
2+
# Change Log
3+
4+
All notable changes to the "sechub-plugin-vscode" extension will be documented in this file.
5+
6+
Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file.
7+
8+
## [1.0.1] - 2023-06-14
9+
- Fix README issue by converting AsciiDoc to Markdown
10+
11+
## [1.0.0] - 2023-06-14
12+
- Fixed issues importing reports
13+
- Dependencies updated
14+
- Minimum NodeJS version 16
15+
16+
## [0.1.3] - 2022-03-22
17+
- Dependencies updated
18+
- Workflow uses Node 14
19+
- Notice about move of namespace added
20+
21+
## [0.1.2] - 2022-03-18
22+
- Dependencies updated
23+
- rebranding to Mercedes-Benz
24+
25+
## [0.1.1] - 2021-12-14
26+
- Dependencies updated
27+
28+
## [0.1.0]
29+
- Initial release
30+
- User has possibility to load existing SecHub report from local file system.
31+
- Loaded reports can be crawled and editor will show up when source is available
32+
- If CWE information is available a link is provided in details
33+
34+
## [Unreleased]

ide-plugins/vscode/LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2020 Daimler TSS GmbH
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)