Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
110 changes: 110 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
name: CI (compile, build and publish)

on:
push:
branches:
- "master"
pull_request:
branches:
- "master"
release:
types:
- created

jobs:
test:
name: Run Tests
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "16"

- name: Install dependencies
run: npm install

- name: Compile the project
run: npm run compile

publish:
name: Package & Upload VSIX (Fake Publish in Fork, Real in Main)
runs-on: ubuntu-latest
needs: test
if: github.event_name == 'release'

steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: "21"

- name: Install vsce (VS Code Extension Manager)
run: npm install -g @vscode/vsce

- name: Install Dependencies
run: npm install

- name: Build Extension
run: npm run compile

- name: Ensure dist directory exists
run: mkdir -p dist

- name: Package the VSIX file
run: vsce package -o dist/extension.vsix

- name: Upload VSIX Artifact
uses: actions/upload-artifact@v4
with:
name: vscode-extension
path: dist/*.vsix

- name: Publish to marketplace
run: |
if [ "${{ github.repository_owner }}" = "migtools" ]; then
echo "Publishing to VS Code Marketplace..."
vsce publish --pat ${{ secrets.VSCODE_MARKETPLACE_TOKEN }}
fi

pre-publish:
name: Upload VSIX
runs-on: ubuntu-latest
needs: test

steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: "21"

- name: Install vsce (VS Code Extension Manager)
run: npm install -g @vscode/vsce

- name: Install Dependencies
run: npm install

- name: Build Extension
run: npm run compile

- name: Ensure dist directory exists
run: mkdir -p dist

- name: Package the VSIX file
run: vsce package -o dist/extension.vsix

- name: Upload VSIX Artifact
uses: actions/upload-artifact@v4
with:
name: vscode-extension
path: dist/*.vsix
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ node_modules/
data/
out/
build/
dist/
*.vsix
4 changes: 2 additions & 2 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "mta-vscode-extension",
"displayName": "Migration Toolkit for Applications (MTA)",
"description": "Migration Toolkit for Applications (MTA)",
"version": "7.1.1",
"version": "7.3.0",
"license": "epl-2.0",
"publisher": "redhat",
"author": "Red Hat",
Expand Down
140 changes: 80 additions & 60 deletions resources/help.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
"required": true,
"new-features": ["openliberty", "jakarta-ee"],
"available-options":[
"azure-appservice",
"azure-spring-apps",
"camel",
"camel2",
"camel3",
Expand Down Expand Up @@ -77,6 +79,7 @@
"eapxp2",
"eapxp3",
"eapxp5",
"eapxp6",
"fsw",
"fsw6",
"fuse",
Expand Down Expand Up @@ -115,7 +118,10 @@
"quarkus3",
"resteasy",
"resteasy3",
"rhr"
"rhr",
"spring-boot3",
"spring-security6",
"spring6"
],
"editable": true
},
Expand All @@ -126,74 +132,86 @@
"ui-type": ["select-many", "text"],
"required": false,
"available-options": [
"camel",
"camel2",
"camel3",
"drools",
"drools5",
"eap",
"eap4",
"eap5",
"eap6",
"eap7",
"eap7.0",
"eap7.1",
"eapxp",
"glassfish",
"hibernate",
"hibernate-search",
"hibernate-search4",
"hibernate3.9",
"hibernate4",
"hibernate5.0",
"hibernate5.1",
"jakarta-ee",
"jakarta-ee7",
"java",
"java-ee",
"javaee",
"jbpm",
"jbpm5",
"jonas",
"jrun",
"log4j",
"openjdk",
"openjdk11",
"openjdk18",
"openjdk19",
"openjdk20",
"openjdk21",
"openjdk8",
"oraclejdk",
"oraclejdk7",
"orion",
"resin",
"resteasy",
"resteasy2",
"rmi",
"rpc",
"seam",
"seam2",
"soa",
"soa-p",
"soa-p5",
"sonic",
"sonicesb",
"springboot",
"thorntail",
"weblogic",
"websphere"
"camel",
"camel2",
"camel3",
"drools",
"drools5",
"eap",
"eap4",
"eap5",
"eap6",
"eap7",
"eap7.0",
"eap7.1",
"eapxp",
"glassfish",
"hibernate",
"hibernate-search",
"hibernate-search4",
"hibernate3.9",
"hibernate4",
"hibernate5.0",
"hibernate5.1",
"jakarta-ee",
"jakarta-ee7",
"java",
"java-ee",
"javaee",
"jbpm",
"jbpm5",
"jonas",
"jrun",
"log4j",
"openjdk",
"openjdk11",
"openjdk18",
"openjdk19",
"openjdk20",
"openjdk21",
"openjdk8",
"oraclejdk",
"oraclejdk7",
"orion",
"resin",
"resteasy",
"resteasy2",
"rmi",
"rpc",
"seam",
"seam2",
"soa",
"soa-p",
"soa-p5",
"sonic",
"sonicesb",
"spring",
"spring-boot2",
"spring-security5",
"spring5",
"springboot",
"thorntail",
"weblogic",
"websphere"
]
},
{
"name": "rules",
"description": "User Rules Directory/File",
"description": "User Rules Directory/File, If ignored, enable-defualt-rulesets flag below.",
"type": "Path",
"ui-type": ["many", "file_or_directory", "text"],
"placeholder": "No Directories Specified",
"required": false,
"editable": true
},
{
"name": "enable-default-rulesets",
"description": "If set, defualt ruleset will be applied along with custom-rule. Note: Must specify rules if default rulesets are not enabled",
"type": "Boolean",
"ui-type": ["single"],
"required": true,
"editable": true
},
{
"name": "source-only",
"description": "Indicates whether the input is source code or compiled binaries.",
Expand All @@ -211,12 +229,14 @@
"required": true,
"editable": false
},

{
"name": "output",
"description": "The location of the generated analysis results.",
"type": "String",
"ui-type": ["single"],
"required": false
"required": true,
"editable": false
},
{
"name": "analyze-known-libraries",
Expand Down
5 changes: 3 additions & 2 deletions src/editor/configurationView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -347,8 +347,9 @@ export class ConfigurationView {

// cloning...
if (cloning) {
if (vscode.workspace.workspaceFolders) {
const workspaceFolder = vscode.workspace.workspaceFolders[0].uri.fsPath;
if (this.configuration.getinput()) {
const inputPaths = this.configuration.getinput();
const workspaceFolder = vscode.Uri.joinPath(vscode.Uri.file(inputPaths[0])).fsPath;
const folderName = data.value.substring(data.value.lastIndexOf('/') + 1);
const cloneCommand = {repo: data.value, folderName, config: this.configuration, workspaceFolder};
vscode.commands.executeCommand('rhamt.downloadGitRepo', cloneCommand).then((result:any) => {
Expand Down
7 changes: 5 additions & 2 deletions src/server/analyzerModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,12 @@ export class RhamtConfiguration {
}

sourceBase(): string {
return 'file:///tmp/source-code/';
return 'file:///opt/input/source';
}
getinput(): string {
if (!this.options['input']) return undefined;
return this.options['input'];
}

getResultsLocation(): string {
if (!this.options['output']) return undefined;
return path.resolve(this.options['output'], 'results.xml');
Expand Down
4 changes: 1 addition & 3 deletions src/server/analyzerResults.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,7 @@ export class AnalyzerResults {
const incidents = violation.incidents;
if (incidents) {
incidents.forEach(incident => {
const file = (incident.uri as string).replace(this.config.sourceBase(), '');
const root = vscode.workspace.workspaceFolders[0];
const fileUri = vscode.Uri.joinPath(root.uri, file);
let fileUri = vscode.Uri.parse(incident.uri);
try {
const hint = {
type: IIssueType.Hint,
Expand Down
16 changes: 14 additions & 2 deletions src/server/analyzerUtil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,11 @@ export class AnalyzerUtil {
} else {
params.push(`${provider}`);
}

// rules

//list-languages
// params.push('--list-languages');

// rules
let rules = options['rules'];
if (rules && rules.length > 0) {
rules.forEach(entry => {
Expand All @@ -217,6 +220,15 @@ export class AnalyzerUtil {
});
}

if (options['enable-default-rulesets']) {
console.log('enable so setting to true');
params.push('--enable-default-rulesets=true');
}
else {
console.log('disable so setting to false');
params.push('--enable-default-rulesets=false');
}

console.log("Options: ")
for (const key in config.options) {
if (config.options.hasOwnProperty(key)) {
Expand Down
Loading